Invalid context - Network Error

Hello,

We’ve been using Losant for about a year while developing our new product. Within the last month I’ve started seeing the following error appear after the Dashboard and Technician View pages have loaded. I can get rid of the error by refreshing the page.

We’re using Losant to interact with Particle. We haven’t changed anything on the Losant backend. We have a test fleet of 7 devices. I moved 1 of those devices into a Particle Product from the Particle Sandbox, but this issue appears for devices in both the Product and the Sandbox, so I don’t think it’s due to that.

I’m not a programmer. I spent a couple hours troubleshooting with ChatGPT, and it’s notes are below, if that’s helpful. Can you please assist? Thank you.

ChatGPT Summary Below
We’re experiencing an intermittent issue with embedded dashboards in our Losant Experience application (Ascension Lift IoT Platform).

Both our Dashboard and Technician View pages initially load correctly but subsequently display the following error:

“Invalid context. Network Error. You attempted to set invalid context variables.”

The error sometimes occurs within approximately one minute, while other times the dashboards operate normally for 15 minutes or longer.

We’ve investigated using Chrome Developer Tools and found the following:

· Multiple HTTP 502 Bad Gateway responses from api.losant.com, including requests to the /dashboards/{dashboardId}/validateContext and /dashboards/{dashboardId}/data endpoints.

· The 502 responses identify nginx as the responding server.

· Successful validateContext responses return “success”: true, with all three context variables (deviceId, connectionTime, and connected) validated successfully.

· The issue affects multiple devices, including devices associated with different Particle products.

· Other Experience functionality, including the Events page, appears to remain operational.

We’ve reviewed the Experience workflow responsible for constructing the dashboard context and haven’t identified an obvious configuration problem.

Could you please investigate whether these API failures are related to the Invalid Context errors we’re experiencing? We’d also appreciate guidance on whether there is anything in our application configuration that could be contributing to the problem.

We can provide redacted screenshots of the relevant network requests and responses if helpful.

Hi @Nathanael_Gross and welcome to the Losant Forums!

Can you please set up a test account in your experience that I can use to try and reproduce the issue? You can create me a user, drop it into the same experience group as the user(s) where you are seeing the issue, and then PM me the email address, password, and a URL within your experience where I can see the issue.

With that in hand I may be able to figure out what’s going on.

Hi Dylan, and thank you for the quick response! I’ve created the test account and have the info ready to send you. How do I PM it to you in this space?

Just wanted to let you know we are still investigating this. We are able to reproduce the error you posted here and our engineering team is tracking down its cause. We will let you know when we have a fix in place. Thanks again for the report.

10-4, thanks Dylan. I appreciate you keeping me up-to-date.

Thanks again for your patience. We have identified the underlying issue and have rolled out a fix. I’ve been monitoring your experience dashboard and have yet to see the error occur for the last couple hours - whereas before it would usually occur after a couple minutes.

If you do see this happen again, please let us know!

Great news, thank you Dylan! I should have mentioned this earlier, but I observed this happen on both the Dashboard and Technician View pages. Do you know if it’s resolved on both of those, or if it was affecting any of the other Experience pages?

The fix should work for both dashboards … it was actually an issue within our API layer, so it had the potential to affect other calls outside of rendering experience dashboards as well.

OK, great. Thanks again, Dylan. I’m going to remove that test account I created for y’all now, unless you have anything else you need to test? I’ve had the page open for a couple hours now myself and haven’t seen the error, either.

Yes, you can remove it. I also created a support@losant.com experience user for testing that you can also remove. Thanks for your help in reproducing the issue.

Outstanding! Thanks again, very smooth experience working with you and your team, Dylan. As someone who also answers technical support calls, I appreciate it. Please pass this on to your manager.

Actually, hang on… still been a pleasure working with you, but I just checked and saw the message below (included with today’s timestamp in the bottom-right). Not sure if this was due to me just deleting those two accounts, but I’m going to monitor again for the rest of the day. I’ll report back tomorrow if I see the error again.

I would expect that error if the user you are currently signed in with was either deleted, or if they no longer had access to the device whose ID is in the query string.

If it’s neither of those cases, you can PM me repro details again and I can take a look.