gitgraph.js could not be served by webserver #5532

Closed
opened 2025-11-02 06:28:00 -06:00 by GiteaMirror · 12 comments
Owner

Originally created by @MonkeySon on GitHub (Jun 10, 2020).

  • 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?

Originally created by @MonkeySon on GitHub (Jun 10, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.11.6 - Git version: 2.20.1 - Operating system: Ubuntu 19.10 Server - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] 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?
GiteaMirror added the type/bug label 2025-11-02 06:28:00 -06:00
Author
Owner

@silverwind commented on GitHub (Jun 10, 2020):

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

@silverwind commented on GitHub (Jun 10, 2020): May be related to https://github.com/go-gitea/gitea/commit/c0c3a533a071d80a0509ea6dd4adf5c10f2ceb48 which fixed the handling of the `STATIC_URL_PREFIX` option for webpack assets. Do you have that variable set?
Author
Owner

@SlavekB commented on GitHub (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

@SlavekB commented on GitHub (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
Author
Owner

@silverwind commented on GitHub (Jun 16, 2020):

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 commented on GitHub (Jun 16, 2020): 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.
Author
Owner

@silverwind commented on GitHub (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?

@silverwind commented on GitHub (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?
Author
Owner

@SlavekB commented on GitHub (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/
@SlavekB commented on GitHub (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/ ```
Author
Owner

@MonkeySon commented on GitHub (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
@MonkeySon commented on GitHub (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 ```
Author
Owner

@silverwind commented on GitHub (Jun 16, 2020):

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.

@silverwind commented on GitHub (Jun 16, 2020): 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.
Author
Owner

@MonkeySon commented on GitHub (Jun 18, 2020):

@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.

@MonkeySon commented on GitHub (Jun 18, 2020): @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.
Author
Owner

@techknowlogick commented on GitHub (Jun 18, 2020):

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

@techknowlogick commented on GitHub (Jun 18, 2020): Now that 1.12.0 is out, are you able to verify the behaviour with that version?
Author
Owner

@MonkeySon commented on GitHub (Jun 18, 2020):

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 commented on GitHub (Jun 18, 2020): 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.
Author
Owner

@MonkeySon commented on GitHub (Jun 18, 2020):

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

Thanks a lot!

@MonkeySon commented on GitHub (Jun 18, 2020): Ok binaries for 1.12.0 just arrived, gitgraph is also working for me with the new release :) Thanks a lot!
Author
Owner

@silverwind commented on GitHub (Jun 18, 2020):

I'm sorry, I did not actually test that fix. Correction in https://github.com/go-gitea/gitea/pull/11961. Thought, upgrading to 1.12 is of course a even better solution.

@silverwind commented on GitHub (Jun 18, 2020): I'm sorry, I did not actually test that fix. Correction in https://github.com/go-gitea/gitea/pull/11961. Thought, upgrading to 1.12 is of course a even better solution.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5532