As you can see on the screenshot above, there’s no log I can inspect. The red box with “Error Script returned exit code 1” is all I get (unlike other errors I have seen, it’s not clickable to expand more details).
This workflow does run sometimes with different trigger combinations. For example, I can confirm it has run successfully with email trigger, and with HTTP request trigger. But each time it runs successfully, and I change the trigger to what I really want (which is running it at a specific time every day), it starts to fail.
I also tried to keep the HTTP request trigger, and make that HTTP request from another workflow at my desired time of day, but it fails that way as well.
All I want is to somehow get the actual error message so that I can further debug the issue.
In my experience with Python steps, KeyErrors are the number one more common error that leads to this problem.
In production your data triggering a workflow will most likely be different than when testing. Sometimes data is missing or is in a different location than you’d expect.
I could add print statements in my steps to confirm the data looks as it should, that way you have more information to debug with.
Thanks again, Pierce I didn’t know about magic comments, and maybe that’s what I should do… after solving this issue. Which I still think could be something else because it does run sometimes, even in production.
Right now, I just commented out all the python code and added a bunch of random characters to deliberately cause an error.
The workflow failed, as expected. But I am still not getting the log where I can inspect the issue in details. I wonder if that’s by design?
Let’s go with more screenshots…
Here’s a python step that is supposed to result in an error, and that’s what it does in workflow editor - we’re told that name 'asdasd' is not defined:
As you can see on the screenshot, this step doesn’t have a section where I would see the log. If there were, I should be able to see the first print statement printed, and then the error message complaining about ‘asdasd’ not being defined.
So I guess I should rephrase my original question into this:
"How to view the log for failed python steps?"
I can confirm there is the log section when the step succeeds:
Glad to hear the magic comments helped with the package installation.
Thanks for providing such a detailed bug report - Python, Go & Bash support are still in their early stages compared to Node.js, but we’re working to bring the same great logging, Component API and helper functionality.