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

Not possible to edit custom webhook (HTTP 500 error) #49

Open
kryptonit1 opened this issue Feb 25, 2025 · 2 comments
Open

Not possible to edit custom webhook (HTTP 500 error) #49

kryptonit1 opened this issue Feb 25, 2025 · 2 comments

Comments

@kryptonit1
Copy link

When you try to edit a custom webhook it does not work (HTTP 500 error):
Image

JAWA version:
v3.1.0

@ball42
Copy link
Collaborator

ball42 commented Feb 28, 2025

@kryptonit1 unfortunately this error won't appear in the jawa.log - do you mind running journalctl -u jawa.service -f on the server and while that's running try editing the custom webhook to capture the error?

I think I recreated it, but want to confirm we are looking at the same issue. The error I saw is UnboundLocalError: local variable 'extra_notice' referenced before assignment

@kryptonit1
Copy link
Author

@kryptonit1 unfortunately this error won't appear in the jawa.log - do you mind running journalctl -u jawa.service -f on the server and while that's running try editing the custom webhook to capture the error?

I think I recreated it, but want to confirm we are looking at the same issue. The error I saw is UnboundLocalError: local variable 'extra_notice' referenced before assignment

No error was captured when running the journalctl command, but I found this in the syslog on the server:

<30>1 2025-03-03T10:09:31.189341+01:00 server1 python3 687 - -  INFO:jawa.views.custom_webhook:Checking for custom webhook 'testwebhook'
<30>1 2025-03-03T10:09:31.190430+01:00 server1 python3 687 - -  INFO:jawa.views.custom_webhook:Name exists? [True]
<30>1 2025-03-03T10:09:31.192872+01:00 server1 python3 687 - -  INFO:jawa.views.custom_webhook:test123 is editing a custom webhook (testwebhook)...
<30>1 2025-03-03T10:09:31.194376+01:00 server1 python3 687 - -  ERROR:app:Exception on /webhooks/custom/edit [POST]
<30>1 2025-03-03T10:09:31.194471+01:00 server1 python3 687 - -  Traceback (most recent call last):
<30>1 2025-03-03T10:09:31.194552+01:00 server1 python3 687 - -    File "/usr/local/jawa/venv/lib/python3.10/site-packages/flask/app.py", line 1473, in wsgi_app
<30>1 2025-03-03T10:09:31.194630+01:00 server1 python3 687 - -      response = self.full_dispatch_request()
<30>1 2025-03-03T10:09:31.194681+01:00 server1 python3 687 - -    File "/usr/local/jawa/venv/lib/python3.10/site-packages/flask/app.py", line 882, in full_dispatch_request
<30>1 2025-03-03T10:09:31.194728+01:00 server1 python3 687 - -      rv = self.handle_user_exception(e)
<30>1 2025-03-03T10:09:31.194772+01:00 server1 python3 687 - -    File "/usr/local/jawa/venv/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
<30>1 2025-03-03T10:09:31.194824+01:00 server1 python3 687 - -      rv = self.dispatch_request()
<30>1 2025-03-03T10:09:31.194867+01:00 server1 python3 687 - -    File "/usr/local/jawa/venv/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
<30>1 2025-03-03T10:09:31.194910+01:00 server1 python3 687 - -      return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
<30>1 2025-03-03T10:09:31.194953+01:00 server1 python3 687 - -    File "/usr/local/jawa/bin/view_modifiers.py", line 14, in view_method
<30>1 2025-03-03T10:09:31.195001+01:00 server1 python3 687 - -      response_val = f(*args, **kwargs)
<30>1 2025-03-03T10:09:31.195059+01:00 server1 python3 687 - -    File "/usr/local/jawa/views/custom_webhook.py", line 153, in edit_webhook
<30>1 2025-03-03T10:09:31.195104+01:00 server1 python3 687 - -      "description": each_webhook.get('description'), "extra_notice": extra_notice,
<30>1 2025-03-03T10:09:31.195147+01:00 server1 python3 687 - -  UnboundLocalError: local variable 'extra_notice' referenced before assignment
<30>1 2025-03-03T10:09:31.211419+01:00 server1 python3 687 - -  INFO:jawa.app:[https://jamf.site.com:8443] test123 wandered off course  (/favicon.ico) - redirecting to /dashboard.
<30>1 2025-03-03T10:09:31.216614+01:00 server1 python3 687 - -  INFO:jawa.views.home_view:[ttps://jamf.site.com:8443] test123 rendering /dashboard.

So it seems like you're on to something 👍 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants