multiversx / mx-api-service

Unified REST API facade for providing data related to the MultiversX blockchain
https://api.multiversx.com
GNU General Public License v3.0
31 stars 48 forks source link

curl http://127.0.0.1:3001/stats {"statusCode":500,"message":"Internal server error"} #1014

Closed zhy827827 closed 1 year ago

zhy827827 commented 1 year ago

Contact Details

No response

Description

{"statusCode":500,"message":"Internal server error"}

Steps to reproduce

api service version: mx-api-service-1.0.3-hf2

On which network is the bug manifesting itself?

Mainnet

Relevant log output

{"body":{"from":0,"query":{"match_all":{}},"size":1,"sort":[{"timestamp":{"order":"desc"}},{"shardId":{"order":"asc"}}]},"level":"error","message":"Request failed with status code 403","method":"POST","name":"AxiosError","response":"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<HTML><HEAD><META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n<TITLE>ERROR: The request could not be satisfied</TITLE>\n</HEAD><BODY>\n<H1>403 ERROR</H1>\n<H2>The request could not be satisfied.</H2>\n<HR noshade size=\"1px\">\nThis distribution is not configured to allow the HTTP request method that was used for this request. The distribution supports only cachable requests.\nWe can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.\n<BR clear=\"all\">\nIf you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.\n<BR clear=\"all\">\n<HR noshade size=\"1px\">\n<PRE>\nGenerated by cloudfront (CloudFront)\nRequest ID: ambQFhl2huRfX_TGe7dPkim-wQF9O-7tvjO7zJWDfCYYacSggmR8iw==\n</PRE>\n<ADDRESS>\n</ADDRESS>\n</BODY></HTML>","status":403,"timestamp":"2023-03-20T08:22:15.259Z","url":"https://index.elrond.com/blocks/_search"}
{"level":"error","message":"Error running Token / account assets invalidations","stack":["Lock"],"timestamp":"2023-03-20T08:22:15.260Z"}
{"body":{"from":0,"query":{"match_all":{}},"size":1,"sort":[{"timestamp":{"order":"desc"}},{"shardId":{"order":"asc"}}]},"level":"error","message":"Request failed with status code 403","method":"POST","name":"AxiosError","response":"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<HTML><HEAD><META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n<TITLE>ERROR: The request could not be satisfied</TITLE>\n</HEAD><BODY>\n<H1>403 ERROR</H1>\n<H2>The request could not be satisfied.</H2>\n<HR noshade size=\"1px\">\nThis distribution is not configured to allow the HTTP request method that was used for this request. The distribution supports only cachable requests.\nWe can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.\n<BR clear=\"all\">\nIf you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.\n<BR clear=\"all\">\n<HR noshade size=\"1px\">\n<PRE>\nGenerated by cloudfront (CloudFront)\nRequest ID: ambQFhl2huRfX_TGe7dPkim-wQF9O-7tvjO7zJWDfCYYacSggmR8iw==\n</PRE>\n<ADDRESS>\n</ADDRESS>\n</BODY></HTML>","status":403,"timestamp":"2023-03-20T08:22:15.260Z","url":"https://index.elrond.com/blocks/_search"}
0|api  | {"context":"NftQueueController:Process NFT 'SHARK-8c1c46-0113'","level":"info","message":"Completed Refreshing metadata for NFT with identifier. Old: '{\"description\":\"The toughest sharks in the universe, and the most imposing in the galaxy.\",\"dna\":\"55bce4bc11b07b47aa37c7b896807567f0032457\",\"attributes\":[{\"trait_type\":\"background\",\"value\":\"Green\"},{\"trait_type\":\"skin\",\"value\":\"Blue\"},{\"trait_type\":\"eyes\",\"value\":\"Yellow Lemon\"},{\"trait_type\":\"earrings\",\"value\":\"Double 24k Gold Earring\"},{\"trait_type\":\"tattoo\",\"value\":\"none\"},{\"trait_type\":\"clothing\",\"value\":\"None\"},{\"trait_type\":\"chains\",\"value\":\"None\"},{\"trait_type\":\"hats\",\"value\":\"Aquamantis Red Baseball Cap\"},{\"trait_type\":\"mouth\",\"value\":\"Sharpened Slime\"},{\"trait_type\":\"piercings\",\"value\":\"none\"},{\"trait_type\":\"hand items\",\"value\":\"none\"}],\"rarity\":{\"avgRarity\":0.370818,\"statRarity\":6.244430315e-10,\"rarityScore\":172.631086,\"rarityScoreNormed\":373.796235,\"usedTraitsCount\":11},\"compiler\":\"Trust Staking\"}', New: '{\"description\":\"The toughest sharks in the universe, and the most imposing in the galaxy.\",\"dna\":\"55bce4bc11b07b47aa37c7b896807567f0032457\",\"attributes\":[{\"trait_type\":\"background\",\"value\":\"Green\"},{\"trait_type\":\"skin\",\"value\":\"Blue\"},{\"trait_type\":\"eyes\",\"value\":\"Yellow Lemon\"},{\"trait_type\":\"earrings\",\"value\":\"Double 24k Gold Earring\"},{\"trait_type\":\"tattoo\",\"value\":\"none\"},{\"trait_type\":\"clothing\",\"value\":\"None\"},{\"trait_type\":\"chains\",\"value\":\"None\"},{\"trait_type\":\"hats\",\"value\":\"Aquamantis Red Baseball Cap\"},{\"trait_type\":\"mouth\",\"value\":\"Sharpened Slime\"},{\"trait_type\":\"piercings\",\"value\":\"none\"},{\"trait_type\":\"hand items\",\"value\":\"none\"}],\"rarity\":{\"avgRarity\":0.370818,\"statRarity\":6.244430315e-10,\"rarityScore\":172.631086,\"rarityScoreNormed\":373.796235,\"usedTraitsCount\":11},\"compiler\":\"Trust Staking\"}'","timestamp":"2023-03-20T09:13:00.773Z"}
0|api  | {"context":"NftQueueController:Process NFT 'SHARK-8c1c46-0113'","level":"error","message":"Unexpected error when processing NFT with identifier 'SHARK-8c1c46-0113'","stack":["Error: \n    at OriginLogger.error (/opt/rockx/mx-api-service-1.0.3-hf2/node_modules/@multiversx/sdk-nestjs/src/utils/origin.logger.ts:29:68)\n    at NftQueueController.onNftCreated (/opt/rockx/mx-api-service-1.0.3-hf2/src/queue.worker/nft.worker/queue/nft.queue.controller.ts:146:19)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n    at /opt/rockx/mx-api-service-1.0.3-hf2/node_modules/@nestjs/microservices/context/rpc-proxy.js:11:32\n    at ServerRMQ.handleMessage (/opt/rockx/mx-api-service-1.0.3-hf2/node_modules/@nestjs/microservices/server/server-rmq.js:127:54)"],"timestamp":"2023-03-20T09:13:00.774Z"}
0|api  | {"context":"NftQueueController:Process NFT 'SHARK-8c1c46-0113'","level":"error","message":"nft.media.filter is not a function","stack":["TypeError: nft.media.filter is not a function\n    at NftQueueController.onNftCreated (/opt/rockx/mx-api-service-1.0.3-hf2/src/queue.worker/nft.worker/queue/nft.queue.controller.ts:137:38)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n    at /opt/rockx/mx-api-service-1.0.3-hf2/node_modules/@nestjs/microservices/context/rpc-proxy.js:11:32\n    at ServerRMQ.handleMessage (/opt/rockx/mx-api-service-1.0.3-hf2/node_modules/@nestjs/microservices/server/server-rmq.js:127:54)"],"timestamp":"2023-03-20T09:13:00.775Z"}

Code of Conduct

tanghel commented 1 year ago

Hello!

This issue should be fixed if you change the config value for urls.elastic to https://index.multiversx.com

This is probably an issue with redirecting requests from .elrond.com domains to .multiversx.com domains, and we strongly advise to use the .multiversx.com domains for all urls. The same applies to gateway and others as well.

Thank you!