Why do I get a "0x1004" when trying to deploy my solana anchor IDL? - solana

When I try to deploy an IDL with anchor, I get a cryptic "Custom Error 0x1004" message. What does this mean:?
$ anchor idl init --provider.cluster testnet --filepath ./target/idl/myprogram.json sa3BafcCxwD6G3tUbvTcvnCD28sCXhpasauLtpw9HdA
Error: Error processing Instruction 0: custom program error: 0x1004

0x1004 is hexadecimal for 4100, or the DeclaredProgramIdMismatch error.
So somewhere in your program, you're declaring a different program id than the one you deployed with:
declare_id!("some_other_program_id"); // this is not your program id!

Related

Parse error: Failed parsing args: missing field > account_id" on NEAR dApp

I deployed the contract on another computer and it worked, and now on a new envirenment and account the NEAR dApp is failing; here is the code:
https://github.com/bobmakesmagics/Multi-Near-NFT-Minter
// Get blockchian state once on component load and wallet is connected:f
nft.nftSupply(wallet.accountId)
.then(setTotalSupply)
.catch(console)
Error: [-32700] Parse error: Failed parsing args: missing field
account_id"
before I make the RPC call I actually console.log the args.. and there you see the account_id not missing... so what's the problem?

`Invalid blockhash` error while deploying smart contract

I am trying to deploy the demo smart contract on solana for chainlink price feed but getting an error. I followed all the steps from https://docs.chain.link/docs/solana/using-data-feeds-solana/
$ anchor deploy --provider.wallet ./id.json --provider.cluster devnet
Deploying workspace: https://api.devnet.solana.com
Upgrade authority: ./id.json
Deploying program "chainlink_solana_demo"...
Program path: /home/test/solana-starter-kit/target/deploy/chainlink_solana_demo.so...
=============================================================================
Recover the intermediate account's ephemeral keypair file with
`solana-keygen recover` and the following 12-word seed phrase:
=============================================================================
until reason almost can clean wish trend buffalo future auto artefact balcony
=============================================================================
To resume a deploy, pass the recovered keypair as the
[BUFFER_SIGNER] to `solana program deploy` or `solana write-buffer'.
Or to recover the account's lamports, pass it as the
[BUFFER_ACCOUNT_ADDRESS] argument to `solana program close`.
=============================================================================
Error: Custom: Invalid blockhash
There was a problem deploying: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "" }.
This is just a timeout error message. It happens from time to time depending on the network availability
Follow these steps and run again. I've also found that you'll want quite a bit more sol in your wallet than you think you need.
To resume a deploy, pass the recovered keypair as the
[BUFFER_SIGNER] to `solana program deploy` or `solana write-buffer'.
Or to recover the account's lamports, pass it as the
[BUFFER_ACCOUNT_ADDRESS] argument to `solana program close`.

There is no .trace file found for performance profile ‘Leaks’

Following this example and using Javascript, get the following error when run my tests. The error is generated on the following command:
enter code heredriver.executeScript('mobile: stopPerfRecord', [
{ profileName: 'Leaks' },
]);
Error:
Got this error “Request failed with status 500 due to An unknown server-side error occurred while processing the command. Original error: There is no .trace file found for performance profile ‘Time Profiler’ and device XXXX. Make sure the selected profile is supported on this device”

Error: command "bash" failed with no error message?

I am using terraform on my Mac system, and terraform apply results with below error
Error: command "bash" failed with no error message
on ssm.tf line 7, in data "external" "ssm-dynamic-general":
7: data "external" "ssm-dynamic-general" {
However there is nothing wrong in ssm.tf file, same runs perfectly fine in my another system.
Can some one please let me know what i am missing here?
You might have done what I accidentally did: not follow the external program protocol:
https://www.terraform.io/docs/providers/external/data_source.html#external-program-protocol
In my particular case, I failed to send the errors that were coming from my program to standard error. Instead, those errors were going to standard out.
That's why Terraform wasn't able to report on those errors.
So if you send any and all errors from your program to standard error using > &2, you should be able to see those errors when you run terraform plan.

tensorflow_datasets.load() downloads but cannot extract certain datasets

Calling tensorflow_datasets.load('cycle_gan/apple2orange') works fine
but tensorflow_datasets.load('cycle_gan/vangogh2photo') gives me an error.
I've tried this on my desktop and laptop and both gave the same error message.
Here's the code I ran and the error message I got:
import tensorflow_datasets as tfds
dataset = tfds.load('cycle_gan/vangogh2photo',
data_dir='data', batch_size=1, download=True, in_memory=False)
InvalidArgumentError: Failed to create a NewWriteableFile: data\downloads\extracted\ZIP.peop.eecs.berk.edu_taes_park_Cycl_data_vanNiw0c-cL4JRL2gjUnWYOr9woVN9V1peDW4GG0decqv8.zip.incomplete_bf327518b23f41ee9a3a469cc0b541ba\vangogh2photo\testB\2014-12-10 12:08:40.jpg : The filename, directory name, or volume label syntax is incorrect.
; Unknown error
then it says
During handling of the above exception, another exception occurred:
(traceback)
ExtractError: Error while extracting data\downloads\peop.eecs.berk.edu_taes_park_Cycl_data_vanNiw0c-cL4JRL2gjUnWYOr9woVN9V1peDW4GG0decqv8.zip to data\downloads\extracted\ZIP.peop.eecs.berk.edu_taes_park_Cycl_data_vanNiw0c-cL4JRL2gjUnWYOr9woVN9V1peDW4GG0decqv8.zip : Failed to create a NewWriteableFile: data\downloads\extracted\ZIP.peop.eecs.berk.edu_taes_park_Cycl_data_vanNiw0c-cL4JRL2gjUnWYOr9woVN9V1peDW4GG0decqv8.zip.incomplete_bf327518b23f41ee9a3a469cc0b541ba\vangogh2photo\testB\2014-12-10 12:08:40.jpg : The filename, directory name, or volume label syntax is incorrect.
; Unknown error
How do I fix this?
Which OS are you using?
There is an issue with some datasets on Windows when composing the URLs to fetch the files or the URLs where to save them locally.
For the Oxford Pets III dataset, the link below provides the fix:
https://github.com/tensorflow/tensorflow/issues/31171#issuecomment-529169445
Perhaps something similar may apply here?

Resources