Article - CS271012

ThingWorx Analytics Things are not getting created in ThingWorx due to incorrect application key

Modified: 07-Feb-2024   


Applies To

  • ThingWorx Analytics 8.1 to 9.5

Description

  • The expected micro services Things, such as  <prefix>-AnalyticsServer-DataThing, are not being created post installation
  • Unable to access ThingWorx Analytics server
  • Unable to restart ThingWorx Analytics server
  • Unable to upload data via ThingWorx Analytics Builder
    • TWA_Upload401.png
  • Depending on the scenario and version, various error can be seen, as below:
  • Following error was seen in ThingWorx Analytics Builder
    An Analytics Server is not configured. Navigate to the Settings page and configure a ThingWorx Analytics Server adapter
  • twas-twx-adapter.log file reports
    • com.thingworx.analytics.css.platform.http.BadResponseException: HTTP [401] :
          at com.thingworx.analytics.css.platform.http.RestService.httpSubmitAsJson(RestService.java:133)
          at com.thingworx.analytics.css.platform.http.RestService.httpGetAsJson(RestService.java:36)
          at com.thingworx.analytics.css.platform.services.ThingService.getThing(ThingService.java:100)
          at com.thingworx.analytics.edge.application.AnalyticsGateway.safeGetThing(AnalyticsGateway.java:153)
          at com.thingworx.analytics.edge.application.AnalyticsGateway.safeCreateThing(AnalyticsGateway.java:135)
          at com.thingworx.analytics.edge.application.AnalyticsGateway.registerToFoundation(AnalyticsGateway.java:111)
          at com.thingworx.analytics.edge.application.AnalyticsEdgeVerticle.start(AnalyticsEdgeVerticle.java:96)

       
  • Possible other error in twas-twx-adapter.log
    • Error registering and binding to the platform HTTP [404] : Thing Template [PredictionMicroserver] does not exist

       
    •  
      ERROR c.t.c.c.e.ClientCommunicationEndpoint - Refilling connections on [endpoint 0, uri: ws://XXXX/Thingworx/WS] failed : Connection authentication/registration FAILED [code: STATUS_UNAUTHORIZED, reason: Error [context: authenticating connection][cause: Application key 'TW.AnalysisServices.ApplicationUserKey' expired!]]

       
  • Tomcat access log reports
"GET /Thingworx/Things/<AnalyticsServer Thing Name> HTTP/1.1" 401 –

 
  • Possible related errors:
com.thingworx.analytics.ccc.platform.http.BadResponseException: HTTP [401] Unauthorized: Not authorized for Read



 
 com.thingworx.analytics.ccc.platform.http.BadResponseException: HTTP [401] Unauthorized: Not authorized for Create



 
 c.t.a.e.a.AnalyticsEdgeVerticle - Failed during startup
com.thingworx.analytics.ccc.platform.http.BadResponseException: HTTP [404] : Entity Not Found : [EntityServices]
    at com.thingworx.analytics.ccc.platform.http.RestService.httpSubmitAsJson(RestService.java:133)
    at com.thingworx.analytics.ccc.platform.http.RestService.httpPostAsJson(RestService.java:50)
    at com.thingworx.analytics.ccc.platform.services.ThingService.createThing(ThingService.java:63)
    at com.thingworx.analytics.edge.application.AnalyticsGateway.safeCreateThing(AnalyticsGateway.java:117)
    at com.thingworx.analytics.edge.application.AnalyticsGateway.registerToFoundation(AnalyticsGateway.java:83)
    at com.thingworx.analytics.edge.application.AnalyticsEdgeVerticle.start(AnalyticsEdgeVerticle.java:87)
    at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$10(DeploymentManager.java:481)
    at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:344)
  • Error received during upload of dataset
Creating copy of Data File...
Creating copy of Configuration File...
Submitting Create Dataset request...
Dataset Create Job with jobId: 1f622740-562b-4ad7-9b55-54733c9c31c6 in progress...
Dataset Create Job with jobId: 1f622740-562b-4ad7-9b55-54733c9c31c6 failed with error:
java.io.IOException: Unable to initialize FileRepository [AnalyticsUploadStorage] Unable to initialize FileRepository [AnalyticsUploadStorage] HTTP [401] : For issues, contact Technical Support and provide the following log tag: b596067f-8ea3-47a9-a975-dac08cb523b4

 
This is a printer-friendly version of Article 271012 and may be out of date. For the latest version click CS271012