suite icon indicating copy to clipboard operation
suite copied to clipboard

Getting mobius to consume the queue?

Open uvesten opened this issue 7 years ago • 3 comments

Short question, grateful for any pointers in the right direction.

I've managed to get suite up and running using docker-compose (and some manual wrangling). Can create users, roles, the whole shebang. Seems to work as it should.

However, I can't get mobius to consume any tasks from the queue.

Steps:

  1. Get suite up and running, create a sudo user and create an API key.

  2. Create some shifts

  3. Configure mobius (self-hosted) with the API key, start server.sh. Polling commences.

  4. Call cron to enqueue tasks. Works.

     {
       "schedules_created": 0,
       "schedules_queued_mobius": 12
     }
    

... However, nothing gets picked up by mobius. It just keeps reporting

2017-04-21T08:08:22 mobius-dev mobius DEBUG No task found. Sleeping.
2017-04-21T08:08:27 mobius-dev mobius DEBUG No task found. Sleeping.

And in /euler i just see a lot of entries like the one below.

img 2017-04-21 at 08 10 58

Is there something I'm missing? (On the main instance I see a lot of celery processes, so I guess the queue should be up.) Something more I need to do to get mobius to pick up the tasks?

Best regards, / uvesten

uvesten avatar Apr 21 '17 06:04 uvesten

Hmm, did you see the Self-Hosting part of the Mobius README, which was added in the last couple weeks? https://github.com/staffjoy/mobius-assignment

The odd thing seems to be that it is hitting the endpoint. Is it possible that you wiped the database in development but didn't flush redis? I would try a DELETE call to /api/v2/internal/caches/ to flush Redis

https://github.com/Staffjoy/suite/blob/master/app/apiv2/internal/caches/caches.py#L16

philipithomas avatar Apr 21 '17 20:04 philipithomas

Thanks for the feedback! Yes, I read about self-hosting, and I got it set up, so it's definitely polling the endpoint. Flushing redis made no difference, I guess I might have to dig deeper.

By the way, should an API key that I made for a sudo user have access to all tasks in the system? Or do I need to set up some special "system-wide" api key for mobius to use?

uvesten avatar Apr 25 '17 12:04 uvesten

API keys get the permissions of the user. Sudo users have global access, so an API key from that account has system-wide access.

philipithomas avatar Apr 29 '17 00:04 philipithomas