hashlips-lab / safe-nft-metadata-provider

A safe metadata provider for your NFT collection.
MIT License
74 stars 77 forks source link

500 Internal Server Error #24

Closed vd4663rv closed 2 years ago

vd4663rv commented 2 years ago

I am getting this error. I have deployed this exactly how the video shows and I think may be an issue with the app connecting with spaces. I have verified all files are in Spaces and I can connect through cyberduck. With that being said, I also checked the 16 variables and verify S3_FS_DRIVER_BUCKET_NAME field. Before I had just the name. This time, I tried with a / following the bucket name. That didn't work either.

[metadata-provider] [2022-02-20 22:09:51] DOCUMENT_ROOT changed to 'public/' [metadata-provider] [2022-02-20 22:09:51] Assuming 512MB of RAM [metadata-provider] [2022-02-20 22:09:51] PHP memory_limit is 128M Bytes [metadata-provider] [2022-02-20 22:09:52] Starting php-fpm with 4 workers... [metadata-provider] [2022-02-20 22:09:53] Starting httpd... [metadata-provider] [2022-02-20 22:09:54] Application ready for connections on port 8080. [metadata-provider] [2022-02-20 22:10:48] - - [20/Feb/2022:22:10:47 +0000] "-" 408 - "-" "- [metadata-provider] [2022-02-20 22:10:58] - - [20/Feb/2022:22:10:57 +0000] "-" 408 - "-" "- [metadata-provider] [2022-02-20 22:11:08] - - [20/Feb/2022:22:11:07 +0000] "-" 408 - "-" "- [metadata-provider] [2022-02-20 22:11:18] - - [20/Feb/2022:22:11:17 +0000] "-" 408 - "-" "- [metadata-provider] [2022-02-20 22:11:28] - - [20/Feb/2022:22:11:27 +0000] "-" 408 - "-" "- [metadata-provider] [2022-02-20 22:11:31] {"message":"Matched route \"root\".","context":{"route":"root","route_parameters":{"_route":"root","_controller":"App\Controller\RootController"},"request_uri":"http://MYURI.ondigitalocean.app/","method":"GET"},"level":200,"level_name":"INFO","channel":"request","datetime":"2022-02-20T22:11:30.789357+00:00","extra":{}} [metadata-provider] [2022-02-20 22:11:31] {"message":"Checking for authenticator support.","context":{"firewall_name":"main","authenticators":0},"level":100,"level_name":"DEBUG","channel":"security","datetime":"2022-02-20T22:11:30.860677+00:00","extra":{}} [metadata-provider] [2022-02-20 22:11:31] {"message":"Deprecated: Implicit conversion from float 86980.96499999508 to int loses precision","context":{"exception":{"class":"ErrorException","message":"Deprecated: Implicit conversion from float 86980.96499999508 to int loses precision","code":0,"file":"/workspace/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:143"}},"level":200,"level_name":"INFO","channel":"php","datetime":"2022-02-20T22:11:31.041866+00:00","extra":{}} [metadata-provider] [2022-02-20 22:11:31] {"message":"Deprecated: Implicit conversion from float 178986.78900000674 to int loses precision","context":{"exception":{"class":"ErrorException","message":"Deprecated: Implicit conversion from float 178986.78900000674 to int loses precision","code":0,"file":"/workspace/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:143"}},"level":200,"level_name":"INFO","channel":"php","datetime":"2022-02-20T22:11:31.139344+00:00","extra":{}} [metadata-provider] [2022-02-20 22:11:31] {"message":"Uncaught PHP Exception Aws\S3\Exception\S3Exception: \"Error executing \"GetObject\" on \"[BUCKET]%2F/abi.json\"; AWS HTTP error: cURL error 6: Could not resolve host: [bucket]%2F (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)\" at /workspace/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php line 195","context":{"exception":{"class":"Aws\S3\Exception\S3Exception","message":"Error executing \"GetObject\" on \"[bucket]%2F/abi.json\"; AWS HTTP error: cURL error 6: Could not resolve host: [bucket]%2F (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)","code":0,"file":"/workspace/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:195","previous":{"class":"GuzzleHttp\\Exception\\ConnectException","message":"cURL error 6: Could not resolve host: [bucket]%2F (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)","code":0,"file":"/workspace/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:200"}}},"level":500,"level_name":"CRITICAL","channel":"request","datetime":"2022-02-20T22:11:31.330508+00:00","extra":{}} [metadata-provider] [2022-02-20 22:11:32] - - [20/Feb/2022:22:11:30 +0000] "GET / HTTP/1.1" 500 831 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36 [metadata-provider] [2022-02-20 22:11:38] - - [20/Feb/2022:22:11:37 +0000] "-" 408 - "-" "-

liarco commented 2 years ago

Hi @alcivarv, I'm sorry but the given logs make me think that this might be a configuration issue.

Here is a checklist so you can try troubleshooting:

  1. is the web3 endpoint pointing to the right network? pay attention to choose the right network from the dropdown, if you use the wrong one (Mainnet or Rinkeby) then Infura might send bad responses leading to (apparently) incomprehensible errors
  2. please double check your API keys set inside the ENV vars, swapping them is a common mistake
  3. the bucket name must be set as a plain name (e.g. for an endpoint like https://my-own-bucket.fra1.digitaloceanspaces.com the bucket name would be my-own-bucket)
  4. verify the abi.json file. That file should contain valid JSON content taken directly from Etherscan
  5. please double check your spelling for each folder name, they should be assets, hidden and metadata

I hope this can help you, if not please try providing further information.

vd4663rv commented 2 years ago

hey there. I was able to find out what the issue was.

I had for my bucket endpoint: fra1.digitaloceanspaces.com

It should be with https://: https://fra1.digitaloceanspaces.com

This resolved the issues and was able to get it to work. Thanks so much for the amazing work you and hashlips put together!

liarco commented 2 years ago

Thank you for taking time to share the solution here, this might be useful to other users facing the same issue!