Hugovdberg / PIconnect

A python connector to the OSISoft PI and PI-AF databases
MIT License
89 stars 40 forks source link

Was able to connect for a while, until the server was migrated. #689

Closed Razmand1 closed 1 year ago

Razmand1 commented 1 year ago

Hallo,

I was able to connect to the PI server and had lots of fun with it, until they migrated the server and now I cant get any data out of PI. I have tried a lot but the server administrators keep insisting that nothing has changed so i should be able to connect. I use the standard step by step guide to connect with the pi server and get time series data from data tags on the pi server. This is what I get as the OSI server version:

OSIsoft(r) AF SDK Version: 2.8.0.7444

And after I connect with the server using:

server = PIconnect.PIServer()

All is good, untill i want to get some data:

with PIconnect.PIServer() as server: points = server.search('*') for point in points[:10]: print(point)

Then I get this error:

PIAuthenticationException: Cannot connect to the PI Data Archive. Windows authentication trial failed because the authentication method was not tried. Trust authentication trial failed because insufficient privilege to access the PI Data Archive. at OSIsoft.AF.PI.PIException.ConvertAndThrowException(PIServer piServer, Exception ex, String message) at OSIsoft.AF.PI.PIServer.RemoteConnect(AFConnectionPreference preference, NetworkCredential credential, PIAuthenticationMode authenticationMode) at OSIsoft.AF.PI.PIServer.InternalConnect(Int32 numRetries, IWin32Window owner, AFConnectionPreference preference, NetworkCredential credential, PIAuthenticationMode authenticationMode, Boolean checkConnectingAsSameUser) at OSIsoft.AF.PI.PIServer.AutoConnect(Boolean allowDirectConnect, Boolean force)

Can anyone help me with this please?

Kind regads,

Raz

niltecedu commented 1 year ago

This is a windows AD issue, see if your user has access to PI server

Razmand1 commented 1 year ago

Hi Nilesh,

Thank you so much for the reaction. Yes, my windows account is connected to pi, as per my excel I can get data from the tags I search using the pi data builder. Also the pi data link tab shows my connection to the server and the server name...

Thanks again

Op wo 1 feb. 2023 14:42 schreef Nilesh Zagade @.***>:

This is a windows AD issue, see if your user has access to PI server

— Reply to this email directly, view it on GitHub https://github.com/Hugovdberg/PIconnect/issues/689#issuecomment-1412079360, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATD3DR3A3JM6VUXICXRKD5LWVJR4PANCNFSM6AAAAAAUNUJZVA . You are receiving this because you authored the thread.Message ID: @.***>

niltecedu commented 1 year ago

hiya,

so we have a similar issue come up quite often. try reinstalling pisdk since the windows account seems fine. seems like its trying to find it via older ip

On Wed, 1 Feb 2023 at 5:44 pm, Razmand1 @.***> wrote:

Hi Nilesh,

Thank you so much for the reaction. Yes, my windows account is connected to pi, as per my excel I can get data from the tags I search using the pi data builder. Also the pi data link tab shows my connection to the server and the server name...

Thanks again

Op wo 1 feb. 2023 14:42 schreef Nilesh Zagade @.***>:

This is a windows AD issue, see if your user has access to PI server

— Reply to this email directly, view it on GitHub < https://github.com/Hugovdberg/PIconnect/issues/689#issuecomment-1412079360 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ATD3DR3A3JM6VUXICXRKD5LWVJR4PANCNFSM6AAAAAAUNUJZVA

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/Hugovdberg/PIconnect/issues/689#issuecomment-1412465163, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJZ3KIG3DU7NIPGZF3MYTVLWVKOH5ANCNFSM6AAAAAAUNUJZVA . You are receiving this because you commented.Message ID: @.***>

Hugovdberg commented 1 year ago

To me this sounds like there is some configuration issue on your computer. It is strange you can use PI Datalink, but not PIconnect, as they use the same DLL's and configuration to connect to the server as far as Im aware. There is no configuration inPIconnect` that keeps a reference to servers once the python process ends, everything is requested from the local configuration.

As I don't think this is an issue with this package, but a useful discussion, if only for documentation, I will convert this to a discussion instead of an issue.