Gitea: Gitea panics when no conf/locale directory

Created on 4 Mar 2020  路  6Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): 1.11.1 built with GNU Make 4.1, go1.13.8 : bindata, sqlite, sqlite_unlock_notify
  • Git version: 2.7.4
  • Operating system: ubuntu 16.04
  • Database (use [x]):

    • [x] MySQL

  • Can you reproduce the bug at https://try.gitea.io:

    • [ ] Yes (provide example URL)

    • [ ] No

    • [x] Not relevant

  • Log gist:

https://gist.github.com/dballard/e5058e469cda1a9994f38edc23040b5c

Description

For some reason my gitea installation (started as gogs, upgraded to gitea 1.3 then up to 1.9.3 and it was working fine. Upgraded to 1.11.1 today and the dates are broken:

ago%!(EXTRA string=1 minute %s)
Updated ago%!(EXTRA string=2 hours %!s(MISSING))

etc, which lead me to believe there was an i18n problem. I noticed I still had a conf/locale directory with old translations and suspected removing it might force and update or using the bindist ones. instead it causes a panic

...

Screenshots

gitea error

kinquestion

Most helpful comment

You probably have some old locale files leftover as well that are being picked up by Gitea. Or maybe you've got custom templates that need updating. Check /opt/gitea/custom; try moving anything that's inside to a different place and see if that helps.

This is the list of locales supported in that version:

https://github.com/go-gitea/gitea/tree/v1.11.1/options/locale

BTW, I'm running 1.11.1 myself 馃槃

image

All 6 comments

Most probably you were running a Gitea with all the resources embedded, but now you've compiled one without them and so they're missing.

If you're not having your own set of static files (I don't think you should), you need to add TAGS=bindata to the enviroment before compiling.

I'm using the binary downloaded from https://dl.gitea.io/gitea/
and from what I read, the version it says has "bindata" included which means, yeah, it should not need the conf/locale dir. hence my confusion

Sounds like a configuration issue. We're no longer including translations with less than 30% of coverage. I think you maybe have gl-ES listed in app.ini:

[i18n]
LANG = ...

Please remove it, or perhaps you may somehow download that file from Crowdin and put it inside custom/options/locale? I'm not sure of the procedure.

PS: We don't even have a Galician translation started!

https://crowdin.com/project/gitea
https://crowdin.com/project/gitea/gl-ES

So the conf file has been hand migrated since gogs days so that gl-ES translation may be a relic of that.

So I deleted just it

and it then failed with the same error for en-GB

panic: fail to set message file(en-GB): open conf/locale/locale_en-GB.ini: no such file or directory

here's me downloading a fresh binary and running it:

https://gist.github.com/dballard/6cdb8bc87a0c17b3bfdd85f5b31d94d4

So taking a cue from a freshly generated app.ini on a testing instance which had no [i18n] section at all, I deleted the entire section from the config and then it worked... sort of. it runs.

so a) you may have some legacy code handling that deprecated config option not doing exactly what you want it do any more

but b) The dates are still broken

https://git.openprivacy.ca/explore/repos

You can see, and sign up for an account to test if you need.

But good news, all the languages are still available for selection in user settings, so it does seem to be loading the bindist locales now at least.

German and English:

Aktualisiert vor%!(EXTRA string=%!s(BADINDEX) 4 Stunden)
Updated ago%!(EXTRA string=4 hours %!s(MISSING))

You probably have some old locale files leftover as well that are being picked up by Gitea. Or maybe you've got custom templates that need updating. Check /opt/gitea/custom; try moving anything that's inside to a different place and see if that helps.

This is the list of locales supported in that version:

https://github.com/go-gitea/gitea/tree/v1.11.1/options/locale

BTW, I'm running 1.11.1 myself 馃槃

image

Ah sorry I never meant to imply I thought this was a general 1.11.1 bug, but clearly something my long history of upgrades had semi uniquely created

And yes, I also deleted custom/conf/locale and it started working.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jorise7 picture jorise7  路  3Comments

BNolet picture BNolet  路  3Comments

jonasfranz picture jonasfranz  路  3Comments

lunny picture lunny  路  3Comments

BRMateus2 picture BRMateus2  路  3Comments