gitea: Gitea 1.14.0 not running as Windows service

  • Gitea version (or commit ref): 1.14.0
  • Git version: 2.18.0
  • Operating system: Windows Server 2012 R2
  • Database:
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:
    Log 2021/04/13 18:23:56 …dules/setting/log.go:333:newLogService() [I] Gitea Log Mode: File(File:debug) 2021/04/13 18:23:56 …dules/setting/log.go:250:generateNamedLogger() [I] Router Log: Console(console:debug) 2021/04/13 18:23:56 …les/setting/cache.go:73:newCacheService() [I] Cache Service Enabled 2021/04/13 18:23:56 …les/setting/cache.go:88:newCacheService() [I] Last Commit Cache Service Enabled 2021/04/13 18:23:56 …s/setting/session.go:77:newSessionService() [I] Session Service Enabled 2021/04/13 18:23:56 …es/setting/mailer.go:109:newMailService() [I] Mail Service Enabled 2021/04/13 18:23:56 …es/setting/mailer.go:120:newRegisterMailService() [I] Register Mail Service Enabled 2021/04/13 18:23:56 …es/setting/mailer.go:131:newNotifyMailService() [I] Notify Mail Service Enabled 2021/04/13 18:23:56 …s/storage/storage.go:158:initAttachments() [I] Initialising Attachment storage with type: 2021/04/13 18:23:56 …les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at C:\Gitea\data\attachments 2021/04/13 18:23:56 …s/storage/storage.go:152:initAvatars() [I] Initialising Avatar storage with type: 2021/04/13 18:23:56 …les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at C:\Gitea\data\avatars 2021/04/13 18:23:56 …s/storage/storage.go:170:initRepoAvatars() [I] Initialising Repository Avatar storage with type: 2021/04/13 18:23:56 …les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at C:\Gitea\data\repo-avatars 2021/04/13 18:23:56 …s/storage/storage.go:164:initLFS() [I] Initialising LFS storage with type: 2021/04/13 18:23:56 …les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at C:/Gitea/data/lfs 2021/04/13 18:23:56 …ueue_disk_channel.go:137:Run() [D] PersistableChannelQueue: push_update Starting 2021/04/13 18:23:56 …ue/queue_bytefifo.go:96:Run() [D] level: push_update-level Starting 2021/04/13 18:23:56 …ueue_disk_channel.go:137:Run() [D] PersistableChannelQueue: mail Starting 2021/04/13 18:23:56 …ue/queue_bytefifo.go:96:Run() [D] level: mail-level Starting 2021/04/13 18:23:56 …ueue_disk_channel.go:137:Run() [D] PersistableChannelQueue: notification-service Starting 2021/04/13 18:23:56 …ue/queue_bytefifo.go:96:Run() [D] level: notification-service-level Starting 2021/04/13 18:23:56 routers/init.go:150:GlobalInit() [I] SQLite3 Supported 2021/04/13 18:23:56 routers/init.go:68:initDBEngine() [I] Beginning ORM engine initialization. 2021/04/13 18:23:56 routers/init.go:75:initDBEngine() [I] ORM engine initialization attempt #1/10… 2021/04/13 18:23:56 …om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mssql 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table user Column keep_email_private db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table user Column last_repo_visibility db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table user Column is_active db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table user Column is_admin db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table user Column allow_git_hook db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table user Column allow_import_local db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table user Column allow_create_organization db default is 0, struct default is 1 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table user Column use_custom_avatar db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table user column theme db type is NVARCHAR(30), struct type is NVARCHAR(255) 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table user Column keep_activity_private db default is , struct default is 0 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table user Column keep_activity_private db nullable is true, struct nullable is false 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table repository column description db type is NVARCHAR(255), struct type is NVARCHAR(MAX) 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table repository column website db type is NVARCHAR(255), struct type is NVARCHAR(2048) 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table repository Column original_service_type db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table repository column original_url db type is NVARCHAR(255), struct type is NVARCHAR(2048) 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table repository Column is_private db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table repository Column is_mirror db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table repository Column is_fsck_enabled db default is 0, struct default is 1 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table upload column uuid db type is NVARCHAR(40), struct type is VARCHAR(40) 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table issue Column is_closed db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table issue Column is_pull db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table pull_request Column has_merged db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table comment Column removed_assignee db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table comment Column invalidated db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table comment has column old_assignee_id but struct has not related field 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table attachment column uuid db type is NVARCHAR(40), struct type is VARCHAR(40) 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table milestone Column is_closed db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table mirror Column enable_prune db default is 0, struct default is 1 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table webhook Column is_system_webhook db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table webhook Column is_system_webhook db nullable is false, struct nullable is true 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table webhook Column http_method db default is ‘POST’, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table webhook Column is_ssl db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table webhook Column is_active db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table hook_task Column is_ssl db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table hook_task Column is_delivered db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table hook_task Column is_succeed db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table org_user Column is_public db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table email_address Column is_activated db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table issue_user Column is_read db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table issue_user Column is_mentioned db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table gpg_key Column can_sign db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table gpg_key Column can_encrypt_comms db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table gpg_key Column can_encrypt_storage db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table gpg_key Column can_certify db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table external_login_user column access_token db type is NVARCHAR(255), struct type is NVARCHAR(MAX) 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table external_login_user column access_token_secret db type is NVARCHAR(255), struct type is NVARCHAR(MAX) 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table external_login_user column refresh_token db type is NVARCHAR(255), struct type is NVARCHAR(MAX) 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table protected_branch Column enable_whitelist db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table issue_watch Column is_watching db default is 0, struct default is 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table tracked_time Column time db nullable is true, struct nullable is false 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table review column type db type is NVARCHAR(255), struct type is INT 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table language_stat Column language db nullable is true, struct nullable is false 2021/04/13 18:23:56 …rfave/cli/command.go:173:Run() [W] Table session has column created_unix but struct has not related field 2021/04/13 18:23:56 routers/init.go:155:GlobalInit() [I] ORM engine initialization successful! 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: update_mirrors 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: repo_health_check 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: check_repo_stats 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: archive_cleanup 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: sync_external_users 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: deleted_branches_cleanup 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: update_migration_poster_id 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: cleanup_hook_task_table 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: delete_inactive_accounts 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: delete_repo_archives 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: git_gc_repos 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: resync_all_sshkeys 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: resync_all_sshprincipals 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: resync_all_hooks 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: reinit_missing_repos 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: delete_missing_repos 2021/04/13 18:23:56 …odules/cron/tasks.go:120:RegisterTask() [D] Registering task: delete_generated_repository_avatars 2021/04/13 18:23:57 …er/issues/indexer.go:142:func2() [I] PID 5476: Initializing Issue Indexer: bleve 2021/04/13 18:23:57 …er/issues/indexer.go:171:func2() [D] Created Bleve Indexer 2021/04/13 18:23:57 …er/issues/indexer.go:221:func3() [I] Issue Indexer Initialization took 8.0033ms 2021/04/13 18:23:57 …ue/queue_bytefifo.go:96:Run() [D] level: issue_indexer Starting 2021/04/13 18:23:57 …ueue_disk_channel.go:162:Run() [D] PersistableChannelUniqueQueue: repo_stats_update Starting 2021/04/13 18:23:57 …ue/queue_bytefifo.go:96:Run() [D] unique-level: repo_stats_update-level Starting 2021/04/13 18:23:57 …xer/stats/indexer.go:38:populateRepoIndexer() [I] Populating the repo stats indexer with existing repositories 2021/04/13 18:23:57 …xer/stats/indexer.go:84:populateRepoIndexer() [I] Done (re)populating the repo stats indexer with existing repositories 2021/04/13 18:23:57 …ueue_disk_channel.go:162:Run() [D] PersistableChannelUniqueQueue: pr_patch_checker Starting 2021/04/13 18:23:57 …ue/queue_bytefifo.go:96:Run() [D] unique-level: pr_patch_checker-level Starting 2021/04/13 18:23:57 …ueue_disk_channel.go:137:Run() [D] PersistableChannelQueue: task Starting 2021/04/13 18:23:57 …ue/queue_bytefifo.go:96:Run() [D] level: task-level Starting 2021/04/13 18:23:57 …i/websspi_windows.go:87:New() [I] Credential handle expiry: 2185-07-21 00:34:33.712009116 +0100 CET 2021/04/13 18:23:59 cmd/web.go:189:listen() [I] Listen: https://0.0.0.0:3000 2021/04/13 18:23:59 cmd/web.go:192:listen() [I] LFS server enabled 2021/04/13 18:23:59 …s/graceful/server.go:55:NewServer() [I] Starting new Web server: tcp:0.0.0.0:3000 on PID: 5476 2021/04/13 18:23:59 …s/graceful/server.go:66:func1() [D] Starting server on tcp:0.0.0.0:3000 (PID: 5476)

Description

I’m running Gitea as a Windows service. Service GiteaSvc is launching C:\Gitea\gitea.exe web --config C:\Gitea\conf\app.ini. This was working fine until updating from version 1.13.4 to 1.14.0. Now attempting to run net start giteasvc results in

The service is not responding to the control function.

More help is available by typing NET HELPMSG 2186.

The Windows event logs show errors 7009 and 7000:

A timeout was reached (30000 milliseconds) while waiting for the GiteaSvc service to connect.

The GiteaSvc service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion.

I captured debug logs but didn’t notice anything that looks like an error. Running C:\Gitea\gitea.exe web --config C:\Gitea\conf\app.ini from a command line window still works fine.

Can anyone please help me to restore my Gitea installation? Happy to try out things or supply additional information.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 43 (18 by maintainers)

Commits related to this issue

Most upvoted comments

Until this gets fixed, I’m sharing my temporary workaround to make it work as a service again. Use it at your own risk, I can’t guarantee that it has no drawbacks or any unexpected behavior…

The workaround is based on the open-source project called WinSW.

WinSW wraps and manages any application as a Windows service.

(BTW I’m also using WinSW for a long time running my local Nginx server - which serves Gitea - on Windows without any problem.)

So I followed their “Use WinSW as a bundled tool” instructions and made my gitea-winsw.exe - which is WinSW.NET461.exe renamed (requires .NET installed!) - and gitea-winsw.xml in my Gitea dir.

