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

ValueError: time data '' does not match format '%Y-%m-%dT%H:%M:%SZ' #362

Open
petlack opened this issue Sep 14, 2020 · 9 comments
Open

ValueError: time data '' does not match format '%Y-%m-%dT%H:%M:%SZ' #362

petlack opened this issue Sep 14, 2020 · 9 comments

Comments

@petlack
Copy link

petlack commented Sep 14, 2020

When running rq-dashboard in the latest docker container with

docker run -p 9181:9181 eoranged/rq-dashboard:v0.6.3

the Workers page cannot load list of workers.

Logs:

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/rq_dashboard/web.py", line 101, in _wrapped
    result_dict = f(*args, **kwargs)
  File "/rq_dashboard/web.py", line 535, in list_workers
    workers = sorted(
  File "/rq_dashboard/web.py", line 541, in <genexpr>
    current_job=serialize_current_job(worker.get_current_job()),
  File "/usr/local/lib/python3.8/site-packages/rq/worker.py", line 363, in get_current_job
    return self.job_class.fetch(job_id, self.connection)
  File "/usr/local/lib/python3.8/site-packages/rq/job.py", line 303, in fetch
    job.refresh()
  File "/usr/local/lib/python3.8/site-packages/rq/job.py", line 515, in refresh
    self.restore(data)
  File "/usr/local/lib/python3.8/site-packages/rq/job.py", line 479, in restore
    self.ended_at = str_to_date(obj.get('ended_at'))
  File "/usr/local/lib/python3.8/site-packages/rq/utils.py", line 256, in str_to_date
    return utcparse(as_text(date_str))
  File "/usr/local/lib/python3.8/site-packages/rq/utils.py", line 172, in utcparse
    return datetime.datetime.strptime(string, '%Y-%m-%dT%H:%M:%SZ')
  File "/usr/local/lib/python3.8/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/local/lib/python3.8/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '' does not match format '%Y-%m-%dT%H:%M:%SZ'
@BartlomiejSkwira
Copy link

I'm experiencing the same issue using current latest docker image from eoranged/rq-dashboard:latest. I get this:
ValueError: time data '' does not match format '%Y-%m-%dT%H:%M:%SZ

I tried clearing all jobs from queues but it seems it didn't help.
 

@BartlomiejSkwira
Copy link

BartlomiejSkwira commented Oct 20, 2020

Visually in the dashboard this looks like this for me:

  1. Failed jobs
    image

  2. Click on the failed jobs - the "Loading" is displayed all the time, but failed jobs don't appear due to 500 Internal server error which you can see in the developer tools Network tab.
    image

(*Clicking "Empty queue" doesn't do anything.)

@jmandt
Copy link

jmandt commented Oct 23, 2020

@BartlomiejSkwira
We experience the exact same problem. Whenever a job is executed, every queue/list only shows "Loading..." and failed jobs are not shown at all.

@jmandt
Copy link

jmandt commented Oct 25, 2020

@BartlomiejSkwira We solved the problem by using eoranged/rq-dashboard:latest and manually installed the newest rq version in the container. This solves the problem and everything is working fine now. Our Dockerfile looks like this now:

FROM eoranged/rq-dashboard:latest

RUN pip install rq==1.5.2

@pypeaday
Copy link

Holy crud thank you for this... I've been pulling my hair out trying to get a python-rq workflow going (due to other python requirements it's far from trivial) but this error was driving me crazy... The custom dockerfile fix is easy so thanks!

@fakegermano
Copy link

Yeah, the current requirements.txt for the project fixes rq to 1.3, but there were changes on 1.5 that broke datetimes.

props to @jmandt for finding the fix

ill try and make a PR to update the rq version, should fix this for people that install the package as well as use the docker image

@anton-petrov
Copy link

  1. Create Dockerfile
FROM eoranged/rq-dashboard:latest
RUN pip install rq==1.8.1
  1. Run from terminal
    docker build -t rq-dashboard:latest .

  2. Enjoy :)

  3. If you need docker-compose.yml

  my_rq_dashboard:
    image: rq-dashboard:latest
    environment:
      - RQ_DASHBOARD_REDIS_URL=redis://my_redis:6379
      - RQ_DASHBOARD_USERNAME=rq
      - RQ_DASHBOARD_PASSWORD=rq
    ports:
      - "10000:9181"
    depends_on:
      - my_redis
    links:
      - my_redis 

@essamgouda97
Copy link

Can confirm, issue was fixed by updating rq !

@zak427zak
Copy link

If you still see this issue, try using the latest version of rq-dashboard (0.8, not 0.6) from cjlapao/rq-dashboard:latest

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

Successfully merging a pull request may close this issue.

8 participants