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

StartRun handler throws an exception when either the job or attempt doesn't exist #1390

Closed
sentry-io bot opened this issue Nov 15, 2023 · 0 comments · Fixed by #1398
Closed

StartRun handler throws an exception when either the job or attempt doesn't exist #1390

sentry-io bot opened this issue Nov 15, 2023 · 0 comments · Fixed by #1398
Assignees
Labels
bug Newly identified bug

Comments

@sentry-io
Copy link

sentry-io bot commented Nov 15, 2023

This has only occurred once, but I think so effort should be put into making the query in StartRun.validate_job_reachable/1 more robust.

I suggest testing with different scenarios where the attempt and/or the job might not exist - or that the workflow for a given job is not associated with this attempt.

But Repo.one() may return nil for whatever reasons, so we should return an appropriately invalid changeset.

Sentry Issue: LIGHTNING-7J

Protocol.UndefinedError: protocol Enumerable not implemented for nil of type Atom. This protocol is implemented for the following type(s): DBConnection.PrepareStream, DBConnection.Stream, Date.Range, Ecto.Adapters.SQL.Stream, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, Jason.OrderedObject, List, Map, MapSet, Phoenix.LiveView.LiveStream, Postgrex.Stream, Range, Scrivener.Page, Stream, Timex.Interval
  File "lib/enum.ex", line 1, in Enumerable.impl_for!/1
  File "lib/enum.ex", line 166, in Enumerable.reduce/3
  File "lib/enum.ex", line 4387, in Enum.reduce/3
  File "lib/lightning/attempts/handlers.ex", line 47, in Lightning.Attempts.Handlers.StartRun.call/1
  File "lib/lightning_web/channels/attempt_channel.ex", line 150, in LightningWeb.AttemptChannel.handle_in/3
...
(3 additional frame(s) were not displayed)

(Protocol.UndefinedError protocol Enumerable not implemented for nil of type Atom. This protocol is implemented for the following type(s): DBConnection.PrepareStream, DBConnection.Stream, Date.Range, Ecto.Adapters.SQL.Stream, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, Jason.OrderedObject, List, Map, MapSet, Phoenix.LiveView.LiveStream, Postgrex.Stream, Range, Scrivener.Page, Stream, Timex.Interval)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Newly identified bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant