By: Emilio Pena user 01 Apr 2019 at noon CDT

13 Responses
Emilio Pena gravatar
**Actual behaviour: ** Getting an "[Errorno 111] Connection refused" when calling oxdpython's get_authorization_url method **Expected behaviour: ** get_authorization_url method should return the authorization url for the configured client **Code (taken from demosite.py example):** from oxdpython import client [...] this_dir = os.path.dirname(os.path.realpath(__file__)) config = os.path.join(this_dir, 'oxd-conf.cfg') oxc = client.Client(config) [...] @app.route('/authorize/') def authorize(): auth_url = oxc.get_authorization_url() return redirect(auth_url) [...] App fails when endpoint authorize is called **Config and Log files (contents):** - Client app running on debugger mode - Set up Gluu 3.1.4 and oxd-server on VM running Ubuntu 16.04. FQDN: gluu.qube.com. Added to /etc/hosts file in host machine - Client app runs on host machine (not in VM) **oxdpython client app:** -oxd-conf.cfg: [https://pastebin.com/jwdzVEMU](https://pastebin.com/jwdzVEMU) **Gluu 3.1.4 & oxd server:** **- oxd-conf.json:** [https://pastebin.com/PgD7A0iZ] (https://pastebin.com/PgD7A0iZ) **-ports in use (from netstat -lnpt). port 8099 not being listened to by server:** [https://pastebin.com/s0SPp9YL](https://pastebin.com/s0SPp9YL) **-oxd-server.log:** [https://pastebin.com/jxwu8euX](https://pastebin.com/jxwu8euX) **-oxd-default-site-config.json:** [https://pastebin.com/cLuCRhws](https://pastebin.com/cLuCRhws) **-oxd-server.yml:** [https://pastebin.com/Jt3Jm9M2](https://pastebin.com/Jt3Jm9M2)

By Mohit Mali staff 02 Apr 2019 at 7:19 a.m. CDT

Mohit Mali gravatar
Hi @Emilio Pena , Thank you for reaching you Gluu support , I will assist you on this ticket. This is likely the network connection , oxd server is not reachable by the client app. I need some more information from you to figured out the cause of this problem. Try to browse https://YOUROXDSERVERDOMAIN:8443/health-check on the client machine OR if you are on terminal try to use CURL request curl -k https://YOUROXDSERVERDOMAIN:8443/health-check if you not received response like "{"status":"running"}" then its likely is oxd server is not reachable to client that why you are getting connection refused.

By Emilio Pena user 02 Apr 2019 at 8:49 a.m. CDT

Emilio Pena gravatar
Hello @Mohit.Mali and thaks for the response. I just followed your instructions. I ran the curl command you provided and got a {"status": "running"} response from the oxd server. The VM I am using is a Virtual Box one and responds to ping. It is configured with a bridged connection. Please let me know anything you need to solve this. Thank you very much.

By Emilio Pena user 02 Apr 2019 at 12:26 p.m. CDT

Emilio Pena gravatar
I reviewed the config on the VM once more. Adding new details in the hope that they might be of some use. As stated earlier, no service is listening on port 8099. I just checked the service using service --status-all and oxd-server is listed as inactive. I don't know what can be causing this, config files seem to be correct. ** config files folder path (oxd-server, duplicated):** /etc/oxd/oxd-server/ /etc/opt/oxd/oxd-server/ ** executable file path (oxd-server):** /opt/oxd-server Hope it helps. Regards.

By Mohit Mali staff 03 Apr 2019 at 10:40 a.m. CDT

Mohit Mali gravatar
Hi @Emilio Pena, Can you please post the outcome of this command " /etc/init.d/oxd-server status". its can displayed current status of oxd-server along with configuration settings. Thanks and Regards Mohit Mali

By Emilio Pena user 03 Apr 2019 at 11:28 a.m. CDT

Emilio Pena gravatar
Hi Mohit, As requested here's the outcome of the oxd-server status command: [https://pastebin.com/euBhfVWw] Thanks and best regards

By Mohit Mali staff 04 Apr 2019 at 9:32 a.m. CDT

Mohit Mali gravatar
Hi @Emilio Pena, It's seems like you have installed the lastest version of oxd-server rather than oxd-server 3.1.4 . oxd-server up to 4.0.beta was socket based on port 8099 (port is configurable) and HTTP transport was provided via oxd-https-extension in 4.0.beta We removed socket connection completely and made oxd-server itself work via HTTPS try to unistall the current oxd-server Follow the document for 3.1.4 and install apt-get install oxd-server 3.1.4 Thanks and Support Mohit Mali Gluu Support

By Emilio Pena user 04 Apr 2019 at 9:52 a.m. CDT

Emilio Pena gravatar
Hi @Mohit.Mali, I also realized that one of the values in my oxd-conf.cfg (oxdpython client config file) could be wrong ('id' on 'oxd' section). [oxd] ... id=**oxdclient** Could you please indicate which could be the right value for this and if there's any other potential bad configuration in this or any other config files that I attached? Thanks.

By Emilio Pena user 04 Apr 2019 at 10:03 a.m. CDT

Emilio Pena gravatar
Thanks @Mohit.Mali for the response. I will do as you suggest and communicate the results soon. Thanks for the followup.

By Emilio Pena user 04 Apr 2019 at 2:49 p.m. CDT

Emilio Pena gravatar
Hello @Mohit.Mali. Thanks for the advice, we got rid of Error 111, service now is listening to 8099 and client app can connecto to this socket. However, connection times out (Errno 110 Connection timed out) and application is not able to do anything. I am attaching the debug traceback for more information: [https://pastebin.com/hEKngCKW]

By Emilio Pena user 04 Apr 2019 at 3:27 p.m. CDT

Emilio Pena gravatar
I am convinced now that the oxd.id in my oxd-conf.cfg (oxdpython client config file) is wrong. Value is currently set as follows: [oxd] id=oxdclient Could you please indicate where or how can I get the oxd host id? Thanks.

By Mohit Mali staff 05 Apr 2019 at 9:12 a.m. CDT

Mohit Mali gravatar
Hi @Emilio Pena, I had a discussion recently with the developer , [oxd] id parameter is not needed to be set by user , it will automatically setup by the client app during execution. Please follow the latest documentation for python app which is fully tested with the oxd-server 4.0. https://github.com/mbaser/gluu/blob/master/oxd_tutorial/oxd_tutorial.md https://github.com/mbaser/gluu/blob/master/oxd_tutorial/flask_app_oxd4.py Please test this repo and let me know if its works. Thanks and Regards Mohit Mali

By Emilio Pena user 09 Apr 2019 at 10:44 a.m. CDT

Emilio Pena gravatar
Hello @Mohit.Mali, After testing the oxd_tutorial repo the error is no longer reproduceable. Thank you very much for your help. Other than that, server name resolution was a large component in this issue. Best regards and thanks again.

By Mohit Mali staff 10 Apr 2019 at 3:10 a.m. CDT

Mohit Mali gravatar
Thank you so much @Emilio Pena , please feel to reach out Gluu support for any query.