Problems moving gitea instance to new server

I had to move my personal gitea instance to a new server. In doing so i had to change OSes and Gitea version (upgrade) – not my choice per se.

copied the app.ini, db backup, and filestore to new server and the service tries to start, but fails with this error message:

Unable to register cron task update_mirrors Error:translation is missing for task “update_mirrors”, please add translation for “admin.dashboard.update_mirrors”

What does this mean, and how can I fix it? New host is FreeBSD, Gitea version: 1.18.3

Hi

I have the exact same issue here.
I’m also on FreeBSD (12.4), and my Gitea version is 1.19.2

Any help would be much appreciated.

Thanks!

I believe this error is a red herring, as a missing translation for your locale will not cause a crash after v1.17. It looks like the code that is getting the configuration for [cron.update_mirrors] is erroring but not providing an error, so Gitea defaults to the missing translation.

Can you post your config, specifically the sections starting with [cron.? I think issue may be with one of the values being incorrectly formatted (see Config Cheat Sheet for v1.18).

You are using inconsistent custom assets files. Please remove your local custom assets (eg: locale), re-sync them from matched release.

It’s a very simple config, no [cron.? section.
Here it is:

APP_NAME = Gitea: Git with a cup of tea
RUN_USER = git
RUN_MODE = prod

[database]
DB_TYPE  = mysql
HOST     = 127.0.0.1:3306
NAME     = gitea
PASSWD   = my_password
#PATH     = /var/db/gitea/gitea.db
SSL_MODE = disable
USER     = gitea

[indexer]
ISSUE_INDEXER_PATH = /var/db/gitea/indexers/issues.bleve

[log]
ROOT_PATH = /var/log/gitea
MODE      = file,console
LEVEL     = Info

[mailer]
ENABLED = false

[oauth2]
JWT_SECRET = ###############################

[picture]
AVATAR_UPLOAD_PATH      = /var/db/gitea/data/avatars
DISABLE_GRAVATAR        = false
ENABLE_FEDERATED_AVATAR = false

[repository]
#ROOT = /var/db/gitea/gitea-repositories
ROOT = /home/git/repos
# Gitea's default is 'bash', so if you have bash installed, you can comment
# this out.
#SCRIPT_TYPE = sh

[repository.upload]
TEMP_PATH = /var/db/gitea/data/tmp/uploads

[security]
INSTALL_LOCK = true
INTERNAL_TOKEN = ##########################################
SECRET_KEY   = ChangeMeBeforeRunning

[session]
PROVIDER = file
PROVIDER_CONFIG = /var/db/gitea/data/sessions

[server]
DOMAIN       = localhost
HTTP_ADDR    = 127.0.0.1
HTTP_PORT    = 3000
ROOT_URL     = http://localhost:3000/
DISABLE_SSH  = false
SSH_DOMAIN   = %(DOMAIN)s
SSH_PORT     = 22
OFFLINE_MODE = false
APP_DATA_PATH = /var/db/gitea/data

[service]
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL     = false
DISABLE_REGISTRATION   = false
ENABLE_CAPTCHA         = true
REQUIRE_SIGNIN_VIEW    = false

It’s not related to your config. But related to you locale files.

This error message (Error:translation is missing for task) is only shown when a locale key couldn’t be found in your custom locale files – unless there is a bug in Gitea binary which doesn’t pack the correct locale files.

1 Like

Where are these locale files?

I tried to uninstall and reinstall gitea completely, but I stil get the same error message…

If you are not using custom locale files (manually put some some files in your custom directory), then maybe it’s a code/build/packaging bug of the FreeBSD release?

The full story is: when Gitea starts , it registers some internal tasks, these tasks need locale translation, so Gitea tries to translate the task names by its builtin/custom locale files. If Gitea can not find the related translation string, it reports fatal error, because in such case the locale system doesn’t work.

The 1.19 locale file is : gitea/locale_en-US.ini at release/v1.19 · go-gitea/gitea · GitHub

You can check Gitea’s builtin assets by ./gitea embedded {list|view} command, to see whether your binary has the builtin assets.

1 Like

It seems that the assets were not embedded in the binary.
In the gitea FreeBSD port, there is an option “Build a single monolithic binary, with all assets included” which was disabled by default. Enabling it solved my problem.

Thanks to both of you!

2 Likes

It looks like “disabled by default” causes a lot of problems. Could you suggest the maintainers to enable it by default?

1 Like