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

"Cannot lock ref" error on Travis CI job #54

Closed
tidoust opened this issue Sep 1, 2020 · 3 comments
Closed

"Cannot lock ref" error on Travis CI job #54

tidoust opened this issue Sep 1, 2020 · 3 comments

Comments

@tidoust
Copy link
Member

tidoust commented Sep 1, 2020

@foolip, latest Travis CI job correctly detected the update on webaudio.idl, correctly created the PR against WPT, and yet the job failed with (slightly reformatted to fit the screen):

{ Error: Command failed: git push fork reffy-reports/webaudio

To https://github.com/autofoolip/wpt.git

 ! [remote rejected] reffy-reports/webaudio ->
       reffy-reports/webaudio (cannot lock ref 'refs/heads/reffy-reports/webaudio': reference already exists)

error: failed to push some refs to 'https://github.com/autofoolip/wpt.git'
    at checkExecSyncError (child_process.js:629:11)
    at Object.execSync (child_process.js:666:13)
    at git (/home/travis/build/w3c/webref/wpt-sync/sync.js:141:22)
    at updatePullRequests (/home/travis/build/w3c/webref/wpt-sync/sync.js:186:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  status: 1,
  signal: null,
  output:
   [ null,
     '',
     'To https://github.com/autofoolip/wpt.git\n ! [remote rejected]
      reffy-reports/webaudio -> reffy-reports/webaudio
      (cannot lock ref \'refs/heads/reffy-reports/webaudio\': reference already exists)\n
      error: failed to push some refs to \'https://github.com/autofoolip/wpt.git\'\n' ],
  pid: 9155,
  stdout: '',
  stderr:
   'To https://github.com/autofoolip/wpt.git\n ! [remote rejected]
    reffy-reports/webaudio -> reffy-reports/webaudio
    (cannot lock ref \'refs/heads/reffy-reports/webaudio\': reference already exists)\n
    error: failed to push some refs to \'https://github.com/autofoolip/wpt.git\'\n' }

The command "if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
  node wpt-sync/sync.js --wpt-dir wpt --build-url https://travis-ci.org/w3c/webref/builds/$TRAVIS_BUILD_ID
else
  node wpt-sync/sync.js --wpt-dir wpt --dry-run
fi" exited with 1.

Any obvious reason for such a failure?

@foolip
Copy link
Member

foolip commented Oct 21, 2020

Was there another Travis CI job running around the same time, like if two of them got queued up? I'm thinking this sort of thing could happen if two jobs try to push the same branch at the same time.

@tidoust
Copy link
Member Author

tidoust commented Oct 22, 2020

That is what I thought too, but jobs typically run 6 hours apart, so that did not make sense... until yesterday when your comment made me realize that Travis CI was actually enabled twice in the repo settings: with a webhook, and at the organization level. Each push to master actually triggered two Travis CI jobs in parallel (one under travis-ci.org and another one under travis-ci.com) as a result.

So, problem solved, I deleted the webhook :)

@tidoust tidoust closed this as completed Oct 22, 2020
@foolip
Copy link
Member

foolip commented Oct 22, 2020

Aha, that would also explain the confusion in #58 :)

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

2 participants