helium / helium-wallet-rs

Rust implementation of a helium wallet CLI
Apache License 2.0
258 stars 114 forks source link

Error Code: AccountNotInitialized. Error Number: 3012. Error Message: The program expected this account to be already initialized. #366

Closed kelleygo closed 4 months ago

kelleygo commented 5 months ago

helium-wallet hotspots update --commit --lat=36.093--lon=-96.0685--elevation=15 --gain=1.5 iot 14kedPQtBpcwqcYfoz2789TVLwor9LCFrn1Dug9BHMnWwnt8ZK7 Wallet Password: [hidden] { "error": "[\"Program ComputeBudget111111111111111111111111111111 invoke [1]\",\"Program ComputeBudget111111111111111111111111111111 success\",\"Program ComputeBudget111111111111111111111111111111 invoke [1]\",\"Program ComputeBudget111111111111111111111111111111 success\",\"Program hemjuPXBpNvggtaUnN1MwT3wrdhttKEfosTcc2P9Pg8 invoke [1]\",\"Program log: Instruction: UpdateIotInfoV0\",\"Program log: AnchorError caused by account: iot_info. Error Code: AccountNotInitialized. Error Number: 3012. Error Message: The program expected this account to be already initialized.\",\"Program hemjuPXBpNvggtaUnN1MwT3wrdhttKEfosTcc2P9Pg8 consumed 7804 of 199700 compute units\",\"Program hemjuPXBpNvggtaUnN1MwT3wrdhttKEfosTcc2P9Pg8 failed: custom program error: 0xbc4\"]", "result": "error" }

helium-wallet --version helium-wallet 2.0.0-rc.7

One of my new hotspot APP operations entered the link and skipped positioning. The positioning failed in the wallet command line. Please help solve this problem. The error is as above. Thank you.

kelleygo commented 5 months ago

There is also an error when executing on the command line: helium-wallet hotspots list Error: decode: decode: no entity key found

Caused by: decode: no entity key found

madninja commented 5 months ago

This looks like either the hotspot or the wallet is not actually on chain. It's likely related to the same error in your other filed bug.. what is the hotspot key 14kedPQtBpcwqcYfoz2789TVLwor9LCFrn1Dug9BHMnWwnt8ZK7? is that a solana addresss of a hotspot key?

kelleygo commented 5 months ago

Yes, this is the hotspot key 14kedPQtBpcwqcYfoz2789TVLwor9LCFrn1Dug9BHMnWwnt8ZK7,Using the command line helium-wallet hotspots update fails to locate successfully

kelleygo commented 5 months ago

I guarantee that there is no problem with this hotspot. It has been connected to the link on the maker APP, but no positioning operation has been performed. I hope to locate it through the command line, because this can be accurate to the longitude and latitude.

madninja commented 5 months ago

This works for me:

$ helium-wallet  hotspots info 14kedPQtBpcwqcYfoz2789TVLwor9LCFrn1Dug9BHMnWwnt8ZK7
{
  "key": "14kedPQtBpcwqcYfoz2789TVLwor9LCFrn1Dug9BHMnWwnt8ZK7",
  "name": "virtual-fiery-goldfish",
  "owner": "51CNfV6UowLL3ARXCeu3nc65F4S9xsCWgmSvM4PWvgLB",
  "info": {
    "iot": {
      "asset": "BgEupSxzR7AcAhSGyHYEUAv5fmGLc5omywC6EYmrF3k1",
      "mode": "full",
      "gain": 1.2,
      "elevation": 15,
      "location": "8c64a46060711ff",
      "geo": {
        "lat": 14.582734638118804,
        "lng": 100.45070281938267
      },
      "location_asserts": 1
    }
  }
}
madninja commented 5 months ago

Are you sure your wallet you are paying the update with there is actually on chain and initialized with some SOL?

madninja commented 5 months ago

There is also an error when executing on the command line: helium-wallet hotspots list Error: decode: decode: no entity key found

Caused by: decode: no entity key found

Please submit this as a separate issue.. mixing issues is confusing

kelleygo commented 5 months ago

The changed hotspot has been located through the wallet on the mobile phone, so it is valid. After entering the onboarding and before locating, the command line input is invalid. Error: helium-wallet hotspots info 14kedPQtBpcwqcYfoz2789TVLwor9LCFrn1Dug9BHMnWwnt8ZK7 Error: decode: decode: no entity key found

Caused by: decode: no entity key found

