Skip to main content
17-Peridot
August 25, 2019
Solved

Unexpected error occurred on server when saving service

  • August 25, 2019
  • 5 replies
  • 15813 views

Hi ,

 

I often get the error "Unexpected error occured on server" when saving service.  I cannot save service anymore as long as the error occurs ,  I have to exit the Edit mode and edit the service again. Even though, the 2nd editing won't assure the save can be successful.  

 

I don't see any related logs when the error occurs, including Thingworx platform logs and tomcat logs.  It's very boring especially when it happens more than 10 times in one hour sometimes.   

 

Any suggestion ? 

error.png

 

 

 

 

Best answer by slangley

Hi everyone.

 

Good news!  R&D has identified the cause of the issue and is planning a fix for the 9.0 release targeted for June.

 

Once the release is made available, I will post an update here to advise.

 

Regards.

 

--Sharon

5 replies

5-Regular Member
August 26, 2019

What if you put the log level to Trace level and then reproduce the issue, you may get more detailed information

16-Pearl
August 26, 2019

Same issue here but no chance to reproduce, it seems to occur randomly.

18-Opal
August 26, 2019

Hello,

 

Just my 2 cents. We used to experience somewhat similar behavior (although I do not recall the exact error message) that was caused by ThingWorx enabling/disabling things. For example, if there were two developers concurrently working on the same instance, and one was modifying a ThingShape, then the second couldn't save his modifications to the ThingTemplate inheriting this ThingShape until the system (re-)enabled/disabled all corresponding Things. The server was full of test data, so those "downtimes" were taking seconds and were quite noticeable. It clearly wasn't the smartest idea to work on a heavily loaded system concurrently, so we solved this issue by changing our development process.

 

I would suggest enabling TRACE logs for the ApplicationLog, it might give you a better idea of what happens inside the platform when you click Save.

 

Regards,
Constantine

seanccc17-PeridotAuthor
17-Peridot
August 31, 2019

@Constantine  ,

 

Thank you for share the experience,  but I'm the only person who use the Thingworx server . 

 

I've enabled the Stacking tracking and script stack tracking in the LoggingSubSystem, but still got nothing in the log when the error occurs.  Any more suggestion ? 

 

Regards,

Sean

16-Pearl
September 2, 2019

@seanccc 

 

 

1. Can you confirm the version of ThingWorx?
2. Is this a fresh install or upgrade?
3. Does this error appear for a specific entity or for every entity that you are saving?
4. If you restart Tomcat do you still experience the same error message?

5. Could you please try clearing the cache and closing and reopening the browser if that works?

 

Thanks,
Vibhuti
seanccc17-PeridotAuthor
17-Peridot
September 13, 2019

Hi everyone,

 

I found the trace log from ErrorLog.log for the error. but have no idea about the error. 

 

2019-09-13 11:58:23.815+0800 [L: ERROR] [O: E.c.t.w.Things] [I: ] [U: Administrator] [S: ] [T: http-nio-8080-exec-10] [message: org.json.JSONException: JSONObject["baseType"] not a string.] org.json.JSONException: JSONObject["baseType"] not a string.
at org.json.JSONObject.getString(JSONObject.java:810)
at com.thingworx.metadata.FieldDefinition.fromJSON(FieldDefinition.java:608)
at com.thingworx.metadata.ServiceDefinition.fromJSON(ServiceDefinition.java:331)
at com.thingworx.metadata.collections.ServiceDefinitionCollection.fromJSON(ServiceDefinitionCollection.java:66)
at com.thingworx.implementation.ThingShapeImplementation.fromJSON(ThingShapeImplementation.java:253)
at com.thingworx.things.Thing.fromJSON(Thing.java:9537)
at com.thingworx.system.managers.ThingManager.fromJSON(ThingManager.java:132)
... 50 common frames omitted
Wrapped by: java.util.concurrent.ExecutionException: org.json.JSONException: JSONObject["baseType"] not a string.
at java.util.concurrent.CompletableFuture.reportGet(Unknown Source)
at java.util.concurrent.CompletableFuture.get(Unknown Source)
at com.thingworx.webservices.BaseService.handleUpdate(BaseService.java:996)
at com.thingworx.webservices.BaseService.service(BaseService.java:492)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.thingworx.security.contenttype.ContentTypeFilter.doFilter(ContentTypeFilter.java:138)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.thingworx.security.filter.ValidationFilter.doFilter(ValidationFilter.java:22)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.thingworx.security.authentication.AuthenticationFilter.propagateRequest(AuthenticationFilter.java:541)
at com.thingworx.security.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:210)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.thingworx.security.filter.ClickjackFilter.doFilter(ClickjackFilter.java:178)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.thingworx.security.filter.ProhibitIfNotLeaderFilter.doFilter(ProhibitIfNotLeaderFilter.java:120)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.thingworx.security.filter.HttpResponseHeadersFilter.doFilter(HttpResponseHeadersFilter.java:173)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

 

1-Visitor
November 22, 2019

I've also seen this issue many times and on many different environments. It can be very frustrating for developers. Has anyone found a solution to this issue?

1-Visitor
November 22, 2019

I had a ticket open with support for this issue.  They couldn't figure it out.  The good news is that it seems to be fixed in the 8.5.1 build of TWX.

18-Opal
January 30, 2020

Hello @wposner-2,

 

I can confirm that we still see this error occasionally in 8.5.1.

 

It happens rarely and thus hard to reproduce. Seems to be related to multiple tabs opened simultaneously, so we just agreed to minimize the number of open windows and it seems to help.

 

/ Constantine

Community Manager
August 12, 2020

Hi everyone.

 

ThingWorx versions 8.4.11 and 8.5.7 were recently released.

 

@seanccc, if you feel your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same issue.

 

Thank you for your participation in our community!

 

Regards.

 

--Sharon