Gomeyy
Gomeyy13mo ago

OAuth Access Token does not renew automatically

I have a resource that refuses to renew its access token automatically, I am fetching it within a script using await wmill.getVariable('***') . The error I am getting in the script is as follows
ExecutionErr: ExitCode: 1, last log lines:
211 | const workspace = getWorkspace();
212 | try {
213 | return yield index_1.VariableService.getVariableValue({ workspace, path });
214 | }
215 | catch (e) {
216 | throw Error(`Variable not found at ${path} or not visible to you: ${e.body}`);
^
error: Variable not found at f/halopsa/token or not visible to you: Bad request: invalid client
at /tmp/windmill/cache/bun/windmill-client@1.224.1/dist/client.js:216:18
at rejected (/tmp/windmill/cache/bun/windmill-client@1.224.1/dist/client.js:6:46)
ExecutionErr: ExitCode: 1, last log lines:
211 | const workspace = getWorkspace();
212 | try {
213 | return yield index_1.VariableService.getVariableValue({ workspace, path });
214 | }
215 | catch (e) {
216 | throw Error(`Variable not found at ${path} or not visible to you: ${e.body}`);
^
error: Variable not found at f/halopsa/token or not visible to you: Bad request: invalid client
at /tmp/windmill/cache/bun/windmill-client@1.224.1/dist/client.js:216:18
at rejected (/tmp/windmill/cache/bun/windmill-client@1.224.1/dist/client.js:6:46)
This error goes away if I manually renew the access token using the dropdown, which renews with no issues. Am I doing something wrong? Any help would be greatly appreciated. Thank you
4 Replies
rubenf
rubenf13mo ago
How did you set oauths ? Are you using the old oauth.json ?
Gomeyy
GomeyyOP13mo ago
Yes I am
rubenf
rubenf13mo ago
Ok then you need to mount oauth.json on the workers too
Gomeyy
GomeyyOP13mo ago
Ahh okay, I will do that and get back to you That indeed was the issue, thank you

Did you find this page helpful?