Keep3r Autotask errored with "INVALID_ARGUMENT","reason":"invalid ENS name"

Hi @spalladino

Thanks for making this awesome guide (Running a keeper from Keep3r Network on Defender) and all the work in the back end to make the keep3r process so straight forward. I’ve read the guide and copied the code snippet exactly (without any editing) and put it in the autotask, what I got was the following error.

Message: Error running autotask: Unhandled

Logs: 2020-11-05T02:23:19.540Z	AUTOTASK START
2020-11-05T02:23:21.559Z	ERROR	Invoke Error 	{"errorType":"Error","errorMessage":"invalid ENS name (argument=\"name\", value=undefined, code=INVALID_ARGUMENT, version=providers/5.0.5)","code":"INVALID_ARGUMENT","reason":"invalid ENS name","argument":"name","stack":["Error: invalid ENS name (argument=\"name\", value=undefined, code=INVALID_ARGUMENT, version=providers/5.0.5)","    at Logger.makeError (/opt/nodejs/node_modules/@ethersproject/logger/lib/index.js:179:21)","    at Logger.throwError (/opt/nodejs/node_modules/@ethersproject/logger/lib/index.js:188:20)","    at Logger.throwArgumentError (/opt/nodejs/node_modules/@ethersproject/logger/lib/index.js:191:21)","    at FallbackProvider.<anonymous> (/opt/nodejs/node_modules/@ethersproject/providers/lib/base-provider.js:1340:36)","    at step (/opt/nodejs/node_modules/@ethersproject/providers/lib/base-provider.js:46:23)","    at Object.next (/opt/nodejs/node_modules/@ethersproject/providers/lib/base-provider.js:27:53)","    at fulfilled (/opt/nodejs/node_modules/@ethersproject/providers/lib/base-provider.js:18:58)"]}
2020-11-05T02:23:21.561Z	AUTOTASK COMPLETE

I didn’t see any part where I have to put in my infura project ID as provider, does that mean we don’t need to use infura anymore?

Would be great if you can help take a look please.Thanks

Moved from: Running a keeper from Keep3r Network on Defender

1 Like

Hi @AlvinP,

I am sorry that you had this issue.

As you copied the code snippet exactly from https://docs.openzeppelin.com/defender/guide-keep3r#create_an_autotask, I am not sure what is causing this, especially as there doesn’t appear to be any ENS usage in this Autotask.

1 Like

Thanks for your reply. After reading it, I created a new autotask and put the code in again and it worked!!! Previously, I just the code from the guide into an existing autotask I created a few days ago. I’m not sure how that is any different but I’m ecstatic that it worked.

2020-11-05T03:55:27.641Z	AUTOTASK START
2020-11-05T03:55:30.742Z	INFO	========= NOTICE =========
2020-11-05T03:55:30.742Z	INFO	Request-Rate Exceeded  (this message will not be repeated)
2020-11-05T03:55:30.742Z	INFO	
2020-11-05T03:55:30.742Z	INFO	The default API keys for each service are provided as a highly-throttled,
2020-11-05T03:55:30.742Z	INFO	community resource for low-traffic projects and early prototyping.
2020-11-05T03:55:30.742Z	INFO	
2020-11-05T03:55:30.743Z	INFO	While your application will continue to function, we highly recommended
2020-11-05T03:55:30.743Z	INFO	signing up for your own API keys to improve performance, increase your
2020-11-05T03:55:30.743Z	INFO	request rate/limit and enable other perks, such as metrics and advanced APIs.
2020-11-05T03:55:30.743Z	INFO	
2020-11-05T03:55:30.743Z	INFO	For more details: https://docs.ethers.io/api-keys/
2020-11-05T03:55:30.743Z	INFO	==========================
2020-11-05T03:55:34.916Z	INFO	Bonded relayer: 0x5030072fca3208f9a8e37bf2b58a89a376ce4020ac0a23ac154e3654ec4c0150
2020-11-05T03:55:34.918Z	AUTOTASK COMPLETE

So now I get this message about throttling. I’m not sure if it means my autotask will be throttled. How can keepers we get around the throttling issue?

Also noticed the bonded relayer address in the log doesn’t correspond to the address of the relayer I created. Is this to be expected?

1 Like

Hi @AlvinP,

Glad to hear your Autotask is up and running now!!

To keep things simple, the guide doesn’t mention Infura/Alchemy/Etherscan, as for most runs this should work without a specific API key for Infurat/Alchemy/Etherscan.

Coming up (from: Running a keeper from Keep3r Network on Defender)

  • Adding a custom Defender provider, so you don’t need to request an Alchemy, Infura, or Etherscan to prevent getting throttled when querying for jobs.

The Bonded relayer is the transaction hash. See this line in the Autotask:

console.log(`Bonded relayer: ${tx.hash}`);

So from your log you can view the transaction hash on Etherscan: https://etherscan.io/tx/0x5030072fca3208f9a8e37bf2b58a89a376ce4020ac0a23ac154e3654ec4c0150

Perhaps the name of this would be better as Bonded relayer transaction

2 Likes

Thanks again @abcoathup

I can appreciate how much work has been added under the hood to make this process so simple now. I looked up the tx hash and I can see my relayer address is now waiting to be activated, this is awesome! I’ve paused the autotask for now and will restart it in 3 days time to see how it actually performs.

Thanks for all the work you guys are doing behind the scenes, looking forward to the web-based management of tokens in the relayer as mentioned in the coming soon section. The ability to send K3PR, ETH or any other token out from the relayer will be most useful for people like me who don’t know how to do it with code.

On another note, I noticed the UniswapOracleV2 job has credits depleted, so will the autotask still attempt to do the job even when there is no reward available to distribute anymore? The job is still listed as active on the keep3r network. Maybe there are fractional KP3R left, which we can’t see as the UI only shows up to 2 decimals.

1 Like

Hi @AlvinP,

Thank you :pray:

I recommend creating a new topic per question, so that it is easier for the community to find answers (and also provide answers).

I created a new topic: Will the autotask still attempt to do the job even when there is no reward available to distribute anymore?

To expand on Andy’s answer on this: this message you see on request-rate exceeded is not generated by Defender Autotasks, but by ethers.js. ethers.js is the library the autotask code is using for connecting to the network, and by default it uses a set of shared keys for connecting to the network. You can read more about them here.

As Andy mentioned, we are working to provide access to the Ethereum network directly through Defender (when you are in the context of an Autotask) so you don’t have to face this problem. If you do want to solve this issue now, you can follow the instructions here supply your own API keys to ethers, but I would not recommend doing that unless you have some coding experience.

1 Like

A post was split to a new topic: How to use Infura API Project ID?