Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scope stuck "connecting to scope" #2154

Closed
tomwilkie opened this issue Jan 26, 2017 · 22 comments
Closed

Scope stuck "connecting to scope" #2154

tomwilkie opened this issue Jan 26, 2017 · 22 comments
Assignees
Labels
bug Broken end user or developer functionality; not working as the developers intended it

Comments

@tomwilkie
Copy link
Contributor

With this in the console:

VM245 vendors-b764d66….js?6ded3cd…:12 Uncaught TypeError: t.filter is not a function
    at f (VM245 vendors-b764d66….js?6ded3cd…:12)
    at i (VM245 vendors-b764d66….js?6ded3cd…:33)
    at f (VM245 vendors-b764d66….js?6ded3cd…:33)
    at l (VM245 vendors-b764d66….js?6ded3cd…:33)
    at VM245 vendors-b764d66….js?6ded3cd…:33
    at dispatch (VM245 vendors-b764d66….js?6ded3cd…:45)
    at VM245 vendors-b764d66….js?6ded3cd…:1
    at VM245 vendors-b764d66….js?6ded3cd…:33
    at Object.success (VM245 vendors-b764d66….js?6ded3cd…:13)
    at Reqwest.o.success._successHandler (VM245 vendors-b764d66….js?6ded3cd…:50)
@2opremio 2opremio added the bug Broken end user or developer functionality; not working as the developers intended it label Jan 26, 2017
@davkal
Copy link
Contributor

davkal commented Jan 26, 2017

Looks like requests to the backend are malformed when used in the service UI: http://hostname/api/api/app/{org}/api/topology

Notice the double api in the beginning.

Possible introduced by #2144

@2opremio
Copy link
Contributor

This happened somewhere between 244bba2 and 29edaeb . I doubt this was the backend. My main suspect is #2144

@foot @davkal @jpellizzari @fbarl This is urgent, it broke dev (and then prod)

@2opremio
Copy link
Contributor

Interestingly, I did test prod right after the upgrade and Scope was working. Could it be due to caching of the assets?

@davkal
Copy link
Contributor

davkal commented Jan 26, 2017

Interestingly, I did test prod right after the upgrade and Scope was working. Could it be due to caching of the assets?

That could have been masking the issue.

@2opremio
Copy link
Contributor

So, IMO, we need to do three things to prevent this from happening in the future:

  1. Fix the assets caching problem (if there´s any, I believe there is)
  2. Add an integration test minimally testing the UI
  3. Be more thorough when testing changes

@2opremio
Copy link
Contributor

But let´s of course first figure out what the problem is.

@rade
Copy link
Member

rade commented Jan 26, 2017

I thought we had some metrics/alerts for set up to catch this sort of breakage.

@2opremio
Copy link
Contributor

2opremio commented Jan 26, 2017

I thought we had some metrics/alerts for set up to catch this sort of breakage.

Assuming the problem comes from the UI, I don´t think so.

@davkal
Copy link
Contributor

davkal commented Jan 26, 2017

We have monitoring in place, see https://github.com/weaveworks/monitoring/issues/101
but no alerting yet.

@rade
Copy link
Member

rade commented Jan 26, 2017

weaveworks/monitoring/issues/101

exactly.

but no alerting yet.

Understood, but did this problem at least show up in the data?

@jpellizzari
Copy link
Contributor

@rade This was neither a page-load or page-render error. The app was served successfully and the requested page was rendered. This is the result of a bad URL path resulting in index.html being served to a call that expects JSON. Our HTTP library decided it was a string and passed it to a .filter() call.

@2opremio
Copy link
Contributor

This is the result of a bad URL path

Did you track down how the bad URL was generated?

@jpellizzari
Copy link
Contributor

@2opremio Yes, it is a result of #2144. I added some extra logic so that scope will get the right URL path while running as a component, as well as an iFrame. There is one commit I was expecting to see on master that isn't there, so it's likely I forgot to push it before merging my PR.

@jpellizzari
Copy link
Contributor

jpellizzari commented Jan 26, 2017

This was the commit I was referring to that never got pushed: 8ea7de9

@jpellizzari
Copy link
Contributor

Fixed in #2159

@2opremio
Copy link
Contributor

https://cloud.weave.works/demo/ is still broken after the fix. See:

screen shot 2017-01-30 at 11 45 25

Note how the url is wrong: https://cloud.weave.works/api/demo/api

@2opremio 2opremio reopened this Jan 30, 2017
@2opremio
Copy link
Contributor

I reverted prod to 244bba2 but it's still reproducible at http://frontend.dev.weave.works/demo/

@davkal
Copy link
Contributor

davkal commented Jan 30, 2017

@jpellizzari to debug this, you can simply run npm start and then access http://localhost:4043/scoped/
This was specifically included in the express server to test path prefixes. (But maybe that should have been automated.)

At first glance it looks like this heuristic caused the problem:

const isStandalone = window.location.pathname === '/' || /\/(.+).html/.test(window.location.pathname);

Maybe better to detect the opposite (scope-as-component)?

davkal added a commit that referenced this issue Jan 30, 2017
@2opremio
Copy link
Contributor

2opremio commented Feb 2, 2017

@awh discovered we are having the same (or similar problem) at /admin/scope in Weave Cloud. This is not covered by @davkal's hotfix.

For instance, at http://frontend.dev.weave.works/admin/scope/ I get:

Uncaught TypeError: t.filter is not a function
    at f (vendors-58f07ad….js?547653e…:12)
    at i (vendors-58f07ad….js?547653e…:33)
    at f (vendors-58f07ad….js?547653e…:33)
    at l (vendors-58f07ad….js?547653e…:33)
    at vendors-58f07ad….js?547653e…:33
    at dispatch (vendors-58f07ad….js?547653e…:45)
    at vendors-58f07ad….js?547653e…:1
    at vendors-58f07ad….js?547653e…:33
    at dispatch (vendors-58f07ad….js?547653e…:45)
    at Object.success (vendors-58f07ad….js?547653e…:13)

screen shot 2017-02-02 at 15 51 22

@2opremio
Copy link
Contributor

2opremio commented Feb 2, 2017

It's the same problem (the UI is requesting http://frontend.dev.weave.works/api/admin/scope/api)

@jpellizzari
Copy link
Contributor

#2202 Has been merged and pushed to dev and is working correctly.

@ngehani
Copy link

ngehani commented Mar 19, 2018

Cluster Health

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken end user or developer functionality; not working as the developers intended it
Projects
None yet
Development

No branches or pull requests

6 participants