question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`cml send-comment --update`: Raises 'commit_id has been locked' error

See original GitHub issue

When calling cml send-comment --update from a python script using subprocess.run, the following error is being raised:

"HttpError: Validation Failed: {\"resource\":\"CommitComment\",\"code\":\"custom\",\"field\":\"commit_id\",\"message\":\"commit_id has been locked\"}
    at /usr/lib/node_modules/@dvcorg/cml/node_modules/@octokit/request/dist-node/index.js:86:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Job.doExecute (/usr/lib/node_modules/@dvcorg/cml/node_modules/bottleneck/light.js:405:18)","status":422}

Without --update, the error is not being raised.

Code:

import subprocess

for i in range(3):
    with open("report.md", "w") as f:
        f.write(f"## {i}")
    
    subprocess.run(
        ["cml", "send-comment", "--update", "report.md"],
        check=True
    )

Example failure: https://github.com/iterative/test-cml-send-comment-pr/runs/5036525998?check_suite_focus=true#step:4:7

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
0x2b3bfa0commented, Jun 10, 2022
1reaction
daavoocommented, Jun 10, 2022

Try using a personal access token instead of GITHUB_TOKEN

For the record, adding a PAT token with repo & workflow permissions has solved the issue.

However, it feels a little cumbersome to do this “only” to enable --update, while “no-update” works with the default token

Read more comments on GitHub >

github_iconTop Results From Across the Web

MobiLink Getting Started - Sybase Infocenter
You only want to update data that has changed. In a MobiLink application the upload is based on the transaction log and so...
Read more >
Director. - GovInfo
A general and locality salary increase for Federal employees, ... Executive Order 12866 This action has been determined to be not ...
Read more >
Oracle® Workflow
access this data because the item itself has not yet been committed, and because you may have lock contentions with the main session....
Read more >
Cloud-ready messaging with Spring Integration: Taming ...
The problem, amongst others, is that XA transactions do not scale, ... if the message has been committed but the JVM crashes after...
Read more >
Oracle Workflow API Reference - Stanford University
Oracle Applications form can update many tables at once. ... because the item itself has not yet been committed, and because you may...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found