In my case, the xml file looks like this (modify it for your needs):

<configuration>
  <id>gitea-winsw</id>
  <name>gitea-winsw</name>
  <description>Gitea-WinSW</description>

  <executable>%BASE%\gitea.exe</executable>
  <arguments>web --config E:\RS7\gitea\custom\conf\app.ini</arguments>
  <workingdirectory>E:\RS7\gitea</workingdirectory>

  <logpath>E:\RS7\gitea\log</logpath>
  <logmode>roll</logmode>

  <depend></depend>
</configuration>

Although this service can be installed with the --user and --pass options, I omitted them and rather set the login info later by modifying the created service using services.msc and the Log On tab (as usual). So my install command was only:

.\gitea-winsw.exe install

This successfully created my new gitea-winsw service. Now I’ve just set my desired user to run this service and started it. Gitea is running fine again!

@zeripath seems OK!! Start/Restart, all works as expected.

We observed exactly the same behaviour on our test-system wehn trying to update to Gitea 1.14.0. Using the Local System account to run Gitea is no solution for us as it breaks functionality we need. The Local System account has no accesss to network ressources (network file shares in our company) and in our scenario is not allowed to connect to the internet. So in our case, switching to the Local System account breaks Github mirroring and repository migrations from network shares. We need to be able to run the Gitea service with a domain account. I will try to increase the service timeout this evening and see if this helps.