-
Notifications
You must be signed in to change notification settings - Fork 34
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
Slack Socket Mode fails replying to messages with "django.core.exceptions.SynchronousOnlyOperation: You cannot call this from an async context" #348
Comments
I will look at this next week. |
Thank you @gioccher, I was able to find and resolve the issue. I will be putting a PR in, followed by a patch release. |
Thank you @smk4664 ! I can confirm it solves the issue I reported - but I stumbled on something else that might be related: chatops in slack mode is not recovering from a closed database connection. The rest of nautobot was working fine, but chatops would log the following and not respond to the command:
I've done some light reading about this, and it might be enough to replace |
@gioccher What is the CONN_MAX_AGE set to? I did some light reading of the Channels documentation, and using that might require installing Channels, which will likely not be compatible with Nautobot. I originally looked into Channels, but decided against it for the reason of being required to use their ASGI and their |
Also, could we try CONN_HEALTH_CHECKS=True in the Database properties? https://stackoverflow.com/a/77009905 I wonder if that would help. |
I'm not setting CONN_MAX_AGE explicitly, I'm using the helm chart and it isn't one of the I'll try to see how to add CONN_HEALTH_CHECKS to my deployment. Still wondering why it wouldn't be required for nautobot, but would be required for chatops. |
I believe the issue is with the Slack Socket mode trying to maintain a persistent connection with the database. I will use your settings to try to replicate the issue on my end. |
Thanks, and I've added |
Environment
Expected Behavior
chatops replies with the available commands
Observed Behavior
the following appears in the logs
django.core.exceptions.SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async.
Steps to Reproduce
nautobot-server start_slack_socket
/nautobot
in slackThe text was updated successfully, but these errors were encountered: