Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cml comment create is giving unauthorization error #1464

Open
bhaswa opened this issue May 21, 2024 · 2 comments
Open

cml comment create is giving unauthorization error #1464

bhaswa opened this issue May 21, 2024 · 2 comments

Comments

@bhaswa
Copy link

bhaswa commented May 21, 2024

When I use the command in gitlab ci/cd pipeline, getting the below error

cml comment create report.md

{"level":"warn","message":""cml send-comment" is deprecated, please use "cml comment create""}
{"level":"error","message":"Unauthorized","stack":"Error: Unauthorized\n at Gitlab.request (/usr/lib/node_modules/@dvcorg/cml/src/drivers/gitlab.js:573:13)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async /usr/lib/node_modules/@dvcorg/cml/src/drivers/gitlab.js:54:16\n at async Promise.all (index 0)\n at async Gitlab.repoBase (/usr/lib/node_modules/@dvcorg/cml/src/drivers/gitlab.js:45:27)\n at async Gitlab.projectPath (/usr/lib/node_modules/@dvcorg/cml/src/drivers/gitlab.js:33:22)\n at async Gitlab.commitPrs (/usr/lib/node_modules/@dvcorg/cml/src/drivers/gitlab.js:108:25)\n at async parseCommentTarget (/usr/lib/node_modules/@dvcorg/cml/src/commenttarget.js:39:25)\n at async CML.commentCreate (/usr/lib/node_modules/@dvcorg/cml/src/cml.js:308:20)\n at async Object.exports.handler (/usr/lib/node_modules/@dvcorg/cml/bin/cml/comment/create.js:11:15)"}

@0x2b3bfa0
Copy link
Member

Hello, @bhaswa! Please make sure that your token is valid.

@Chapi15
Copy link

Chapi15 commented Jun 18, 2024

I have the same error for the GitHub Actions pipeline

{"code":"ERR_INVALID_URL","input":"<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n<hr><center>cloudflare</center>\r\n</body>\r\n</html>\r\n","level":"error","message":"Invalid URL","stack":"TypeError [ERR_INVALID_URL]: Invalid URL\n at new NodeError (node:internal/errors:405:5)\n at new URL (node:internal/url:676:13)\n at uriParam (/usr/local/lib/node_modules/@dvcorg/cml/src/utils.js:149:15)\n at watermarkUri (/usr/local/lib/node_modules/@dvcorg/cml/src/utils.js:140:10)\n at CML.publish (/usr/local/lib/node_modules/@dvcorg/cml/src/cml.js:351:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async visitor (/usr/local/lib/node_modules/@dvcorg/cml/src/cml.js:249:26)\n at async Promise.all (index 0)\n at async publishLocalFiles (/usr/local/lib/node_modules/@dvcorg/cml/src/cml.js:263:7)"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants