Fail to enable Smartsheet webhook (502 Bad Gateway) - python

Django: 4.0.6
Smartsheet Python SDK: 2.105.1
Ngrok: 3.0.6
I have a Django server running on localhost, forwarded my localhost through Ngrok, have setup a callback route for accepting/responding to the Smartsheet-Hook-Challenge, and created a webhook instance using Python SDK. However, when I try to enable my webhook by running the following (documented here):
Webhook = smartsheet_client.Webhooks.update_webhook(webhook_id,smartsheet_client.models.Webhook({'enabled': True}))
Ngrok immediately returns 502 bad gateway, and my webhook instance's disabledDetails attribute becomes Request returned HTTP status code 502 (ref id: wtegm9). And I have no clue what's the cause of this 502.
PS: While I'm writing this question, I was able to successfully enable my webhook using cURL command, so I can go ahead and start working. But enabling the same webhook instance with update_webhook python method still gives 502. Since updating webhook with cURL worked, could it be a bug in the Python SDK method itself?

I would suspect that an issue with Ngrok is causing the 502 error and not a problem with the Smartsheet SDK. A Google search for http 502 bad gateway ngrok returns lots of info about 502 errors with Ngrok, including this Stack Overflow post which contains multiple widely approved answers:
Ngrok errors '502 bad gateway'
I'd start there, if I were you.

Related

Istio - Gunicorn - Python getting 503 upstream connect error or disconnect/reset before headers. reset reason: connection failure

I am running a Istio setup where my python flask service running behind gunicorn.
when debugging the logs from the service, the flask service successfully execute the api call while the calling client is receiving 503 error from the rest call. I suspect this might be some issue with side car proxy or gunicorn server where it is processing the request.
Also, I am hitting the service directly from another pod in the namespace and hence not going through ingress gateway and virtualservice
In my case it was the SSL between Google Front End (ILB) and Istio service mesh. Somehow the connection between GFE and Istio gateway over TLS was not reliable. I converted that to HTTP from HTTP2(https) and it started working.
I will debug later why this https between those 2 was not working but moving HTTP2 to HTTP solved my issue.

Invalid HTTP method in Traceback: Uvicorn

I am using uvicorn 0.11.8 and fastapi 0.61.1. My application is hosted in VPS. When I run the app in local server, such error is not reproducible. It shows correct message 404 Not found for methods not available but I couldn't figure out what is causing this issue in VPS (error in Traceback).
I was getting the same arcane WARNING: Invalid HTTP request received. error with an unhelpful stack trace. I tried all of the environment variable tweaks recommended and none worked (see FastAPI issue #680, uvicorn issue #441).
My issue was that when I was calling my FastAPI microservice I was using https when my microservice did not have HTTPS support. I changed the url from https to http and it started working as expected.
Note that if your service requires HTTPS support you can add HTTPS support.
Also, see the similar post AWS ec2 + uvicorn + fastapi, i get uvicorn error.

Twilio 502 Error From Following Tutorial on AWS Server

I was following this tutorial on my AWS Ubuntu instance and when I attempted to text the number Twilio had given me ngrok reported a 502 Error. Is it possible that I need to open a port inside of the security details for the instance?

Cannot run app pool as service account

I had a Python Flask website that ran fine when I ran the app pool as my own account. When I tried changing this to a service account (which should have permissions), I get the following error
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has
occurred.
Most likely causes: •IIS received the request; however, an internal
error occurred during the processing of the request. The root cause of
this error depends on which module handles the request and what was
happening in the worker process when this error occurred. •IIS was not
able to access the web.config file for the Web site or application.
This can occur if the NTFS permissions are set incorrectly. •IIS was
not able to process configuration for the Web site or application.
•The authenticated user does not have permission to use this DLL. •The
request is mapped to a managed handler but the .NET Extensibility
Feature is not installed.
Detailed Error Information: Module FastCgiModule
Notification ExecuteRequestHandler
Handler Python Flask
Error Code 0x80070542
Requested URL http://qatools:80/
Physical Path D:\PythonWebService\QATools
Logon Method Anonymous
Logon User Anonymous
If I change it back to run as my own account, it works. Any thoughts?
FYI after some tinkering, I changed the app pool to run with Managed Pipeline mode of "Classic" instead of "Integrated" and it worked.

Accessing Jira 4.4.5 via JSON-RPC on localhost http port

I am trying to get access to a local JIRA 4.4.5 installation using it's JSON-RPC service. Therefore I wrote a python script utilizing jsonrpclib and trying to connect to http://localhost:8080/jira/rpc/json-rpc/jirasoapservice-v2​ as described on https://developer.atlassian.com/display/JIRADEV/JIRA+JSON-RPC+Overview. Trying to connect from my python script as well as opening this URL in a browser gives me a 404 error.
import jsonrpclib
server = jsonrpclib.Server("http://localhost:8080/jira/rpc/json-rpc/jirasoapservice-v2")
reply = server.someMethod( param1, ... )
Calling someMethod fails with the following error:
xmlrpclib.ProtocolError: <ProtocolError for localhost:8080/jira/rpc/json-rpc/jirasoapservice-v2: 404 Not Found>
Has anyone successfully tried this the same way I did? Do I need to get access via HTTPS somehow instead of HTTP? How would I configure jira to do so?
Btw: Jira's json-rpc plugin is enabled.

Categories

Resources