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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Thingworx EMS WebSocket Closed!

gquiroga
4-Participant

Thingworx EMS WebSocket Closed!

When trying to run the EMS on an Ubuntu PC I get the following messages:

twWs_Receive: Websocket closed!

api:sendMessageBlocking: AUTH Message 1 failed. Code:129

 

Web server runs correctly I can open a browser and hit http://localhost:8000/Thingworx/Things/LocalEms/Properties/isConnected however this shows an empty webpage and not an InfoTable.

 

If I run a lsof command it shows the port 8000 is listening and it's being used by wsems and that a connection is established with the ThingWorx Server.

 

Any ideas or suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions
gquiroga
4-Participant
(To:alex.augot)

I was able to establish the connection by opening the AWS Server to pings and by changing the appkey.


View solution in original post

6 REPLIES 6
cdovholuk
6-Contributor
(To:gquiroga)

Your post is a bit light on information. If you add some extra details someone might help better. My first guess would be that your app-key has expired but you don't mention your version of ThingWorx platform.

 

You should: 

* Check the thingworx platform logs.

* Check to see if your app-key has expired

* you don't explain what port 8000 is or what it's supposed to be used for

 

I'm guessing it's your app-key

gquiroga
4-Participant
(To:cdovholuk)

Thanks for your response cdovholuk.

* Port 8000 is what I have configured for the http server.

* I just created the appKey.

* I believe the issue is with the TWX server it's an AWS

cdovholuk
6-Contributor
(To:gquiroga)

It's possilble AWS is terminating the websocket. If there's nothing in the ThingWorx platform logs - this will be an expedition as to the problem. If you have the ability to make a support ticket with PTC support - you probably should.

 

You could try to fire up a tcpdump/wireshark from the ems and see what the actual traffic looks like... You also could try enabling verbose logging in the ems (i don't have the exact instructions how to do that but I believe our doc shows you how) and you should turn up logging at the platform to see if anything pops out of there.

 

I don't think I'll be able to offer you much more than that - sorry...

gquiroga
4-Participant
(To:cdovholuk)

This is what the TWX Server logs say:

 

(CONNECTION) Server WebSocket CLOSED [session id: 12, reason: CloseReason: code [1011], reason [Error [authenticating connection], Server websocket will be closed.]]

 

Error 1011 is TW_ENABLE_FIPS_MODE_FAILED, but I've got fips mode disabled on the EMS.

alex.augot
5-Regular Member
(To:gquiroga)

Hi @gquiroga,

 

The error codes displayed by the Platform are not necessarily the same as those that exist at the Edge.  In this case, the error code 1011 being displayed is a web socket CloseEvent error code that maps to an error type of  'internal server error'.  It looks like there could be an issue with the EMS authenticating, but I'm not familiar enough with the platform to know what would cause  'Error: authenticating connection' error to show up in the logs.

 

More details on CloseEvent error codes - https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent

gquiroga
4-Participant
(To:alex.augot)

I was able to establish the connection by opening the AWS Server to pings and by changing the appkey.


Top Tags