laravel / horizon

Dashboard and code-driven configuration for Laravel queues.
https://laravel.com/docs/horizon
MIT License
3.84k stars 645 forks source link

Monitored tags not displaying recent or failed jobs #1478

Closed therobfonz closed 1 week ago

therobfonz commented 1 month ago

Horizon Version

5.25.0

Laravel Version

10.48.14

PHP Version

8.3.8

Redis Driver

PhpRedis

Redis Version

6.2.6

Database Driver & Version

Postgis 14 for Ubuntu 22.04

Description

We have several jobs that have tags defined in them for horizon to use

public function tags(): array
    {
        return ['customer-teams-migration'];
    }

When visiting horizon/monitoring, and adding a tag to monitor, I can see the tag and the count just fine.

Screenshot 2024-07-22 at 4 09 44 PM

However, when clicking into that monitored tag to see the most recent or failed jobs, the loading indicator just keeps spinning and the following error is thrown

Too few arguments to function Laravel\\Horizon\\Http\\Controllers\\MonitoringController::paginate(), 1 passed in 

Steps To Reproduce

  1. Add a tag definition to any job
  2. Go into Horizon and add that tag to be monitored
  3. Drop a job with that tag into the queue and let it finish
  4. Go to horizon/monitoring and click on the monitored tag name to view the details. The loading indicator will just spin and throw the network error mentioned above
github-actions[bot] commented 1 month ago

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

driesvints commented 1 month ago

Thank you. Would appreciate a PR for this one.

antoniovalenzuela commented 1 month ago

Hi, Updated to v5.27.1 but I can see the jobs from monitored Tags.

Message "There aren't any jobs for this tag"

Completed image

Monitoring image image

driesvints commented 3 weeks ago

cc @therobfonz ^

therobfonz commented 3 weeks ago

I think I forgot to recompile the JS for distribution with the fix (newb contributor here).

I'll try and carve out some time to investigate this week.

driesvints commented 3 weeks ago

@therobfonz assets are compiled whenever something's merged to the default branch so that can't be it. Maybe you didn't recompile locally while testing?

therobfonz commented 3 weeks ago

@driesvints i thought I did and had it working but possible I missed something when I moved over to the repo.

therobfonz commented 3 weeks ago

@driesvints I checked this morning, and it doesn't look like /dist/app.js updated with the merge of my PR. I confirmed this by running npm run build with the latest horizon installed in my project and the tag monitoring page worked.

When I look at the Action that commits the recompiled assets after the merge of my PR it says 'Nothing to commit', which is most likely the issue.

After compiling the JS locally

Screenshot 2024-08-20 at 9 05 08 AM
driesvints commented 3 weeks ago

Bit stumped here. I can't figure out why assets aren't compiling the same on the action as they do locally. Here's a new run I tried with Node 21 like I have locally: https://github.com/laravel/horizon/actions/runs/10473422636/job/29005245820

Still shows no changes to commit. Really need to figure this one out because it's not good if changes like these aren't being compiled anymore...

daniser commented 1 week ago

@driesvints I think I found the reason behind this (see PR #1495).

daniser commented 1 week ago

That's weird, but still nothing😕. Maybe assets are already up-to-date?

Run stefanzweifel/git-auto-commit-action@v5
Started: bash /home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v5/entrypoint.sh
INPUT_REPOSITORY value: .
INPUT_STATUS_OPTIONS: 
INPUT_FILE_PATTERN: dist/
Working tree clean. Nothing to commit.
driesvints commented 1 week ago

Yeah I think so. I've just done a new release so let's see if things work now.