Cannot Schedule jobs with different code-based servers using single database

I am using multi server (with different code-based) using single database.
The problem is when I schedule a job by server 1, then the server 2 enqueue the job, and i got the error “Can not change the state of a job to ‘Enqueued’: target method was not found” although I’ve set queue attribute for method and setting different queue name for 2 server.
So, is there any way for me to solve this problem without sharing the assembly?
Thanks.

Hi hungpham! How are you?
I Think this happen because you have different code-based servers, for example, Server 1 has Code1.dll and Server 2 has Code2.dll.
When your server 2 will attempt execute one job scheduled by server 1 with Code1.dll, server 2 can’t find the code for execute because he only know code from Code2.dll, because the code is in Code1.dll.
If you want run the same code on different servers, both servers need to know both dlls.

I hope that help you! And sorry about my terrible english :smiley:

[] Guilherme Waess

1 Like

I ran into this issue as well and ended up using separate databases (or prefixes) and dashboards for each server. It’s unfortunate because I would love to have a single dashboard for all my microservices rather than hosting a dozen of them in different locations.

I even had the idea to have one web application that hosts all of the dashboards, but not having the source DLLs causes problems for the dashboard. I was thinking I would submit a pull request to decouple the dashboard from source, but the Dashboard depends on Job all over the place, which is tightly coupled to reflecting over the source.

1 Like

Then maybe the only solution is using separate database for each server.
Thank you all.