cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Error with Analytics 8.1 Authentication and Auth Key required

Regular Member

Error with Analytics 8.1 Authentication and Auth Key required

Hey All,

Hoping somebody might be able to help .

Current Configuration

Thingworx 8.1 server

Windows Server 2016

DB : MS Sql Server 2014

Installed extensions for analytics , and every thing seems to be fine.

Analytics Server 8.1 ( Docker install on linux)

Centos 7  full install (desktop)

The problem i face is when i am trying to build a dataset i get and error with 401.

here's a snapshot of the docker ps services running

docker log for analytics

and heres the problem

I am not sure why but analytics services are trying to connect to a PostgreSQL DB via analytics users. I dont understand why , and there was no prerequisites on documentation for postgresql DB on the docker install.

Any help would be much appreciated

Cheers

Paul B

8 REPLIES 8

Re: Error with Analytics 8.1 Authentication and Auth Key required

Hi Paul

Could you post the exact command that gives you the postgres error ?

You mentioned "docker log for analytics" but there is no analytics container in 8.1 and indeed no need of postgres either.

Did you install a previous version of Analytics on that machine maybe ?


Could you post also :

- a zip of folder /root/twx-analytics/logs

- edge.log file created with command docker logs edgems > edge.log


Thanks

Christophe

Re: Error with Analytics 8.1 Authentication and Auth Key required

Hey Christophe,

Thanks for the quick response.

The command i used was from the Analytics Builder GUI. It happened when i tried to load a dataset as described in Picture 1 above.

Here a screen grab of our downloadable area within PTC

screenshot8.jpg

Hope you can read this but it seems to indicate "Analytics Server Docker linux Standalone 8.1 version" , so not really sure about the comment with regards to versions. Could be wrong im pretty new to all this .

Yes i had previously run Analytics Server 8.0 on this linux box but thought i had remove everything , it was a linux standalone version . I had thought of this issue but the check which docker containers were running and the URL that activate.

That is my plan B fresh linux box - but i wanted to know whats going and try fix if possible.

I have the logs zipped ready to go but not sure how to upload file so guidance would be appreciated. Sorry for noob question here but it seems everything with regards to PTC and thingworx works a little differently.

Again thanks for your help

Cheers

Paul B

Re: Error with Analytics 8.1 Authentication and Auth Key required

Hey Christopher,

Not sure if the upload was done correctly but heres the URL Archive.zip

Also forgot to mention the exact postgresql error was found by loggin onto the linux box and running the command "docker logs analytics" . and the time stamps matched up with my actions in the Analytics Builder

Cheers

paul B

Re: Error with Analytics 8.1 Authentication and Auth Key required

Hi Paul

Thank you for your posting.

Attaching file is a little hidden indeed. You need to select the Use Advanced Editor on the top right of the response, then in the Advanced editor you will find a Attach link at the bottom right corner.

I was though able to download your file too.

It seems that you do have some remain of an 8.0 version.

Could you post the output of docker ps -a ?

docker logs analytics is not relevant here. The analytics container is not part of 8.1, it used though to exist in 8.0.

We can see in your output of docker ps in the initial post that there is in fact no analytics container running, which is normal.

The error we have is to be found in the datams.log:

com.thingworx.analytics.ccc.platform.http.BadResponseException: HTTP [401]

...

Causing: java.lang.RuntimeException: java.io.IOException: Unable to initialize FileRepository

the 401 means authentication failed, so it is likely that you have an incorrect appkey in the Analytics config file(s).

Could you please upload:

/root/twx-analytics/edge-config/analyticsserver.properties

/root/twx-analytics/config/system-environmentvariables.properties

<ThingWorxStorage>/logs/ApplicationLog.log

Thank you

Kind regards

Christophe

Re: Error with Analytics 8.1 Authentication and Auth Key required

Hey Christopher,

Thanks for taking the time to help.

Heres a snapshot of docker ps -a

and the rest of the files requested are blow in the config.zip.

Config.zip

Cheers

Paul B

Re: Error with Analytics 8.1 Authentication and Auth Key required

Hi Paul

Thanks for this.

The Appliciton log is though not helpful as it has been rotated and contians only today's acitivity.

Could you reproduce the error in Builder and then send me the ApplciationLog.log file.

As a reminder to atatch the file:

Attaching file is a little hidden indeed. You need to select the Use Use advanced editor on the top right of the response, then in the Advanced editor you will find a Attach link at the bottom right corner.


Thanks

Christophe

Re: Error with Analytics 8.1 Authentication and Auth Key required

Hi Paul and Christophe,

We had an almost identical mistake. We solved it by checking the Application Keys section in Security (on Foundation).

We noticed the Analytics-AppKey had expired. Apparently, when created, an expiration date is assigned.

You just have to change it into a far away date and it should work.

Regards,
Bernardo

 

Highlighted

Re: Error with Analytics 8.1 Authentication and Auth Key required

Hi Paul and Christophe,

We had an almost identical mistake. We solved it by checking the Application Keys section in Security (on Foundation).

We noticed the Analytics-AppKey had expired. Apparently, when created, an expiration date is assigned.

You just have to change it into a far away date and it should work.

Regards,
Bernardo

 

P.S. - Sorry for the double response. Wasn't sure you'd be notified of the last one.