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

Dagster job ensure_job_triggered is failing due to invalid usage of > comparator #349

Closed
aclum opened this issue Nov 2, 2023 · 8 comments · Fixed by #363
Closed

Dagster job ensure_job_triggered is failing due to invalid usage of > comparator #349

aclum opened this issue Nov 2, 2023 · 8 comments · Fixed by #363
Assignees
Labels
bug Something isn't working unplanned-task not accounted for during sprint planning, but time sensitive

Comments

@aclum
Copy link
Contributor

aclum commented Nov 2, 2023

@sujaypatil96 reported that he submitted a changesheet but it hadn't been applied yet. When I check dagit i see that changesheets hasn't run since ~8 AM this morning and when looking at the activity tab it shows failures b/w 1-2pm for ensure_job_triggered

Please see if you can debug the ensure_job_triggered failures so we can get the changesheets applied. This is blocking workflows that will trigger once part_of is fixed (via the changesheet submission).
cc @Michal-Babins @shreddd

env:prod

@eecavanna
Copy link
Collaborator

On Dagit, I see the failing runs of the ensure_job_triggered job that is referenced in the issue description:

image

@eecavanna
Copy link
Collaborator

I clicked "View run" for Run ID 052af738 and saw the following stack trace:

image

Here's a copy/paste of it:

dagster._core.errors.DagsterExecutionStepExecutionError: Error occurred while executing op "maybe_post_jobs":
The above exception was caused by the following exception:
TypeError: '>' not supported between instances of 'datetime.datetime' and 'str'

Stack Trace:
  File "/usr/local/lib/python3.10/site-packages/dagster/_core/execution/plan/utils.py", line 54, in op_execution_error_boundary
    yield
,  File "/usr/local/lib/python3.10/site-packages/dagster/_utils/__init__.py", line 461, in iterate_with_context
    next_output = next(iterator)
,  File "/opt/dagster/lib/nmdc_runtime/site/ops.py", line 409, in maybe_post_jobs
    if ts > candidate_job_object_id_timestamp:

@eecavanna
Copy link
Collaborator

The other failing run (Run ID 71cda0c6) has an identical stack trace.

@eecavanna
Copy link
Collaborator

eecavanna commented Nov 3, 2023

Based upon that stack trace, I think the issue is:

  • On line 409 of nmdc_runtime/site/ops.py, we are trying to use > to compare a string and a datetime, which is not allowed

if ts > candidate_job_object_id_timestamp:

Given that the issue involves types, I suspect it stems from the recent update from Pydantic v1 to v2.

CC: @dwinston

@eecavanna eecavanna changed the title dagster ensure_job_triggered failures Dagster job ensure_job_triggered is failing due to invalid usage of > comparator Nov 3, 2023
@PeopleMakeCulture PeopleMakeCulture added the unplanned-task not accounted for during sprint planning, but time sensitive label Nov 3, 2023
@PeopleMakeCulture PeopleMakeCulture self-assigned this Nov 3, 2023
@ssarrafan
Copy link

Assuming this won't be completed today so will move to the next sprint to complete. @dwinston @eecavanna @PeopleMakeCulture

@PeopleMakeCulture
Copy link
Collaborator

Related to: #339

@PeopleMakeCulture PeopleMakeCulture moved this from Lineup to At bat in Polyneme mixset Nov 6, 2023
@dwinston
Copy link
Collaborator

dwinston commented Nov 6, 2023

First will try to reproduce locally.

I see, from the landing page for the dagster job-run in dagit, i.e., https://dagit.microbiomedata.org/runs/052af738-7a04-4fe1-a305-5692455a313b, one of the run tags is dagster/run_key:(('apply-changesheet-1.0.0', 'gfs06r32'),). This means that the changesheet is available at https://api.microbiomedata.org/metadata/stored_files/gfs06r32. Downloaded that locally.

@dwinston
Copy link
Collaborator

dwinston commented Nov 6, 2023

I am able to reproduce. Submitting the above changesheet via POST /metadata/changesheets:submit, that is successful, but the spawned dagster job fails, with

dagster._core.errors.DagsterExecutionStepExecutionError: Error occurred while executing op "maybe_post_jobs":
The above exception was caused by the following exception:
TypeError: '>' not supported between instances of 'datetime.datetime' and 'str'

Stack Trace:
  File "/usr/local/lib/python3.10/site-packages/dagster/_core/execution/plan/utils.py", line 54, in op_execution_error_boundary
    yield
,  File "/usr/local/lib/python3.10/site-packages/dagster/_utils/__init__.py", line 461, in iterate_with_context
    next_output = next(iterator)
,  File "/opt/dagster/lib/nmdc_runtime/site/ops.py", line 409, in maybe_post_jobs
    if ts > candidate_job_object_id_timestamp:

dwinston added a commit that referenced this issue Nov 6, 2023
ensures `model_dump` preserves python `datetime`s, which are handled by pymongo.

reverts mode='json' option to model_dump, to preserve datetimes.

fixes #349
dwinston added a commit that referenced this issue Nov 6, 2023
* fix: use @field_serializer for pydantic `Url`s

ensures `model_dump` preserves python `datetime`s, which are handled by pymongo.

reverts mode='json' option to model_dump, to preserve datetimes.

fixes #349

* fix: preserve exclude_unset

* style: remove `print` for debugging

* fix: remove stale comment
@github-project-automation github-project-automation bot moved this from At bat to Scored in Polyneme mixset Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unplanned-task not accounted for during sprint planning, but time sensitive
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants