Chaffelson / nipyapi

A convenient Python wrapper for Apache NiFi
Other
245 stars 76 forks source link

Not able to connect to canvas of custom port #233

Closed omkaringale closed 3 years ago

omkaringale commented 3 years ago

Description

Not able to establish connection with the canvas upon changing the port

What I Did

Changed the port from 8080 to 9090 then tried to connect to canvas and get root id config.nifi_config.host = 'http://localhost:9090/nifi/' root_id = canvas.get_root_pg_id()

Get the following error: ApiException: (404) Reason: Not Found HTTP response headers: HTTPHeaderDict({'X-Frame-Options': 'SAMEORIGIN', 'Content-Security-Policy': "frame-ancestors 'self'", 'X-XSS-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'Cache-Control': 'must-revalidate,no-cache,no-store', 'Content-Type': 'application/json', 'Content-Length': '110', 'Server': 'Jetty(9.4.26.v20200117)'}) HTTP response body: { "servlet":"default", "message":"Not Found", "url":"/nifi//flow/process-groups/root/status", "status":"404" }

Urgency

Trying to automate a process flow. Was working with the default 8080 port. P.S - sorry to bother you so often but I am new to NiFi and nipyapi and the concept of apis

Chaffelson commented 3 years ago

This really depends on how you are running NiFi. If you have it in Docker then you'd need to change the ports open on the environment for example. For NiPy, you should use nipyapi.utils.set_endpoint('http://localhost:9090/nifi-api') to ensure it correctly disconnects from the previous session and starts a new one.

omkaringale commented 3 years ago

Thanks man!!! Its working just fine now :)