cml icon indicating copy to clipboard operation
cml copied to clipboard

token not found - cml send-comment

Open eb-art opened this issue 3 years ago • 6 comments

however I found some issue in "cml send-comment report.md" command, even report with one line has token not found error (using bitbucket):

{"level":"error","message":"token not found","stack":"Error: token not found\n at new BitbucketCloud (/usr/lib/node_modules/@dvcorg/cml/src/drivers/bitbucket_cloud.js:18:23)\n at getDriver (/usr/lib/node_modules/@dvcorg/cml/src/cml.js:88:29)\n at CML.triggerSha (/usr/lib/node_modules/@dvcorg/cml/src/cml.js:153:21)\n at CML.commentCreate (/usr/lib/node_modules/@dvcorg/cml/src/cml.js:163:35)\n at Object.exports.handler (/usr/lib/node_modules/@dvcorg/cml/bin/cml/send-comment.js:11:25)\n at /usr/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:8891\n at j (/usr/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:4956)\n at M.handleValidationAndGetResult (/usr/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:8860)\n at M.applyMiddlewareAndGetResult (/usr/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:9502)\n at M.runCommand (/usr/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:7231)"}

eb-art avatar Aug 03 '22 18:08 eb-art

Have you exposed an environment variables named REPO_TOKEN with a personal access token?

0x2b3bfa0 avatar Aug 03 '22 18:08 0x2b3bfa0

Do you have any example to use REPO_TOKEN in Bitbucket?

eb-art avatar Aug 03 '22 18:08 eb-art

👋 @eb-art here you can find how to setup a proper REPO_TOKEN in BB

DavidGOrtega avatar Aug 04 '22 09:08 DavidGOrtega

@eb-art, were you able to resolve the problem with the above link?

dacbd avatar Aug 15 '22 15:08 dacbd

unfortunately I still have an authorization error despite the steps from link

eb-art avatar Aug 15 '22 16:08 eb-art

@eb-art is your pipeline public that I can take a look?

Some other debug steps that might help is to run env | grep REPO_TOKEN to make sure it is present. Additionally you can make sure that the value is correct, run: echo -n "$REPO_TOKEN | md5sum" this should produce the same sum as if you regenerate the token: echo -n "my_username:my_app_password" | base64 then echo -n "token" | md5sum

dacbd avatar Aug 15 '22 16:08 dacbd

@eb-art we are closing this. Please reopen it if you find is still unresolved.

DavidGOrtega avatar Oct 25 '22 14:10 DavidGOrtega