But now this device can no longer have this error, unless it is a new device, I guarantee that it can be reproduced

kelleygo commented 5 months ago

Using a command line wallet is convenient, but it doesn’t work properly

madninja commented 5 months ago

The changed hotspot has been located through the wallet on the mobile phone, so it is valid. After entering the onboarding and before locating, the command line input is invalid. Error: helium-wallet hotspots info 14kedPQtBpcwqcYfoz2789TVLwor9LCFrn1Dug9BHMnWwnt8ZK7 Error: decode: decode: no entity key found

Caused by: decode: no entity key found

But now this device can no longer have this error, unless it is a new device, I guarantee that it can be reproduced

That’s likely a bug yes but it’s not the one you reported for this issue. I’m asking if you can create separate issues for different bugs

madninja commented 5 months ago

Using a command line wallet is convenient, but it doesn’t work properly

i agree but as mentioned clear separate issues would help!

kelleygo commented 5 months ago

I understand what you said helium-wallet hotspots list and helium-wallet hotspots update --commit --lat=36.093--lon=-96.0685--elevation=15 --gain=1.5 iot 14kedPQtBpcwqcYfoz2789TVLwor9LCFrn1Dug9BHMnWwnt8ZK7 are two problems, then my most I hope that the priority is to solve the positioning problem. Return to the problem itself: Error Code: AccountNotInitialized. Error Number: 3012. Do you need me to provide any other information?

madninja commented 5 months ago

I understand what you said helium-wallet hotspots list and helium-wallet hotspots update --commit --lat=36.093--lon=-96.0685--elevation=15 --gain=1.5 iot 14kedPQtBpcwqcYfoz2789TVLwor9LCFrn1Dug9BHMnWwnt8ZK7 are two problems, then my most I hope that the priority is to solve the positioning problem. Return to the problem itself: Error Code: AccountNotInitialized. Error Number: 3012. Do you need me to provide any other information?

Just to clarify, that error occured after the hotspot was onboarded but before it was asserted? Or does it happen every time you try to assert a new location/gain for that hotspot?

kelleygo commented 5 months ago

Regarding the need for SOL, this is my first time positioning this device. What I understand is that it does not require SOL. I also have 0.001385SOL in my wallet. My wallet address: 51CNfV6UowLL3ARXCeu3nc65F4S9xsCWgmSvM4PWvgLB

madninja commented 5 months ago

All transactions require SOL to pay for transaction fees beyond the location update cost itself.. and that 0.001 SOL is not enough to create the account/address used to store the lat/lon for that hotspot

kelleygo commented 5 months ago

Error Code: AccountNotInitialized. Error Number: 3012. This error does not seem to indicate insufficient SOL transaction fees. It occurs after the hotspot was onboarded but before it was asserted

madninja commented 5 months ago

Error Code: AccountNotInitialized. Error Number: 3012. This error does not seem to indicate insufficient SOL transaction fees. It occurs after the hotspot was onboarded but before it was asserted

Errors are very obscure on Solana as to what caused them.. I'll try to reproduce this but I can tell you your transaction would have failed because of not enough SOL.

kelleygo commented 5 months ago

Yes, I get this error every time I try, It occurs after the hotspot was onboarded but before it was asserted

madninja commented 5 months ago

And you initially onboarded it with what maker app? because it's odd that it onboarded this hotspot without a location/gain

kelleygo commented 5 months ago

I am using RisingHF app, version: v2.0.4, the download address is as follows https://risinghf-resource.oss-cn-shenzhen.aliyuncs.com/app/RisingHF%20Hotspots%20v2.0.4.apk

kelleygo commented 5 months ago

Hello, has the phenomenon recurred? In order to solve the problem, I will be happy to provide you with other helpful information, if you need it.

kelleygo commented 5 months ago

I would like to add that my wallet command line operating environment is a Docker container cat /etc/os-release PRETTY_NAME="Ubuntu Jammy Jellyfish (development branch)" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04 (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy

madninja commented 5 months ago

Unfortunately I don't have a full hotspot that has this issue. I've retried this with a dataonly hotspot, but it does not exhibit the problem you describe

kelleygo commented 5 months ago

I recently tried to repeat this problem with a new device, please pay attention!

madninja commented 5 months ago

I recently tried to repeat this problem with a new device, please pay attention!

I'm not sure I understand what you are saying.. How to pay attention to or debug a hotspot onboarding I don't control?

madninja commented 4 months ago

This should be fixed with #373