Flame Forum
Welcome to Autodesk’s Flame Family (Flame, Flare, Flame Assist, Lustre) Forums. Share your knowledge, ask questions, and explore popular Flame topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Python rest API request connection refused

3 REPLIES 3
Reply
Message 1 of 4
mike.battcock6TFZ9
104 Views, 3 Replies

Python rest API request connection refused

I have a rest API currently running on localhost, port 3000.

 

I'm able to use a get request in python in any other application or environment and it works fine but for some reason when I try to run it inside flame (in a python hook or the python console) I get a connection error:

 

Failed to establish a new connection: [Errno 61] Connection refused 

 

I don't think there are any other flame services running on port 3000 so I'm not sure what the issue is. Is there a firewall in flame maybe?

Labels (4)
3 REPLIES 3
Message 2 of 4

Two random guesses:

 

1. Is this on Mac? If so it might be some MacOS firewall/security setting, but I'm not a Mac person so I can't give you anything specific.

 

2. Check if your thing listening on localhost:3000 is actually listening on 127.0.0.1 (ipv4), ::1 (ipv6) or both -- it's possible it might be bound to only one or the other, but you're losing the lottery when you try to connect to 'localhost' and it resolves to the other one.

 

There's nothing in Flame specifically that should prevent you from making the connection; I have a Python hook of my own that connects to another device on the LAN. So I suspect something else is going on.

Bob Maple | idolum
Message 3 of 4

I am not aware of any Flame or Flame adjacent activity on that port.  What OS and version?  What does

sudo lsof -Pni |  grep '3000.*LISTEN' report back?

Can you share the script, maybe there is an indiactor there.

Message 4 of 4

When encountering a "connection refused" error while making a REST API request in Python, it typically indicates that the server you're trying to connect to is either down, unreachable, or blocking the request. Common causes include: Incorrect URL or port number in the API request. The server isn't running or is improperly configured. Firewall or security settings on the server blocking external requests. Misconfigured DNS or networking issues. To troubleshoot, ensure the API endpoint is correct, the server is up, and check network configurations. You can also use tools like ping or curl for further diagnosis.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report