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

Workflow-Server fails to start due to incorrect Cron expression in Cron activity #4907

Closed
platschlena opened this issue Feb 8, 2024 · 5 comments
Labels
bug Something isn't working elsa 3 This issue is specific to Elsa 3 enhancement New feature or request
Milestone

Comments

@platschlena
Copy link
Contributor

The workflow server fails to start due to an incorrect cron expression in the cron activity.
Through user input, the system should not be hindered from starting up.
What would be the best course of action in this situation?
We could take the initiative to implement a fix ourselves.

Copy link

glime-ai bot commented Feb 8, 2024

To address the issue of the workflow server failing to start due to an incorrect cron expression in the cron activity, the best course of action would be to:

  1. Validate the cron expression before it is saved into the workflow definition. This can prevent the server from failing to start due to an invalid cron expression. You can use a library or a service that validates cron expressions to ensure they are correct before saving them.

  2. Implement error handling around the cron activity startup process. This way, if there is an invalid cron expression, the error can be caught, logged, and the server can continue to start up without executing the problematic workflow. The workflow containing the invalid cron expression should be marked as having an error, and an alert should be sent to the administrator or the user who created the workflow.

  3. Provide a user interface for administrators to correct cron expressions without having to directly manipulate the database or the workflow definitions in code. This could be part of the workflow design interface where cron expressions are entered and validated.

  4. Ensure that the documentation for the cron activity is clear and provides examples of valid cron expressions, as well as common pitfalls to avoid. This can help users to create correct cron expressions from the start.

  5. If the issue is a known bug in the Elsa workflow system, check the official repository for updates or patches that address the issue. If a fix is available, apply the update to your system. If no fix is available, consider contributing a fix to the project if you have the capability.

  6. As a temporary workaround, you could manually edit the workflow definition to remove or correct the invalid cron expression, allowing the server to start. However, this should be done with caution and ideally with a backup of the workflow definition.

Remember to test any changes in a development or staging environment before applying them to production to ensure that the workflow server starts correctly and that workflows execute as expected.

@sfmskywalker sfmskywalker added bug Something isn't working elsa 3 This issue is specific to Elsa 3 enhancement New feature or request labels Feb 8, 2024
@sfmskywalker sfmskywalker added this to the Elsa 3.1 milestone Feb 8, 2024
@sfmskywalker
Copy link
Member

Agreed 💯

We still have to implement user input validation on the UI holistically, but even without that, bad user input should indeed not prevent the server from starting.

One possible solution to this is to simply catch the exception currently preventing the server from starting successfully and logging a warning.

If you want to propose a PR then that'd be great. Thank you!

@platschlena
Copy link
Contributor Author

Agreed 💯

We still have to implement user input validation on the UI holistically, but even without that, bad user input should indeed not prevent the server from starting.

One possible solution to this is to simply catch the exception currently preventing the server from starting successfully and logging a warning.

If you want to propose a PR then that'd be great. Thank you!

I created a PR with a exception handling:

#4917

@sfmskywalker
Copy link
Member

sfmskywalker commented Feb 9, 2024

With your PR merged, I will go ahead and close this issue. Thank you for your contributions @platschlena !

@platschlena
Copy link
Contributor Author

platschlena commented Feb 9, 2024

With your PR merged, I will go ahead and close this issue. Thank you for your contributions @platschlena !

Thank you too @sfmskywalker :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working elsa 3 This issue is specific to Elsa 3 enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants