pymedphys: error when connecting to Mosaiq SQL

This is the first time I use pymedphys.mosaiq.

I’m trying to perform a query in my Mosaiq. When using Microsoft SQL Server 2014 the data I read in the welcome window are ‘Authentication: Windows Authentication’, ‘User name SR03MSQBBDD\Elekta’ and ‘Password’ empty. Server IP address is 10.3.200.153

I tried in python:

import pymedphys

connection=pymedphys.mosaiq.connect('10.3.200.153')

and I get:

Provide a user that only has `db_datareader` access to 'PyMedPhys_SQLLogin_Mosaiq_10.3.200.153:1433/MOSAIQ'

I write my username SR03MSQBBDD\Elekta

and I get:

Warning: QtConsole does not support password mode, the text you type will be visible.Provide the password for the 'SR03MSQBBDD\Elekta' user on 'PyMedPhys_SQLLogin_Mosaiq_10.3.200.153:1433/MOSAIQ'

and I press enter (no pass)

and, finally, I get:

Traceback (most recent call last):
  File src\pymssql.pyx:636 in pymssql.connect
  File src\_mssql.pyx:1964 in _mssql.connect
  File src\_mssql.pyx:682 in _mssql.MSSQLConnection.__init__
  File src\_mssql.pyx:1690 in _mssql.maybe_raise_MSSQLDatabaseException
MSSQLDatabaseException: (18452, b'Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.DB-Lib error message 20018, severity 14:\nGeneral SQL Server error: Check messages from the SQL Server\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (10.3.200.153)\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (10.3.200.153)\n')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File ~\Anaconda3\lib\site-packages\pymedphys\_mosaiq\connect.py:42 in __init__
    self._connection = pymssql.connect(
  File src\pymssql.pyx:642 in pymssql.connect
OperationalError: (18452, b'Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.DB-Lib error message 20018, severity 14:\nGeneral SQL Server error: Check messages from the SQL Server\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (10.3.200.153)\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (10.3.200.153)\n')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File ~\OneDrive - unav.es\0_programas\schedule\sql.py:12 in <module>
    connection=pymedphys.mosaiq.connect('10.3.200.153')
  File ~\Anaconda3\lib\site-packages\pymedphys\_mosaiq\api.py:88 in connect
    connection = _connect.connect_with_credentials(
  File ~\Anaconda3\lib\site-packages\pymedphys\_mosaiq\connect.py:130 in connect_with_credentials
    connection = Connection(
  File ~\Anaconda3\lib\site-packages\pymedphys\_mosaiq\connect.py:53 in __init__
    raise ValueError(
ValueError: When attempting to connect to MOSAIQ@10.3.200.153:1433 with the SR03MSQBBDD\Elekta user a pymssql.OperationalError was raised

Any hint?

Thanks in advance

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 16 (3 by maintainers)

Most upvoted comments

Just to be clear, I’ve always understood that management of SQL server was something that is handled by each site’s IT department, not Elekta service.

I’m not sure about Elekta, but for Varian, our IT staff have administration access to the VM, network and backup of the SQL server; at install the SQL database is locked down to Active Directory accounts that only Varian controls. That limits the adjustment or addition of user rights to only that account.

With Mosaiq being a Health Canada approved piece of software I cannot imagine that Elekta would not do the same.