Rocket U2 | UniVerse & UniData

 View Only
  • 1.  Connection to Ellucian UniData Database Fails from UOPY

    Posted 02-22-2024 18:39

    Hey,

    I am migrating our codebase from Java to Python but when using the same parameters I am unable to get a connection to the Ellucian database.  Any help with troubleshooting this is appreciated!!

    My code is:

    import uopy

    ses = uopy.connect(hostname='databaseURL', user='databaseUser', password='databasePassword', account='databaseAccount')
    cmd = uopy.Command("LIST STUDENT.TERMS")
    cmd.run()
    print(cmd.response)
    and my error is:
    "/Users/adam/Documents/Developer Workspaces/python/.venv/bin/python" "/Users/adam/Documents/Developer Workspaces/python/Uniobjects for Python/helloworld.py"
    (.venv) adam@A010503 python % "/Users/adam/Documents/Developer Workspaces/python/.venv/bin/python" "/Users/adam/Documents/Developer Workspaces/python/Uniobjects for Python/helloworld.py"
    Traceback (most recent call last):
      File "/Users/adam/Documents/Developer Workspaces/python/.venv/lib/python3.12/site-packages/uopy/_unirpc.py", line 152, in __init__
        self._socket = socket.create_connection((host, port), timeout)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/socket.py", line 852, in create_connection
        raise exceptions[0]
      File "/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/socket.py", line 837, in create_connection
        sock.connect(sa)
    ConnectionRefusedError: [Errno 61] Connection refused
     
    The above exception was the direct cause of the following exception:
     
    Traceback (most recent call last):
      File "/Users/adam/Documents/Developer Workspaces/python/Uniobjects for Python/helloworld.py", line 3, in <module>
        ses = uopy.connect(hostname='databaseURL', user='databaseUser', password='databasePassword', account='databaseAccount')
     
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/adam/Documents/Developer Workspaces/python/.venv/lib/python3.12/site-packages/uopy/_uopy.py", line 121, in connect
        session.connect()
      File "/Users/adam/Documents/Developer Workspaces/python/.venv/lib/python3.12/site-packages/uopy/_session.py", line 299, in connect
        self._rpc_connection.connect()
      File "/Users/adam/Documents/Developer Workspaces/python/.venv/lib/python3.12/site-packages/uopy/_unirpc.py", line 105, in connect
        self.rpc_socket = _UniRPCSocket(self.host, self.port, self.timeout)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/adam/Documents/Developer Workspaces/python/.venv/lib/python3.12/site-packages/uopy/_unirpc.py", line 170, in __init__
        raise UOError(ErrorCodes.UOE_RPC_FAILED) from e
    uopy._uoerror.UOError: Error [81009] : The RPC failed
    (.venv) adam@A010503 python % 
    Thanks,
    Adam


    ------------------------------
    Adam Hamilton
    UNIVERSITY OF CALIFORNIA - HASTINGS COLLEGE OF LAW
    San Francisco CA US
    ------------------------------


  • 2.  RE: Connection to Ellucian UniData Database Fails from UOPY

    ROCKETEER
    Posted 02-23-2024 07:33

    Hey Adam,

    I replicated a very similar error here. I was able to resolve it after connecting to our VPN to properly be on the network of the database.

    I would look into "ConnectionRefusedError: [Errno 61] Connection refused" part of the error message. This is the error you received when trying to connect from the client to the server via socket. I would check that the port being used (typically 31438 unless changed) is open on the client machine, and check network/firewall from there as well.

    Can the same physical machine you are on connect to the data base with UOJ?

    You likely need to engage with Ellucian support, who can then engage with us if a support case is needed.

    Regards,



    ------------------------------
    Dave Weinstein
    Associate Technical Support Engineer
    Rocket Internal - All Brands
    ------------------------------



  • 3.  RE: Connection to Ellucian UniData Database Fails from UOPY

    Posted 02-23-2024 18:11

    I will see if Ellucian offers support but they are trying to force is off UniObjects and onto Ethos.  I am able to connect from my computer using the Java libraries.  I just haven't had the same luck with the python package.  This java code connects to the unidata database:

    UniJava ujava = new UniJava();

    System.out.println("set debugging...");

    UniJava.setPoolingDebug(true);

    UniSession uSession;

    try {

    uSession = ujava.openSession();

    uSession.connect(Credentials.HOST, Credentials.CUSERNAME, Credentials.CPASSWORD, Credentials.ACCT);

    ...



    ------------------------------
    Adam Hamilton
    UNIVERSITY OF CALIFORNIA - HASTINGS COLLEGE OF LAW
    San Francisco CA US
    ------------------------------



  • 4.  RE: Connection to Ellucian UniData Database Fails from UOPY

    ROCKETEER
    Posted 02-23-2024 19:24

    I've just noticed your file paths look like you are on Mac. Can you try uopy 1.2.0? There is a bug on 1.3.0 connecting with Mac if I remember correctly.

    A 'pip install uopy==1.2.0' and then trying your test code may prove/disprove that. 

    Regards,



    ------------------------------
    Dave Weinstein
    Associate Technical Support Engineer
    Rocket Internal - All Brands
    ------------------------------



  • 5.  RE: Connection to Ellucian UniData Database Fails from UOPY

    Posted 02-28-2024 02:26

    Thanks Dave - yes, I'm on a mac but still no luck.  The script is still failing instantly even with uopy-1.2.0 whether or not I have the correct parameters in my connect string. 

    • Is there a config file with default values I should look to overwrite (port?)?
      • uopy.connect(hostname='uchlpcolduor01.uchastings.local ', user='SOMEUSER', password='SOMEPASSWORD', account='SOMEACCOUNT')
    • I have DNS resolution
      • % ping uchlpcolduor01.uchastings.local 
        PING uchlpcolduor01.uchastings.local (172.25.155.243): 56 data bytes
        64 bytes from 172.25.155.243: icmp_seq=0 ttl=63 time=169.051 ms
        ^C
        --- uchlpcolduor01.uchastings.local ping statistics ---
        1 packets transmitted, 1 packets received, 0.0% packet loss
        round-trip min/avg/max/stddev = 169.051/169.051/169.051/nan ms

    • I can connect to the server via ssh (and through Java UniObjects):
    • I rolled back to uopy-1.2.0
      • (.venv) adam@A010503 python % pip3 install uopy==1.2.0                                                                                                                                  
        Requirement already satisfied: uopy==1.2.0 in ./.venv/lib/python3.12/site-packages (1.2.0)

     

    Same old error - are there debugging steps I can take?

    (.venv) adam@A010503 python % "/Users/adam/Documents/Developer Workspaces/python/.venv/bin/python" "/Users/adam/Documents/Developer Workspaces/python/Uniobjects for Python/helloworld.py"
    Traceback (most recent call last):
      File "/Users/adam/Documents/Developer Workspaces/python/.venv/lib/python3.12/site-packages/uopy/_unirpc.py", line 139, in __init__
        self._socket = socket.create_connection((host, port), timeout)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/socket.py", line 852, in create_connection
        raise exceptions[0]
      File "/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/socket.py", line 837, in create_connection
        sock.connect(sa)
    ConnectionRefusedError: [Errno 61] Connection refused
     
    The above exception was the direct cause of the following exception:
     
    Traceback (most recent call last):
      File "/Users/adam/Documents/Developer Workspaces/python/Uniobjects for Python/helloworld.py", line 3, in <module>
        ses = uopy.connect(hostname='SOMEHOST', user='SOMEUSER', password='SOMEPASSWORD', account='SOMEACCOUNT')
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/adam/Documents/Developer Workspaces/python/.venv/lib/python3.12/site-packages/uopy/_uopy.py", line 112, in connect
        session.connect()
      File "/Users/adam/Documents/Developer Workspaces/python/.venv/lib/python3.12/site-packages/uopy/_session.py", line 213, in connect
        self._rpc_connection.connect()
      File "/Users/adam/Documents/Developer Workspaces/python/.venv/lib/python3.12/site-packages/uopy/_unirpc.py", line 92, in connect
        self.rpc_socket = _UniRPCSocket(self.host, self.port, self.timeout)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/adam/Documents/Developer Workspaces/python/.venv/lib/python3.12/site-packages/uopy/_unirpc.py", line 149, in __init__
        raise UOError(ErrorCodes.UOE_RPC_FAILED) from e
    uopy._uoerror.UOError: Error [81009] : The RPC failed
    (.venv) adam@A010503 python % 


    ------------------------------
    Adam Hamilton
    UNIVERSITY OF CALIFORNIA - HASTINGS COLLEGE OF LAW
    San Francisco CA US
    ------------------------------



  • 6.  RE: Connection to Ellucian UniData Database Fails from UOPY

    Posted 02-29-2024 07:26

    Adam,

    If you have telnet client software for the Mac then try telnetting to the UniObjects port - suually 31438. You should get connected, even though nothing will work. e.g. at a command prompt: telnet <hostname> 31438. This will confirm that the port is available and there is or is not a firewall issue. If it fails then it is worth trying the same telnet connection froma  Windows client and also from the server to itself telnet localhist 31438 - the latter should always work barring security software interfering.

    Regards

    JJ



    ------------------------------
    John Jenkins
    Thame, Oxfordshire
    ------------------------------



  • 7.  RE: Connection to Ellucian UniData Database Fails from UOPY

    ROCKETEER
    Posted 03-04-2024 07:12

    Adam,

    Along with JJ's notes below, you could try specifying the service in the connection call. It defaults to defcs which may not be setup to connect properly. Try adding service  = 'udcs' or whatever service name is generally used. 

    Check out the docs https://rocketsoftware.github.io/uopy-demo/docs/uopy.html which describes the uopy.ini file which can be used to configure connections, ports, etc as well as client side logging. 

    Regards,



    ------------------------------
    Dave Weinstein
    Associate Technical Support Engineer
    Rocket Internal - All Brands
    ------------------------------