[Solved] Gitea terminates after localhost:3000/install form submitted


#1

Hello!

I’m having issues getting gitea working from a binary under CentOS release 6.4 (Final). I got it working fine under OpenSUSE 13.2 w/ mariadb two weeks ago. Gitea drops back to the command line during install config after this SQL:

2018/08/16 15:16:10 [I] [SQL] SELECT `id`, `type`, `name`, `is_actived`, `is_sync_enabled`, `cfg`, `created_unix`, `updated_unix` FROM `login_source` WHERE (is_actived = ? and type = ?) []interface {}{true, 6}

More attempts with a couple of lines of context beforehand…

2018/08/16 15:16:10 [I] [SQL] SELECT `COLUMN_NAME`, `IS_NULLABLE`, `COLUMN_DEFAULT`, `COLUMN_TYPE`, `COLUMN_KEY`, `EXTRA`,`COLUMN_COMMENT` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = ? AND `TABLE_NAME` = ? [gitea webhook]
2018/08/16 15:16:10 [I] [SQL] SELECT `INDEX_NAME`, `NON_UNIQUE`, `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`STATISTICS` WHERE `TABLE_SCHEMA` = ? AND `TABLE_NAME` = ? [gitea webhook]
2018/08/16 15:16:10 [I] [SQL] SELECT `id`, `type`, `name`, `is_actived`, `is_sync_enabled`, `cfg`, `created_unix`, `updated_unix` FROM `login_source` WHERE (is_actived = ? and type = ?) []interface {}{true, 6}

2018/08/16 15:46:11 [I] [SQL] CREATE TABLE IF NOT EXISTS `oauth2_session` (`id` TEXT PRIMARY KEY NOT NULL, `data` TEXT NULL, `created_unix` INTEGER NULL, `updated_unix` INTEGER NULL, `expires_unix` INTEGER NULL)
2018/08/16 15:46:11 [I] [SQL] CREATE INDEX `IDX_oauth2_session_expires_unix` ON `oauth2_session` (`expires_unix`)
2018/08/16 15:46:11 [I] [SQL] SELECT `id`, `type`, `name`, `is_actived`, `is_sync_enabled`, `cfg`, `created_unix`, `updated_unix` FROM `login_source` WHERE (is_actived = ? and type = ?) []interface {}{true, 6}

2018/08/16 15:50:14 [I] [SQL] SELECT sql FROM sqlite_master WHERE type='index' and tbl_name = ? [oauth2_session]
2018/08/16 15:50:14 [I] [SQL] SELECT `id`, `type`, `name`, `is_actived`, `is_sync_enabled`, `cfg`, `created_unix`, `updated_unix` FROM `login_source` WHERE (is_actived = ? and type = ?) []interface {}{true, 6}

I’ve tried mariadb, mysqld, SQlite3 with the same results. I’ve tried today’s master branch as well as 1.5.0 (both of which worked fine for me under OpenSUSE).

I’ve tried a number of different configuration options, from bare-minimum-changes to validate to heavily-modified.

A google search on the sql didn’t turn up anything.

Is there any way I can get additional information about why it seemingly crashes?

Thanks!


#2

I finally figured it out. I found the log in /var/lib/gitea/log/gitea.log.

The first problem was a permission problem. Starting gitea using “sudo -u git /usr/local/bin/gitea” was failing halfway through the installation because it was attempting to stat

2018/08/16 15:50:14 [...gitea/models/repo.go:144 NewRepoContext()] [E] Failed to set git user.name(exec(2:NewRepoContext(set user.name)) failed: exit status 128(<nil>) stdout:  stderr: fatal: failed to stat '/home/cvs/gitea': Permission denied
): fatal: failed to stat '/home/cvs/gitea': Permission denied

Su-ing to git first and changing the cwd fixed that issue;

sudo su git
cd ~git
/usr/local/bin/gitea web -c /etc/gitea/app.ini

The next issue I hit was https://github.com/go-gitea/gitea/issues/4672

[...les/indexer/issue.go:64 InitIssueIndexer()] [E] InitIssuesIndexer: create index, mkdir /usr/local/bin/data: permission denied

2018/08/17 07:24:28 [T] AppWorkPath: /usr/local/bin

Starting with that manually defined fixed the remaining issue.

GITEA_WORK_DIR="/var/lib/gitea" /usr/local/bin/gitea