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

500 (The backend responded with an error) #7288

Closed
wangligen1995 opened this issue Feb 13, 2020 · 17 comments · Fixed by #7291
Closed

500 (The backend responded with an error) #7288

wangligen1995 opened this issue Feb 13, 2020 · 17 comments · Fixed by #7291
Assignees
Labels
theme/ui Anything related to the UI type/bug Feature does not function as expected

Comments

@wangligen1995
Copy link

500 (The backend responded with an error)

Consul returned an error. You may have visited a URL that is loading an unknown resource, so you can try going back to the root or try re-submitting your ACL Token/SecretID by going back to ACLs.
Try looking in our documentation

How to deal with this problem?

@hanshasselberg
Copy link
Member

Please provide more details about your setup: consul version, agent/server information, and how to reproduce the problem you are seeing! Right now your question is so general, it is impossible to help you. Thanks for reporting!

@hanshasselberg
Copy link
Member

Could you check the web inspector and let us know what exactly is going wrong?

@wangligen1995
Copy link
Author

wangligen1995 commented Feb 13, 2020

Could you check the web inspector and let us know what exactly is going wrong?

I started it with docker

docker run --name consul1 -d -p 8500:8500 -p 8300:8300 -p 8301:8301 -p 8302:8302 -p 8600:8600 consul agent -server -bootstrap-expect 2 -ui -bind=0.0.0.0 -client=0.0.0.0

After my service is registered, when I click on the service, this error will be reported when I check the service details

@wangligen1995
Copy link
Author

Please provide more details about your setup: consul version, agent/server information, and how to reproduce the problem you are seeing! Right now your quCONSUL_VERSION=1.7.0zestion is so general, it is impossible to help you. Thanks for reporting!

CONSUL_VERSION=1.7.0

@eyenx
Copy link

eyenx commented Feb 13, 2020

We have the same issue on Consul since version 1.7.0 when we want to look at service over the UI we get this error.

In the logs I see:

Feb 13 14:15:34 tonit-vm-vault-consul-01 consul[9094]:     2020-02-13T14:15:34.956Z [ERROR] agent.http: Request error: method=GET url=/v1/discovery-chain/consul?dc=us-central from=192.168.121.1:55820 error="Connect must be enabled in order to use this endpoint"
Feb 13 14:15:34 tonit-vm-vault-consul-01 consul[9094]: agent.http: Request error: method=GET url=/v1/discovery-chain/consul?dc=us-central from=192.168.121.1:55820 error="Connect must be enabled in order to use this endpoint"

But we do not use consul as service mesh and do not need connect. We just use it as vault backend.

@johncowen johncowen added theme/ui Anything related to the UI type/bug Feature does not function as expected and removed waiting-reply-🤖 labels Feb 13, 2020
@hanshasselberg
Copy link
Member

Thank you for reporting, now we know what you mean! This is an oversight on our side and will be fixed in 1.7.1 which will be released soon.

@wangligen1995
Copy link
Author

Thank you, I will wait for this update。

@johncowen
Copy link
Contributor

Oh hey, I just came back here to say thankyou for the report, but I see @i0rek already did.

Just an extra thankyou for the report here! 🙌

@Wolfsharad
Copy link

This issue still persists in Consul v1.7.2

When refreshing the UI the same error occurs. Am I missing something ?

Consul returned an error. You may have visited a URL that is loading an unknown resource, so you can try going back to the root or try re-submitting your ACL Token/SecretID by going back to ACLs.

@johncowen
Copy link
Contributor

Hi @Wolfsharad

There are many reasons why you might be seeing that message in the Consul UI, to be sure this is the same issue would it be possible for you to give us some more information, such as:

  • What page are you trying to view when you get this error?
  • If you could open Web Inspector/Developer Tools for me and look in both the Console and Network tabs and let me know if you see anything in there that is red. Let me know if you are unsure how to do this and I can walk you through.

Thanks,

@Wolfsharad
Copy link

Accessing : http:/xx.xxx.xxx.xx:8500/ui
It redirects and lands at : http://xx.xxx.xxx.xx:8500/ui/ajio-service-discovery/services

Everything works fine.

Hit the Refresh button, the Error occurs. (Try few times if not getting the Error in the first instance)

Error in console

vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:2680 Error while processing route: dc.services.index Cannot read property 'nextHopProtocol' of undefined TypeError: Cannot read property 'nextHopProtocol' of undefined at http://xx.xxx.xxx.xx:8500/ui/assets/consul-ui-80219c43077ea818f035ddb261cd9256.js:1902:47 at e (http://xx.xxx.xxx.xx:8500/ui/assets/consul-ui-80219c43077ea818f035ddb261cd9256.js:1904:20) at http://xx.xxx.xxx.xx:8500/ui/assets/consul-ui-80219c43077ea818f035ddb261cd9256.js:1903:44 at e (http://xx.xxx.xxx.xx:8500/ui/assets/consul-ui-80219c43077ea818f035ddb261cd9256.js:1904:20) at r.init (http://xx.xxx.xxx.xx:8500/ui/assets/consul-ui-80219c43077ea818f035ddb261cd9256.js:1234:16) at r [as init] (http://xx.xxx.xxx.xx:8500/ui/assets/vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:3018:9) at m (http://xx.xxx.xxx.xx:8500/ui/assets/vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:2922:218) at Function.e.create (http://xx.xxx.xxx.xx:8500/ui/assets/vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:2933:8) at e.r.create (http://xx.xxx.xxx.xx:8500/ui/assets/vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:1341:18) at http://xx.xxx.xxx.xx:8500/ui/assets/vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:1315:76 (anonymous) @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:2680 error @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:2680 O @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:2690 c.triggerEvent @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:2621 t.trigger @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:4876 c.transitionDidError @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:2621 (anonymous) @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:4867 w @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:5076 _ @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:5074 v @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:5072 t.invoke @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:4609 t.flush @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:4601 t.flush @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:4614 r._end @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:4676 r.end @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:4631 r._run @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:4678 r._join @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:4677 r.join @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:4642 h @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:3492 (anonymous) @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:3495 l @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:956 c @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:957 setTimeout (async) (anonymous) @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:958 u @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:949 fireWith @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:950 fire @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:950 u @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:949 fireWith @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:950 ready @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:967 H @ vendor-5b94eb6a11bff93d1247a342ee40dbf8.js:967 VM38:1 Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at showNeg.js:241 at XMLHttpRequest.onDefaultReadyStateChangeHandler (showNeg.js:311) (anonymous) @ showNeg.js:241 onDefaultReadyStateChangeHandler @ showNeg.js:311 XMLHttpRequest.send (async) showNag.NTServerCall @ showNeg.js:322 chkshowNeg @ showNeg.js:239 (anonymous) @ showNeg.js:47 showNeg.js:322 Cross-Origin Read Blocking (CORB) blocked cross-origin response https://negbar.ad-blocker.org/chrome/adblocker-chrome-shownegJson.txt with MIME type text/plain. See https://www.chromestatus.com/feature/5629709824032768 for more details. showNag.NTServerCall @ showNeg.js:322 chkshowNeg @ showNeg.js:239 (anonymous) @ showNeg.js:47

@johncowen
Copy link
Contributor

Perfect thanks @Wolfsharad! This is a slightly different issue (which has been fixed but has not been released as of yet unfortunately).

#7643

TL;DR clearing your browser cache should solve it until we push out a release.

@Wolfsharad
Copy link

Cool. Thanks !

@QofFlower
Copy link

Emmmmm, The error still occurs in version latest(v 1.8.0), are there some ideas to solve this? I run it with Docker as well, The following is the command:
docker run --name consul1 -d -p 8500:8500 -p 8300:8300 -p 8301:8301 -p 8302:8302 -p 8600:8600 consul agent -server -bootstrap-expect 2 -ui -bind=0.0.0.0 -client=0 .0.0.0

@johncowen
Copy link
Contributor

johncowen commented Jul 30, 2020

Hi @QofFlower ,

Thanks for dropping by!

Consul could be returning a 500 error for many different reasons, and the UI will show you that you are getting a 500 error. Are you sure that the error you are seeing is due to the fact that you have connect disabled, or due to the 'nextHopProtocol' error that occurred in 1.7?

There are many reasons why you might be seeing that message in the Consul UI, to be sure this is the same issue would it be possible for you to give us some more information, such as:

What page are you trying to view when you get this error?

If you could open Web Inspector/Developer Tools for me and look in both the Console and Network tabs and let me know if you see anything in there that is red. Let me know if you are unsure how to do this and I can walk you through.

I just noticed you have -bootstrap-expect 2 and a typo in the command you pasted above -client=0 .0.0.0, could either of these be the root of the 500 error?

https://www.consul.io/docs/agent/options#_bootstrap_expect

This flag provides the number of expected servers in the datacenter. Either this value should not be provided or the value must agree with other servers in the cluster. When provided, Consul waits until the specified number of servers are available and then bootstraps the cluster. This allows an initial leader to be elected automatically.

Potentially, Consul is still waiting on the second server in order to bootstrap

Thanks,

@gupf0719
Copy link

gupf0719 commented Jan 6, 2021

2021-01-06T02:32:30.713Z [INFO] agent.server.raft: updating configuration: command=AddStaging server-id=bfeb9efc-fb16-5a19-745b-eaa638a83190 server-addr=172.20.247.14:8300 servers="[{Suffrage:Voter ID:33ecfa60-eb6f-1488-758b-ce8cf044c67d Address:172.20.64.160:8300} {Suffrage:Voter ID:e6132ec3-4723-0dfc-c1f5-377d0dc320c5 Address:172.20.209.52:8300} {Suffrage:Voter ID:bfeb9efc-fb16-5a19-745b-eaa638a83190 Address:172.20.247.14:8300}]"

2021-01-06T03:41:41.833Z [ERROR] agent.http: Request error: method=GET url=/v1/discovery-chain/prometheus1_bareMetalCluster?dc=dc1 from=10.22.44.11:50037 error="Connect must be enabled in order to use this endpoint"

2021-01-06T09:37:31.250Z [ERROR] agent.http: Request error: method=GET url=/v1/discovery-chain/prometheus1BareMetalCluster?dc=dc1 from=11.33.44.11:55421 error="Connect must be enabled in order to use this endpoint"

the consul is deployed in k8s ,but occurred the same error

consul version =1.8.4

@voiprodrigo
Copy link

Hi,

I'm running Consul 1.10.3, with minimal configuration, it's just being used to provide DNS integration to access a Vault cluster (and to Consul itself).

I get this error in the leader node:

[ERROR] agent.http: Request error: method=GET url=/v1/connect/intentions?dc=cdc from=x.x.x.x:38162 error="Connect must be enabled in order to use this endpoint"

In the browser:

image

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/ui Anything related to the UI type/bug Feature does not function as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants