sourcify icon indicating copy to clipboard operation
sourcify copied to clipboard

502 Bad Gateway Error while verifying with API

Open FreezyEx opened this issue 2 years ago • 11 comments

I am trying to verify a contract on BSC Testnet using the api /verify.

This is my POST request: image

and this is the response: image

FreezyEx avatar Jun 28 '22 20:06 FreezyEx

Hi I wasn't able to reproduce this. Do you still have the issue? I think it was a server hiccup

kuzdogan avatar Jun 28 '22 21:06 kuzdogan

I just tried another time and still same error. Can you please show how you did it? Maybe I am missing something

FreezyEx avatar Jun 29 '22 08:06 FreezyEx

This works for me. I can't see any errors anywhere as well.

image 1_Storage (copy).sol.txt metadata (copy).json.txt

Address: 0x656d0062eC89c940213E3F3170EA8b2add1c0143 Chain: 100

Can you maybe share yours?

kuzdogan avatar Jun 29 '22 08:06 kuzdogan

These are my data:

address: 0x0CD754172CE3DE9396f44d4c0e4C4e52f864E7c8 chain: 97 chosenContract: 15

File: (of course it should be in json but can't upload json here) 701188607f1134607a280fe25617dcc0.txt

FreezyEx avatar Jun 29 '22 08:06 FreezyEx

Ok yes it's crashing when it tries add it to IPFS. Looking into it. Thanks

kuzdogan avatar Jun 29 '22 09:06 kuzdogan

Hi again. I kind of figured out where the problem is but wasn't able to reproduce it locally to debug further. Do you happen to have the same issue with another contract?

kuzdogan avatar Jul 06 '22 15:07 kuzdogan

Hi again. I kind of figured out where the problem is but wasn't able to reproduce it locally to debug further. Do you happen to have the same issue with another contract?

Ok I will try with another contract and get back to you

FreezyEx avatar Jul 08 '22 07:07 FreezyEx

0x656d0062eC89c940213E3F3170EA8b2add1c0143

I tried with a smaller code and worked. With the old one I am getting Time Out now. Btw can you confirm I won't see the verificated source on bscscan?

FreezyEx avatar Jul 09 '22 14:07 FreezyEx

It seems to be a rare thing and happens with relatively large contracts with many files. It tries to add the metadata file to IPFS before the file was written on the disk but this actually should be executed in the order. For some reason it does not wait for the synchronous file write.

I removed the contract from the repository and it is still not getting verified. Will try to look deeper this week.

kuzdogan avatar Jul 11 '22 09:07 kuzdogan

Documenting other contracts that had the same issue (no metadata.json and ENOENT file not found crash):

- partial_match/4/0x430968AB0fbA6c5097c430A51f59CA35d018B5e0/metadata.json'
- partial_match/421611/0xfc9ffA88a07da8AfB2820c0aCA2A0c67f45Ceb17/metadata.json
- partial_match/4/0xff7cE5dfb715049ab57Bad08338C5848981210bB/metadata.json
- partial_match/4/0x5eF903387Af0fF26215a934D2B21E4204939f619/metadata.json
- partial_match/42220/0xC96c78E46169cB854Dc793437A105F46F2435455/metadata.json
- partial_match/4/0xD1D32aa94409E59439364de781b6433Cf540706d/metadata.json

kuzdogan avatar Jul 15 '22 12:07 kuzdogan

Should be fixed with https://github.com/ethereum/sourcify/commit/ffcd5e0a2e25b1c223a3d98178c6e5c3c163aad4

can you try on https://staging.sourcify.dev it is not pushed to production yet

kuzdogan avatar Aug 04 '22 18:08 kuzdogan

Merged to production with https://github.com/ethereum/sourcify/pull/775 Closing

kuzdogan avatar Aug 11 '22 16:08 kuzdogan

Nice to know. I will check as soon I can

Il Gio 4 Ago 2022, 20:49 Kaan Uzdoğan @.***> ha scritto:

Should be fixed with ffcd5e0 https://github.com/ethereum/sourcify/commit/ffcd5e0a2e25b1c223a3d98178c6e5c3c163aad4

can you try on https://staging.sourcify.dev it is not pushed to production yet

— Reply to this email directly, view it on GitHub https://github.com/ethereum/sourcify/issues/763#issuecomment-1205647783, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSF6VQEEUZOUU6QU24XXYDVXQGDDANCNFSM52DMMWVQ . You are receiving this because you authored the thread.Message ID: @.***>

FreezyEx avatar Oct 11 '22 07:10 FreezyEx