Dashboard and dev just spinning?


#17

It seems this call is failing and no idea why/how to fix it:

(removed the parts I thought might be sensitive)

https://graph.api.smartthings.com/api/token/XXXXXXXXXX/smartapps/installations/713686f8-6e0b-4230-af47-8d5401a376a3/intf/dashboard/load?token=XXXXXXXXXXXXXXX&pin=XXXXXXXXXXXXXx&dashboard=0&dev=XXXXXXXXX&callback=angular.callbacks._1


#18

Does the response to that request include any more info than the exception that you saw in the IDE logs?


#19

No not really:

error true
type "java.lang.NullPointerException"
message “An unexpected error occurred.”

A get returns:
500 Internal Server Error


#20

I once had a similar error trying to access the old CoRE dashboard.

I needed to re-generate the token under Oauth in the IDE… worth a shot at least?


#21

you mean clicking “Refresh client secret (warning: this will make your current secret invalid)”

I have tried that also :frowning:


#22

Ok, dive in with me here. I get the impression that you’re at least fairly technical, so let me know if you need more info on any of the steps I gloss over below.

First thing to figure out is whether a specific piston is responsible for this. You’re already at step 4 since you showed the URL but other steps included for the benefit of others.

  1. Open the dashboard in Chrome (or whichever browser you use that has a network inspector)
  2. Open Developer Tools to the network tab
  3. Refresh the dashboard, filter network requests that show up on the text dashboard/load
  4. There is probably only one and it’s probably red, right click and select Open in new tab
  5. Replace /intf/dashboard/load? with /intf/dashboard/piston/get?id=& but don’t load that page yet because we need to get the id
  6. Open developer.smartthings.com in a new tab and click through My Locations > Home > List SmartApps
  7. Find webCoRE then for each of the pistons nested below it:
    1. Click the piston name
    2. Copy the id shown under Event Subscriptions which will look like :19ac3370d57aafca115c3f7033ed973c:, including the colons
    3. Paste that between the id= and the & in the earlier URL
    4. Load the page and see if there is an error, no error will be a bunch of code starting with angular.callbacks

If it looks like all of them will error out after trying a few that’s fine we can look for something else. Otherwise, my hope is that one but not all of these will throw an error.


Dashboard Loads, but Pistons Won't
#23

Rise of the machines? Is it coming true?


#24

I would!


#25

Seems like I did something wrong - will check again but I get:

angular.callbacks._2({“name”:“NC \ webCoRE_1”,“error”:“ERR_INVALID_TOKEN”,“now”:1510258545656})


#26

Hm, maybe clear your cookies and try to get the load URL again?


#27

I also remember with old CoRE, when I reset the token I had to do something in the mobile app after… will dig into some of my old posts.


#28

The /load shows the same error though when a token is invalid so I think it might be how you edited it. Can you paste here redacted or in a PM to me?


#29

I’ll PM you - sent


#30

I keep thinking something is broken somewhere like that - some thing that hooks all this magic together I just have no idea where to find it.


#31

The URL included /intf/dashboard/load?token=&pin= with a value for the pin but no token. I think something got stuck halfway through signing you in to the dashboard. Open up the browser console and run the command localforage.clear();

This will reset the data cached in your browser and require you to re-authorize that browser to use webCoRE. Once you’ve done that let’s see if it loads up or if we need to keep debugging.


#32

So I register and then next screen asks me my password. When I enter that I get stuck and I get the 500 error. Token is blank


#33

I take it you’ve tried the dashboard button in the mobile app instead of register a browser?

Have you tried going to the smartapps tab of a device and accessing a piston from there?

Are you able to install a second instance and access that?


#34
  1. I have tried from the mobile app hitting dashboard - just spins.
  2. smartapp tab pulls up info on the piston but if I try to view in dashboard I get “Sorry, an error occured while retrieving the piston data”
  3. I do have a second instances of webcore running for my presence sensor and that works fine.

#35

Ok, so I see that the token comes back from a call to /load via a request with just the pin like you have, then the frontend uses the token thereafter but can’t get the token in your case since /load doesn’t work. Let’s approach this from a different angle.

In SmartThings developer can you make the following edit to webCoRE smart app around line 934? Add two forward slashes to comment out the pistons: getChildApps() line as shown, then save and publish:

	return [
        name: location.name + ' \\ ' + (app.label ?: app.name),
        instance: [
	    	account: [id: hashId(hubUID ?: app.getAccountId(), updateCache)],
//        	pistons: getChildApps().findAll{ it.name == name }.sort{ it.label }.collect{ [ id: hashId(it.id, updateCache), 'name': it.label, 'meta': state[hashId(it.id, updateCache)] ] },
            id: hashId(app.id, updateCache),
            locationId: hashId(location.id, updateCache),
            name: app.label ?: app.name,
            uri: state.endpoint,

Try to refresh the dashboard again. Just trying to get the dashboard to load at this point, you’ll have a big sad face since it doesn’t know about your pistons after commenting out that line.


#36

Same spins forever :frowning: