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

Enabling task history schedule #3006

Closed
tgallasso opened this issue Oct 8, 2020 · 9 comments · Fixed by #3153
Closed

Enabling task history schedule #3006

tgallasso opened this issue Oct 8, 2020 · 9 comments · Fixed by #3153

Comments

@tgallasso
Copy link

Hi, I'm new to Luigi.
Started working from the bottom with it about 2 months ago.
Now I have a few extracting and uploading tasks working just fine.

But now I'm feeling the need to check the history of the tasks and I can't seem to make it work.

Can someone help me with a step by step?
I can't find much info about that on the internet.

I tried doing what the docs says, using the parameters in the luigi.cfg.
But it looks like something is missing. Is there anything else I should do? Or its just it?

I keep getting the 500 error when accessing the /history and that's all.

@christophkwok
Copy link

@tgallasso what type of database are you using?

FYI, I've had similar problems with the luigi dashboard's task history when connecting to MS SQL Server and recently found a fix for this. There are several relevant issues created a while back (#2769, #2370, #1921) for those using SQL Server, but I don't believe they were fixed.

@tashrifbillah
Copy link
Contributor

Post your luigi.cfg and complete URL, may be we can help you, should you need anymore.

@patrick7kelly
Copy link

Just want to share that I'm currently having issues with MySQL + SQLAlchemy>=1.4.0. I get the following error when navigating to /history:

Traceback (most recent call last):
  File "/home/luigi/.local/lib/python3.7/site-packages/tornado/web.py", line 1702, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/home/luigi/.local/lib/python3.7/site-packages/luigi/server.py", line 249, in get
    self.render("recent.html", tasks=tasks)
  File "/home/luigi/.local/lib/python3.7/site-packages/tornado/web.py", line 863, in render
    html = self.render_string(template_name, **kwargs)
  File "/home/luigi/.local/lib/python3.7/site-packages/tornado/web.py", line 1012, in render_string
    return t.generate(**namespace)
  File "/home/luigi/.local/lib/python3.7/site-packages/tornado/template.py", line 362, in generate
    return execute()
  File "recent_html.generated.py", line 44, in _tt_execute
    _tt_tmp = task.events[0].ts  # recent.html:19 (via layout.html:100)
  File "/home/luigi/.local/lib/python3.7/site-packages/sqlalchemy/orm/attributes.py", line 449, in __get__
    return self.impl.get(state, dict_)
  File "/home/luigi/.local/lib/python3.7/site-packages/sqlalchemy/orm/attributes.py", line 893, in get
    value = self.callable_(state, passive)
  File "/home/luigi/.local/lib/python3.7/site-packages/sqlalchemy/orm/strategies.py", line 830, in _load_for_state
    % (orm_util.state_str(state), self.key)
sqlalchemy.orm.exc.DetachedInstanceError: Parent instance <TaskRecord at 0x7f83372b4d50> is not bound to a Session; lazy load operation of attribute 'events' cannot proceed (Background on this error at: http://sqlalche.me/e/14/bhk3)

SQLAlchemy==1.3.23 seems to be fine though.

If others are still having issues or getting 500's, can you share the traceback from your logs?

@ireneusz-ptak
Copy link

@patrick7kelly Thanks for sharing, just got the same error with SQLite.

@tashrifbillah
Copy link
Contributor

tashrifbillah commented Jul 19, 2021

Having the same issue, I am going to try @bsdz's PR.

Edit:
I tested the above PR and things work fine with it.

@ramseydsilva
Copy link

I'm having the same issue with SQLite (luigi version 3.0.3)

@tashrifbillah
Copy link
Contributor

@ramseydsilva , we already ratified the PR as its solution. We are not getting the time to rebase that PR for merge. But you are welcome to take on that task of rebasing.

@ramihurt
Copy link

I also used the solution by @bsdz and I was able to get the task history tab to work. Thank you!

@eokeeffe
Copy link

Tried @bsdz solution and was getting the same issue as @patrick7kelly
changed my sqlalchemy version from 1.4.x to
SQLAlchemy==1.3.23 and everything works correctly now

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