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

Failure on retrieving job metric details in the horizon dashboard #1326

Closed
goestijn opened this issue Sep 22, 2023 · 3 comments
Closed

Failure on retrieving job metric details in the horizon dashboard #1326

goestijn opened this issue Sep 22, 2023 · 3 comments

Comments

@goestijn
Copy link

Horizon Version

5.21.1

Laravel Version

9.52.15

PHP Version

8.0.26

Redis Driver

PhpRedis

Redis Version

5.3.7

Database Driver & Version

No response

Description

We are running horizon in a containerized environment on an azure app service. We are facing troubles when we try to retrieve the details of the job metrics. The call to the api request that is done on that page is returning static html instead of the appropiate json-data. The behavior does not occur on my local development environment.

I've done some research and I noticed encoded characters in the url: (../horizon/api/metrics/jobs/App%5CJobs%5CTest). I also found an article (https://learn.microsoft.com/en-us/answers/questions/1293667/azure-container-app-ingress-decoding-url) that explains azure is applying some pre-urldecoding before requests are actually reaching the app service. As a possible solution their advice is to apply double encoding. So in case in example replacing the %5C characters in the url by %255C. This approche also actually works on our environment.

Is it possible to commit a change to the library that applies double encoding to this endpoint or simply makes the endpoints more url friendly by replacing the backslashes in the url by dashes.

Steps To Reproduce

  • Deploying a laravel application with horizon installed on an azure app service.
  • Trying to retrieve the details of a job metric in the horizon dashboard.
@driesvints
Copy link
Member

Heya. Could you maybe send in a PR we can look at? That would give us a better picture at the issue and the solution.

@goestijn
Copy link
Author

goestijn commented Sep 25, 2023

#1327

Solution in the pr encodes the job metrics slugs to a base64 string before the call is done to the API.
By encoding the slugs presence of slashes or backslashes in the request-uri is prevented.

@driesvints
Copy link
Member

Seems we aren't going to change anything here right now, sorry.

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

No branches or pull requests

2 participants