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
    ------------------------------



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

    Posted 4 days ago

    Hi.. Can we revive this post? 

    I have the same issue that Adam is mentioning. I even tried multiple versions of Python and Uopy. The telnet command is working I do use a VPN but I can connect to the server to the specific port. I also specify the service name ("udcs") and even a custom one that we have ("udcsnt").

    Do we have any idea of what it could be? Thank you so much in advance.



    ------------------------------
    Alejandro Garcia
    Software Engineer Manager
    F W Davison and Company Inc. DBA PrismHR
    MA US
    ------------------------------



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

    ROCKETEER
    Posted 2 days ago

    Hi Alejandro,

    Are you getting the same "Connection Refused" error leading to a RPC failed error message? What does your connection string look like? Are you also on a Mac OS system? 

    It may be easier to start a support case with us to gather all the information and troubleshoot. Let me know and I can make one.

    Regards,

    Dave



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



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

    Posted 20 hours ago

    Hi Dave, 

    No, I don't even get a "Connection Refused" message. Just a stray: "Error [81009] : The RPC failed"

    I have been doing a lot of experimentation, and I found the following: I was able to make my script work with another specific version of Python (3.9). I switched to using Anaconda to better control the different Python environments, and that's when the problem started. Well, even before that, in an update of a Python version.

    This one works:

    /usr/bin/python3

    Python 3.9.6 (default, Oct  4 2024, 08:01:31)

    [Clang 16.0.0 (clang-1600.0.26.4)] on darwin

    Type "help", "copyright", "credits" or "license" for more information.

    >>>

    This one from anaconda doesn't work

    Python 3.9.20 (main, Oct  3 2024, 02:24:59)

    [Clang 14.0.6 ] :: Anaconda, Inc. on darwin

    Type "help", "copyright", "credits" or "license" for more information.

    >>>

    Actually, no version from Anaconda seems to work. The only difference that I can see is the Clang. Anaconda looks like it is using version 14. The Python that works is one that I installed via Homebrew, and that one uses Clang 16. I'm not sure if that is the issue, but at this point, I don't know what else could be.



    ------------------------------
    Alejandro Garcia
    Software Engineer Manager
    F W Davison and Company Inc. DBA PrismHR
    MA US
    ------------------------------