praeco icon indicating copy to clipboard operation
praeco copied to clipboard

API error Error: Request failed with status code 500 and API error Error: Request failed with status code 404

Open singhabhi786 opened this issue 5 years ago • 5 comments

API error Error: Request failed with status code 500 and API error Error: Request failed with status code 404

I am getting these pop ups on opening the praeco page.

http://localhost:8080/api/metadata/elastalert?noagg=1 -- 500 status code http://localhost:8080/api/indices -- 404 status code

I am able to access other api's like config, rules etc.

Note: I have configured api.config.json and elastalert.yaml .

image

image

singhabhi786 avatar Dec 06 '19 11:12 singhabhi786

Hi , I am also facing the above error while running praeco server

App running at:

  • Local: http://localhost:8080/
  • Network: unavailable

Note that the development build is not optimized. To create a production build, run npm run build.

Proxy error: Could not proxy request /metadata/elastalert?noagg=1 from 30.18.0.101:8080 to http://localhost:3030/. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).

Proxy error: Could not proxy request from 30.18.0.101:8080 to http://localhost:3030/. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).

Proxy error: Could not proxy request /status from 30.18.0.101:8080 to http://localhost:3030/. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).

Proxy error: Could not proxy request /config from 30.18.0.101:8080 to http://localhost:3030/. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).

while accessing UI

image

Please help me on this

suresh447 avatar Feb 13 '20 08:02 suresh447

Hi, @singhabhi786 Please let me know how are you running the praeco? docker-compose? Does basic Praeco web UI work? Can you create rule?

I think, it seems to be that ElastAlert Server CANNOT connect to Elasticsearch.

config, rules etc. is responsed by ElastAlert Server. But, indices, metadata have to access to Elasticsearch.

Hi, @suresh447 Is your ElastAlert Server running? From the log:

Proxy error: Could not proxy request /metadata/elastalert?noagg=1 from 30.18.0.101:8080 to http://localhost:3030/.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).

your ElastAlert Server (http://localhost:3030) is seems to be NOT running.

Regards, Daichi

daichi703n avatar Feb 14 '20 12:02 daichi703n

These kinds of errors mean there is something wrong with the API server. Can you please post the logs from elastalert-server outputs in docker-compose?

johnsusek avatar Jun 13 '20 22:06 johnsusek

May be you should check permissions for a folders. I can't saved any rule with this error.

elastalert_1 | Routes: Request for '/rules/:id' failed with error: elastalert_1 | elastalert_1 | [Error: EACCES: permission denied, open '/opt/elastalert/rules/Zipy_5XX.yaml'] { elastalert_1 | errno: -13, elastalert_1 | code: 'EACCES', elastalert_1 | syscall: 'open', elastalert_1 | path: '/opt/elastalert/rules/Zipy_5XX.yaml' elastalert_1 | }

I fixed it with chown -R 1000:1000 rules chown -R 1000:1000 rule_templates

ghost avatar Sep 03 '20 05:09 ghost