GenesysGo / shadow-drive

Apache License 2.0
71 stars 22 forks source link

Can't Upload a File via both CLI and SDK #16

Closed saito-kosuke closed 2 years ago

saito-kosuke commented 2 years ago

Current Behavior When executing the following command, shdw-drive upload-file --keypair ~/.config/solana/id.json --file ./assets/0.png the following output shows.

This is beta software. Use at your own discretion.
✔ Which storage account do you want to use? › SAITO test - 2Rq...MxJ - 9.81 MB remaining
✖ Error processing transaction. See below for details:
Server response status code: 400
Server response status message: Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x1

The same goes for SDK.

Expected Behavior

  1. The error message is not appropriate. The status code 400 is used as "Not Found Error" in general, but some transactions have failed actually.
  2. Fix the problem to upload a file.
tracy-codes commented 2 years ago

0x1 error means your wallet is not funded with enough SOL to make the transaction happen.

Along with that, 400 error is not a not found, it means "bad request" in general. We could swap it out for 500 if that's more ideal.

saito-kosuke commented 2 years ago

@tracy-codes

Along with that, 400 error is not a not found, it means "bad request" in general.

I misunderstood, I'm sorry. You're right.

0x1 error means your wallet is not funded with enough SOL to make the transaction happen.

Thank you for your information. In my opinion, I'd like you to make even only error codes of your rust part be public to streamline the process for your team to answer questions like mine.

tracy-codes commented 2 years ago

0x1 is a Solana error code, it's not specific to our program.

https://stackoverflow.com/questions/68450242/i-want-to-know-causing-a-solana-transfer-error

saito-kosuke commented 2 years ago

@tracy-codes Thank you for taking your time. Noted. Can I give you other feedback?

Sometimes the error as follows occurs, but I can't see the error message.

Server response status code: 400 
Server response status message: "[object Object]"
tracy-codes commented 2 years ago

Our next release will resolve this.

saito-kosuke commented 2 years ago

I'm developing the integration with the Metaplex candy machine v2. I will try your next release, so I close the issue.