Skip to content
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

Rendering of racksdb infraestructure PNG failing when using a ProxyPass on external URL #426

Closed
parapar opened this issue Dec 29, 2024 · 2 comments

Comments

@parapar
Copy link

parapar commented Dec 29, 2024

Hello!

We’re currently using the latest version of Slurm Web (4.0.0 from debian package). While attempting to configure an external URL (instead of the host IP) and using a ProxyPass, when accessing the resource view, we noticed that the PNG generated by the racksdb call (used to render the racks) is not displaying properly.

Upon inspecting the browser console, we observed that the request for the PNG results in a 401 Unauthorized error.

image

To troubleshoot, we copied the request as a cURL command and tested it from various locations, including the host itself.

curl 'https://slum.irlab.org/api/agents/irlab/racksdb/draw/infrastructure/irlab.png?coordinates' -X POST -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Content-Type: application/json' -H 'Origin: https://slurm.irlab.org' -H 'Authorization: Basic XXXXXX_REDACTED_XXXXXXXX' -H 'Connection: keep-alive' -H 'Referer: https://slurm.irlab.org/irlab/resources' -H 'Cookie: _ga=GA1.2.XXXXXXXXX; _ga_MW011N3HEL=GS1XXXXXXXX' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Priority: u=0' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' --data-raw '{"general":{"pixel_perfect":true},"dimensions":{"width":1568,"height":384},"infrastructure":{"equipment_labels":false,"ghost_unselected":true}}'

and

curl 'http://localhost:5011/api/agents/irlab/racksdb/draw/infrastructure/irlab.png?coordinates' -X POST -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Content-Type: application/json' -H 'Origin: https://slurm.irlab.org' -H 'Authorization: Basic XXXXXX_REDACTED_XXXXXXXX' -H 'Connection: keep-alive' -H 'Referer: https://slurm.irlab.org/irlab/resources' -H 'Cookie: _ga=GA1.2.XXXXXXXXX; _ga_MW011N3HEL=GS1XXXXXXXX' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Priority: u=0' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' --data-raw '{"general":{"pixel_perfect":true},"dimensions":{"width":1568,"height":384},"infrastructure":{"equipment_labels":false,"ghost_unselected":true}}'

the response is as in the browser:

{"code":401,"description":"No valid token provided","name":"Unauthorized"}

@parapar
Copy link
Author

parapar commented Dec 30, 2024

Apologies for the inconvenience! I managed to get it working. The issue seems to be related to local name resolution. When testing from outside the network, everything works as expected.

It appears that some of the calls are not using the internal connection but are instead routed to the external URL, which is causing the problem.

@parapar parapar closed this as completed Dec 30, 2024
@rezib
Copy link
Contributor

rezib commented Jan 2, 2025

Hello @parapar, no worry! This can possibly help other user that may encounter the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants