-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
panic on self built gitea version v1.0.2 #1014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Building with TAGS="bindata" (to embed assets) might get you past this. |
Thanks, that worked. Sadly, the |
Are you saying 1.0.2 needs to be built with |
I don't have a So basically you are right, in a setup where this file is missing and v1.0.2 is not built with This line is the problem's source: In my opinion, a library never should call panic, but return an error. |
I opened an issue to address this: go-macaron/i18n#5 I didn't test if there are more components affected, when building without A quick fix (HEAD at v1.0.2):
Another (ugly) "fix" would be to use recover:
|
Following Unknown's response (go-macaron/i18n#5) this will not be fixed in the main repository. To avoid the ugly workarounds obove, I would suggest to create a fork of https://github.com/go-macaron/i18n, break the API and fix the problem in the library itself. What do you guys think? |
@tboerger any idea? |
Just set https://github.com/go-macaron/i18n/blob/master/i18n.go#L78 properly on our side. |
But, this would not prevent the application to panic on file system errors per se? For example: |
Of course not, but we can not swap everything directly. |
I get the same error for gitea build from the latest master with the $ ./gitea web
2017/04/17 16:19:47 [W] Custom config '/tmp/custom/conf/app.ini' not found, ignore this if you're running first time
2017/04/17 16:19:47 [T] Custom path: /tmp/custom
2017/04/17 16:19:47 [T] Log path: /tmp/log
2017/04/17 16:19:47 [I] Gitea v1.1.0+dev
2017/04/17 16:19:47 [I] Log Mode: Console(Trace)
2017/04/17 16:19:47 [I] XORM Log Mode: Console(Trace)
2017/04/17 16:19:47 [I] Cache Service Enabled
2017/04/17 16:19:47 [I] Session Service Enabled
2017/04/17 16:19:47 [I] Run Mode: Development
panic: fail to set message file(en-US): open conf/locale/locale_en-US.ini: no such file or directory |
@klingtnet If it was built with bindata it should say so in the version tag. How did you build it?
|
go get -d -u -v code.gitea.io/gitea && go get -u github.com/jteeuwen/go-bindata/...
pushd $GOPATH/src/code.gitea.io/gitea
PATH=$GOPATH/bin:$PATH TAGS="bindata" make generate build |
I am compiling with: $ go version
go version go1.8.1 linux/amd64 |
I was able to solve the issue in the meantime, the problem was on my side. |
can this be reproduced using latest stable? 1.2.1 |
Closing issue, if there is still a problem please reopen |
FYI, I ran into the same issue building this for NixOS. Work around for me was copying locale directory into the build output and then in the prestart systemd service script if it doesn't exist already, I copy the locale dir into conf. Related to NixOS/nixpkgs#30528 |
I have tried to install gitea on a freenas jail. I used these commands...
`root@gitea_1:/usr/ports/www/gitea/files # gitea web goroutine 1 [running]: |
Ditto. I'm running a fresh FreeNAS jail (FreeBSD 11.0-STABLE) and installed gitea from ports with
|
I'm on FreeBSD 11.1 and get the same issue:
I tried with Anyone have a more detailed set of workaround instructions? |
@GlenHertz I just tried to build the latest release version, this is how it worked:
|
I can confirm, it seems that there is a separate issue that is affecting FreeBSD users. @ston1th you're not on FreeBSD, are you? |
@mqudsi no, I'm on linux. So my proposed fix did not work for you? |
Nope. It actually is not related to FreeBSD, though (what an odd coincidence looking at the comments here, though). It turns out that gogs supports a translation that gitea does not. There is no such thing as gl-ES for gitea, but if you are importing from gogs, your app.ini will include that translation, causing the panic. |
Building on CenOS 7 I got the same message when I ran Now it finally running but not on the port that set in Why can't you just put one single example of where to put which files into the docs? "A painless self-hosted Git service"? What I am experiencing is the opposite of painless. |
@tnt please follow docs on how to build gitea: https://docs.gitea.io/en-us/install-from-source/ From docs page on how gitea should be built:
If you would have done so there would not be no need to do any symlinks etc as all required resources would be included in binary and everything would work out of box |
After some additional adjustments setting up the database was admittedly absolutely painless. |
@lafriks Your right. I had omitted the |
To @GlenHertz and all the other FreeBSD users, I had the same problem when starting gitea with |
Please!!! Add this answer to Troubleshooting section of migration from gogs to gitea topic (https://docs.gitea.io/en-us/upgrade-from-gogs/). You need to change settings in app.ini and remove unsupported gogs translations or add translations manually. I've lost about 2 hours. |
We probably just need to detect the available translations and drop this stupid config or just use it to restrict what translations are available. Similarly we should allow people to override individual translation files with custom translations but back fill into the inbuilt translations and we should use the hierarchy of languages properly so that if you want to localise you only have to change the values that you need to. |
But what we certainly shouldn't do is panic because some one has made a tiny mistake in their config. We have so many log levels, surely that's just a Warn?! |
@zeripath I like your idea to detect if a translation is available and I think we have supported user customized locale files to put them on |
Ah but the custom locales files have to be complete so if you want to change just one translation you need the whole file. It should fallback to the standard one. I'm terms of hierarchy, in Java if wanted to provide Hispanic vs Mainland Spanish translations I would look at the codes, and decide that although canonical Spanish as defined by the real academia española is es_ES if I put the majority of my translation in to es with the Hispanic variants in es and the European variants in to es-ES then I can keep the es-ES file very small. We can then use the hierarchy to provide local variants such as en-GB_Company or domain, to change terms to local things. |
FWIW, this also affects the prebuilt binaries in OpenBSD 6.6. Per the suggestion in #535 I've tried copying the "options" folder around to a few different places, but all result in the same failure. (How does one tell what, exactly, the "installation folder" is when using a prebuilt binary from packages?) EDIT: from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238230 I tried setting GITEA_WORK_DIR and GITEA_CUSTOM and that let me start gitea as root. |
Same issue after an Arch update. |
Locking this ticket as it has since been closed, and refers to a long outdated version. Please open a new ticket for issues similar to this. |
Description
Hello Giteas,
I built the latest gitea version (v1.0.2) and got a panic from the locale library:
I think the library (go-macaron/i18n) should handle or return such an error instead of panicking.
Anyway, if I'm using the prebuilt binary (github release page) everything works fine, though.
Thanks,
ston1th
The text was updated successfully, but these errors were encountered: