I got the early access for Stratus feature for my account and I have installed the Beta SDK in my catalyst Node Advanced I/O function and initialized the Stratus Beta SDK using the below code snippet as mentioned in the official help documentation here
const bucketInstance = await stratusInstance.bucket("mybucket");
const bucketDetails = await bucketInstance.getDetails();
But when I try to run the function in my local machine using the Catalyst CLI command catalyst serve, I am getting the below error
Error in getting bucket details: {statusCode: 401, code: 'OAUTH_SCOPE_MISMATCH', message: 'invalid oauth scope to access this URL'}
I got the early access for Stratus feature for my account and I have installed the Beta SDK in my catalyst Node Advanced I/O function and initialized the Stratus Beta SDK using the below code snippet as mentioned in the official help documentation here
const bucketInstance = await stratusInstance.bucket("mybucket");
const bucketDetails = await bucketInstance.getDetails();
But when I try to run the function in my local machine using the Catalyst CLI command catalyst serve, I am getting the below error
Share Improve this question asked Jan 21 at 11:20 Vasanth KumarVasanth Kumar 1225 bronze badges 1Error in getting bucket details: {statusCode: 401, code: 'OAUTH_SCOPE_MISMATCH', message: 'invalid oauth scope to access this URL'}
- Sounds like you failed to grant the permission(s) required by the endpoint in question beforehand ...? – C3roe Commented Jan 21 at 11:26
1 Answer
Reset to default 1The error OAUTH_SCOPE_MISMATCH indicates that the access token used for accessing Stratus from your function SDK doesn't have correct scopes related to Catalyst Stratus. Since you are testing the function in your local environment using Catalyst CLI, you would have received the necessary scopes during login which didn't include Stratus related scopes.
To resolve this issue, you can try relogging into your Catalyst CLI after updating your CLI using the below command
npm install -g zcatalyst-cli@beta
Once you have updated the CLI, you can relogin to your catalyst account using the below command where you should see the Stratus related scopes in the login URL.
catalyst login --force
Once logged in, you should be able to test your function successfully