bnb-chain/greenfield

Upload file to my SP failed

goomario opened this issue · 13 comments

Hi team. Please help us check out how to proceed next.

  • What we wanted:
    upload file to SP via gnfd-cmd (v0.0.8)

  • Result:
    failed, multiple attempts

  • What we have checked:
    used following codes

> gnfd-cmd object put ./helloh9.txt gnfd://felixtest1/test5.txt
create object test5.txt on chain finish, txn Hash: 225BC73D1B1D7E1008E6D3E4443AFC817EFF3035A58144E191BE03FA1ED706B6
{"level":"error","time":"2023-07-11T19:35:16+08:00","message":"do API error, url: https://felixtest1.gnfd-sp-testnet.hashcell.link/test5.txt?upload-progress=, err: statusCode 500 : code : 95202  request-id  (Message: server slipped away, try again later)"}

Log:
"caller":"p2p/p2p_task.go:39","msg":"failed to get sufficient approvals as secondary sp","task_key":"ReplicatePieceApproval-bucket:felixtest1-object:test5.txt-id:296261","accept":0,"min":6,"max":6}

The file has been uploaded to S3 and can be viewed in the background of AWS.

Please assist:

  1. Did we miss out on the config?
  2. Or shall we be added to your whitelist manually on your end?

Thanks!

Hi there, It seems like your transaction has went through and successful: https://greenfieldscan.com/tx/0x225bc73d1b1d7e1008e6d3e4443afc817eff3035a58144e191be03fa1ed706b6.

Can you provide more logs of the error and When did you get this error and logs?

Also, Can you try adding --contentType "text/xml" in your gnfd-cmd` run command. (You can refer this: https://docs.bnbchain.org/greenfield-docs/docs/guide/getting-started/interact-with-greenfield#uploaddownload-files)

-> gnfd-cmd object put --contentType "text/xml" ./helloh9.txt gnfd://felixtest1/test6.txt

create object test6.txt on chain finish, txn Hash: 56E5251D48618B0507F7D31288AFA1A0E28423187C12356E442D5C38A7307557
{"level":"error","time":"2023-07-12T00:18:07+08:00","message":"do API error, url: https://felixtest1.gnfd-sp-testnet.hashcell.link/test6.txt?upload-progress=, err: statusCode 500 : code : 95202  request-id  (Message: server slipped away, try again later)"}
run command error: object not sealed after 15 seconds

The gnfd-sp full logs please see gnfd-sp.log.

And yes, the transaction has been successful, and the file has been uploaded to S3, but it has been in the created state and has not been sealed. I compare with other, it seems that "Secondary SP Addresses" is empty.

There is no problem when I upload the file to the bucket of other SP, so it seems that the problem is on my SP. And the upload also failed on dceller.io.

> gnfd-cmd object put ./helloh9.txt gnfd://testbucket/test0.txt
create object test0.txt on chain finish, txn Hash: 843E02A371C5E5A81CF7EF9CB32B9B0ECCE1F81ABFFED7B714DD2070CA722C7B
{"level":"error","time":"2023-07-12T00:29:35+08:00","message":"do API error, url: https://testbucket.gnfd-testnet-sp-2.bnbchain.org/test0.txt?upload-progress=, err: statusCode 500 : code : 95202  request-id  (Message: server slipped away, try again later)"}
put object test0.txt successfully

I tried with the same sp you tried and another one as well:

Let me check this out with the team internally and we will get back to you.

sysvm commented

@goomario Does this upload in testnet? According to your log, there is something wrong in your p2p module. You certainly upload file successfully, but the object is not sealed by chain.

"caller":"p2p/p2p_task.go:39","msg":"failed to get sufficient approvals as secondary sp","task_key":"ReplicatePieceApproval-bucket:felixtest1-object:test5.txt-id:296261","accept":0,"min":6,"max":6}
the log indicates that you should accept 6 approvals, but in fact got 0. Therefore, you can check your p2p config and then restart the p2p.

@goomario Does this upload in testnet? According to your log, there is something wrong in your p2p module. You certainly upload file successfully, but the object is not sealed by chain.

"caller":"p2p/p2p_task.go:39","msg":"failed to get sufficient approvals as secondary sp","task_key":"ReplicatePieceApproval-bucket:felixtest1-object:test5.txt-id:296261","accept":0,"min":6,"max":6} the log indicates that you should accept 6 approvals, but in fact got 0. Therefore, you can check your p2p config and then restart the p2p.

Yes, It's testnet. This is my config.toml. Sensitive information has been removed.

sysvm commented

P2PBootstrap should use LB domain name or public network ip . If you use LB domain name, this also should be set in P2PAntAddress.

P2PAntAddress is your load balance address. If you don't have a load balance address, you should have a public IP and use it in P2PAddress.

P2PBootstrap consists of [node_id1@ip1:port1, node_id2@ip1:port2], you can use P2PAntAddress or P2PAddress as ip:port.

P2PBootstrap should use LB domain name or public network ip . If you use LB domain name, this also should be set in P2PAntAddress.

P2PAntAddress is your load balance address. If you don't have a load balance address, you should have a public IP and use it in P2PAddress.

P2PBootstrap consists of [node_id1@ip1:port1, node_id2@ip1:port2], you can use P2PAntAddress or P2PAddress as ip:port.

I am not using LB. My current configuration is:

[P2P]
P2PPrivateKey = 'xxxx'
P2PAddress = '0.0.0.0:9933'
P2PAntAddress = ''
P2PBootstrap = ['16Uiu2HAmNvQufZvJ7Fr2aCXtch2JZfV2aWUrXTBWdrneL5PstJZK@my-public-IP:9933']

Do you mean that P2PAddress should use my-public-IP:9933?

When I output n.node.Peerstore().PeersWithAddrs() in the log, I see that there is only one of my nodes, so didn't broadcast to other nodes by n.broadcast(ctx, GetApprovalRequest, task.(*gfsptask.GfSpReplicatePieceApprovalTask)).

Does the P2PBootstrap in the configuration file need to add other SP Nodes?

sysvm commented

P2PBootstrap should use node_id@public-ip

P2PBootstrap should use LB domain name or public network ip . If you use LB domain name, this also should be set in P2PAntAddress.
P2PAntAddress is your load balance address. If you don't have a load balance address, you should have a public IP and use it in P2PAddress.
P2PBootstrap consists of [node_id1@ip1:port1, node_id2@ip1:port2], you can use P2PAntAddress or P2PAddress as ip:port.

I am not using LB. My current configuration is:

[P2P]
P2PPrivateKey = 'xxxx'
P2PAddress = '0.0.0.0:9933'
P2PAntAddress = ''
P2PBootstrap = ['16Uiu2HAmNvQufZvJ7Fr2aCXtch2JZfV2aWUrXTBWdrneL5PstJZK@my-public-IP:9933']

Do you mean that P2PAddress should use my-public-IP:9933?

yes

sysvm commented

When I output n.node.Peerstore().PeersWithAddrs() in the log, I see that there is only one of my nodes, so didn't broadcast to other nodes by n.broadcast(ctx, GetApprovalRequest, task.(*gfsptask.GfSpReplicatePieceApprovalTask)).

Does the P2PBootstrap in the configuration file need to add other SP Nodes?

can you please provide some logs?

@sysvm Wooooooo, I append other peer 16Uiu2HAkvgrSt4oUNZ8rWe2qpimLDajxxxxxxxxxxx@k8s-gftestne-p2pexter-bc25ac70bc-xxxxxxxxxxx.elb.us-east-1.amazonaws.com:9933 to my P2PBootstrap list, it's work fine!!! So is it because of the lack of other SP nodes as seed nodes that caused the problems I encountered?

sysvm commented

@goomario In general, P2PBootstrap should use your own nodeID and load balance.