Skip to content

gitgraph.js could not be served by webserver #11839

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

Closed
2 of 7 tasks
MonkeySon opened this issue Jun 10, 2020 · 12 comments
Closed
2 of 7 tasks

gitgraph.js could not be served by webserver #11839

MonkeySon opened this issue Jun 10, 2020 · 12 comments
Labels
Milestone

Comments

@MonkeySon
Copy link

  • Gitea version (or commit ref): 1.11.6
  • Git version: 2.20.1
  • Operating system: Ubuntu 19.10 Server
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I am hosting a gitea instance with apache2 on a sub-path using a reverse proxy.

Since version 1.11.5 the commit graph cannot be displayed because the file gitgraph.js was not found.
Comparing with try.gitea.io, the file should be served on /js/girgraph.js.
It is found when manually requesting it on my domain, but navigating to the commit graph page requests it from /gitgraph.js (missing the js subfolder).

Since it was working before 1.11.5 and other files in sub-paths are correctly requested (i.e. /img/favicon.png), I don't think it is the fault of my reverse proxy settings.

Any ideas on that?

@silverwind
Copy link
Member

May be related to c0c3a53 which fixed the handling of the STATIC_URL_PREFIX option for webpack assets. Do you have that variable set?

@SlavekB
Copy link

SlavekB commented Jun 16, 2020

I observe the same problem on our instance and STATIC_URL_PREFIX we have empty – i.e. according to the url of the application. See: https://mirror.git.trinitydesktop.org/gitea/TDE/kchmviewer/graph
... while our second instance, where the update has not yet been performed, works correctly. See: https://scm.trinitydesktop.org/gitea/TDE/kchmviewer/graph

@silverwind
Copy link
Member

Ah, I see the issue. 1.11 still uses chunkFilename: '[name].js' while on 1.12 we have chunkFilename: 'js/[name].js'. Backport was done assuming the second case.

silverwind added a commit to silverwind/gitea that referenced this issue Jun 16, 2020
@silverwind
Copy link
Member

STATIC_URL_PREFIX we have empty

It shows up as /gitea in your index.html thought. Is it really empy/unset in the configuration?

@lafriks lafriks added this to the 1.11.7 milestone Jun 16, 2020
@SlavekB
Copy link

SlavekB commented Jun 16, 2020

STATIC_URL_PREFIX we have empty

It shows up as /gitea in your index.html thought. Is it really empy/unset in the configuration?

Yes, we have the prefix specified as part of the application url:

ROOT_URL                   = https://%(DOMAIN)s/gitea/

@MonkeySon
Copy link
Author

MonkeySon commented Jun 16, 2020

I don't have STATIC_URL_PREFIX set either.

This is my gitea-side server configuration:

[server]
DOMAIN           = example.domain.com
SSH_DOMAIN       = %(DOMAIN)s
HTTP_PORT        = 3000
ROOT_URL         = https://example.domain.com/git/
DISABLE_SSH      = false
SSH_PORT         = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /var/lib/gitea/data/lfs
LFS_JWT_SECRET   = ***
OFFLINE_MODE     = false

In the apache config, I am redirecting my /git to localhost:3000

Log files don't show any errors, just database queries.

EDIT:

Journalctl prints the following:

Jun 16 16:44:26 * gitea[8292]: [Macaron] [Static] Serving /img/favicon.png
Jun 16 16:44:26 * gitea[8292]: [Macaron] 2020-06-16 16:44:26: Completed GET /img/favicon.png 304 Not Modified in 202.854µs
Jun 16 16:44:26 * gitea[8292]: [Macaron] 2020-06-16 16:44:26: Started GET /gitgraph.js for ***.***.***.***
Jun 16 16:44:26 * gitea[8292]: [Macaron] 2020-06-16 16:44:26: Completed GET /gitgraph.js 404 Not Found in 11.062873ms

@silverwind
Copy link
Member

It's fine. Internally, STATIC_URL_PREFIX is assigned a default even when unset which just means we can probably simplify the logic in JS later on the assumption that it will always be set.

Bug will be fixed in 1.11.7.

@MonkeySon
Copy link
Author

@silverwind

Thanks for the update, I just did the upgrade!

Sorry to bother you again, but the request still fails:

Jun 18 19:25:03 * gitea[678]: [Macaron] [Static] Serving /img/favicon.png
Jun 18 19:25:03 * gitea[678]: [Macaron] 2020-06-18 19:25:03: Completed GET /img/favicon.png 304 Not Modified in 207.801µs
Jun 18 19:25:03 * gitea[678]: [Macaron] 2020-06-18 19:25:03: Started GET /jsgitgraph.js for ***.***.***.***
Jun 18 19:25:03 * gitea[678]: [Macaron] 2020-06-18 19:25:03: Completed GET /jsgitgraph.js 404 Not Found in 9.521019ms

Looking at /jsgitgraph.js 404 Not Found, it seems that the js folder is no prepended, but is is missing a slash.

I haven't change anything besides replacing the executable and doing a reboot.

@techknowlogick
Copy link
Member

Now that 1.12.0 is out, are you able to verify the behaviour with that version?

@MonkeySon
Copy link
Author

There are no binaries for the 1.12.0 release yet, but I tried 1.12.0-rc2 instead and the gitgraph is working there again.

@MonkeySon
Copy link
Author

Ok binaries for 1.12.0 just arrived, gitgraph is also working for me with the new release :)

Thanks a lot!

silverwind added a commit to silverwind/gitea that referenced this issue Jun 18, 2020
Trailing slash is actually significant, fixed that and i've now tested
it as well.

Ref: go-gitea#11839 (comment)
@silverwind
Copy link
Member

I'm sorry, I did not actually test that fix. Correction in #11961. Thought, upgrading to 1.12 is of course a even better solution.

zeripath pushed a commit that referenced this issue Jun 18, 2020
Trailing slash is actually significant, fixed that and i've now tested
it as well.

Ref: #11839 (comment)
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants