Strider-CD / strider-github

Github provider for strider
25 stars 34 forks source link

git clone fails #79

Closed xgalen closed 6 years ago

xgalen commented 6 years ago

After the last upgrade git clone in the prepare phase is giving a 500 error. I had to downgrade to github 2.3.0 in order to continue working.

It says: Permission denied (public key). Fatal: could not read from a remote repository in all of our repositories but nothing has changed and it works again after the downgrade.

knownasilya commented 6 years ago

I think it's https://github.com/Strider-CD/strider-github/pull/69 I think you need to add the key, not totally sure.

xgalen commented 6 years ago

The key was already added before the upgrade but does not work.

knownasilya commented 6 years ago

Did you try re-adding after the upgrade?

xgalen commented 6 years ago

The strider's key of the project didn't change and if I try to add the key again in GitHub, detects it's duplicated. I could try tomorrow but I think it won't have effect.

manuelbieh commented 6 years ago

Same problem here. The only thing I can remember I did was Strider related was to press the "update all plugins" button. Since then almost(!) all my projects hosted on Github fail with the same Permission denied (publickey) error. Very frustrating.

manuelbieh commented 6 years ago

For whatever reason it does not even work when downgrading to 2.3.0 ...

That's the error I get:

Mon, 25 Sep 2017 22:41:24 GMT strider:backchannel job.prepare - strider.json not found, skipping config merge
Mon, 25 Sep 2017 22:41:24 GMT strider-simple-runner [runner:simple-runner] Queued new job. Project: manuelbieh/karmaplus-website Job ID: 59c98613fb6943283dbc4f52
Mon, 25 Sep 2017 22:41:24 GMT strider:backchannel new job was created
Mon, 25 Sep 2017 22:41:24 GMT strider:backchannel job saved
Mon, 25 Sep 2017 22:41:24 GMT strider-simple-runner [runner:simple-runner] Job started. Project: manuelbieh/karmaplus-website Job ID: 59c98613fb6943283dbc4f52
Mon, 25 Sep 2017 22:41:24 GMT strider-simple-runner Initializing plugins...
Mon, 25 Sep 2017 22:41:24 GMT strider-simple-runner Initializing plugin 'custom'...
Mon, 25 Sep 2017 22:41:24 GMT strider-simple-runner Initializing plugin 'ssh_deploy'...
Mon, 25 Sep 2017 22:41:24 GMT strider-custom:worker Compiled command yarn --ignore-engines
yarn build
yarn release
rm -rf src/ Gruntfile.js/
Mon, 25 Sep 2017 22:41:24 GMT strider-runner-core:job Creating new job "59c98613fb6943283dbc4f52" for project "manuelbieh/karmaplus-website" using provider "github".
Mon, 25 Sep 2017 22:41:24 GMT strider-runner-core:job Running job "59c98613fb6943283dbc4f52"...
Mon, 25 Sep 2017 22:41:24 GMT strider-runner-core:job Job "59c98613fb6943283dbc4f52" status: phase.done { '0': 'phase.done',
  '1':
   { phase: 'environment',
     time: 2017-09-25T22:41:24.179Z,
     exitCode: 0,
     next: 'prepare',
     elapsed: 1 } }
Mon, 25 Sep 2017 22:41:24 GMT strider-runner-core:job Job "59c98613fb6943283dbc4f52" status: command.start { '0': 'command.start',
  '1':
   { command: 'git clone --recursive \'git@github.com:manuelbieh/karmaplus-website.git\' . --branch develop',
     time: 2017-09-25T22:41:24.197Z,
     plugin: 'github' } }
Mon, 25 Sep 2017 22:41:24 GMT strider-git:worker Git Version:2.7
Mon, 25 Sep 2017 22:41:24 GMT strider-runner-core:job Job "59c98613fb6943283dbc4f52" status: stderr { '0': 'stderr', '1': 'Cloning into \'.\'...\n' }
Mon, 25 Sep 2017 22:41:25 GMT strider-runner-core:job Job "59c98613fb6943283dbc4f52" status: stderr { '0': 'stderr', '1': 'Permission denied (publickey).\r\n' }
Mon, 25 Sep 2017 22:41:25 GMT strider-runner-core:job Job "59c98613fb6943283dbc4f52" status: stderr { '0': 'stderr',
  '1': 'fatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n' }
Mon, 25 Sep 2017 22:41:25 GMT strider-git Gitane error: process exited with status 128
Mon, 25 Sep 2017 22:41:25 GMT strider-git gitane command done git clone --recursive 'git@github.com:manuelbieh/karmaplus-website.git' . --branch develop; exit code 128; duration 926
Mon, 25 Sep 2017 22:41:25 GMT strider-runner-core:job Job "59c98613fb6943283dbc4f52" status: command.done { '0': 'command.done',
  '1': { exitCode: 128, time: 2017-09-25T22:41:25.123Z, elapsed: 926 } }
Mon, 25 Sep 2017 22:41:25 GMT strider-runner-core:job Job "59c98613fb6943283dbc4f52" status: phase.errored { '0': 'phase.errored',
  '1': { time: 2017-09-25T22:41:25.129Z, exitCode: 0 } }
Mon, 25 Sep 2017 22:41:25 GMT strider-runner-core:job Job "59c98613fb6943283dbc4f52" errored: Git clone failed with code 500 Error: Git clone failed with code 500
    at badCode (/var/apps/strider/node_modules/strider-git/worker.js:93:11)
    at updateCache (/var/apps/strider/node_modules/strider-git/worker.js:159:19)
    at /var/apps/strider/node_modules/strider-git/lib/index.js:126:5
    at Function.<anonymous> (/var/apps/strider/node_modules/gitane/index.js:173:7)
    at next (/var/apps/strider/node_modules/step/lib/step.js:51:23)
    at ChildProcess.<anonymous> (/var/apps/strider/node_modules/gitane/index.js:159:9)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:852:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
Mon, 25 Sep 2017 22:41:25 GMT strider-runner-core:job Job "59c98613fb6943283dbc4f52" status: stderr { '0': 'stderr',
  '1': 'An unexpected error occurred while executing this job. Please report at https://github.com/Strider-CD/strider/issues\n\nGit clone failed with code 500\n\nError: Git clone failed with code 500\n    at badCode (/var/apps/strider/node_modules/strider-git/worker.js:93:11)\n    at updateCache (/var/apps/strider/node_modules/strider-git/worker.js:159:19)\n    at /var/apps/strider/node_modules/strider-git/lib/index.js:126:5\n    at Function.<anonymous> (/var/apps/strider/node_modules/gitane/index.js:173:7)\n    at next (/var/apps/strider/node_modules/step/lib/step.js:51:23)\n    at ChildProcess.<anonymous> (/var/apps/strider/node_modules/gitane/index.js:159:9)\n    at emitTwo (events.js:106:13)\n    at ChildProcess.emit (events.js:191:7)\n    at maybeClose (internal/child_process.js:852:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)' }
Mon, 25 Sep 2017 22:41:25 GMT strider-simple-runner [runner:simple-runner] Job done with error. Project: manuelbieh/karmaplus-website Job ID: 59c98613fb6943283dbc4f52

I tried the key manually using ssh -T git@github.com -i tmpkey

Hi manuelbieh! You've successfully authenticated, but GitHub does not provide shell access.

Very strange thing is: I'm managing 4 projects hosted on Github using my local Strider installation. All 4 worked fine when I last deployed 3-4 weeks ago. Now only 1 of the 4 projects still works without any problems. I neither changed my server config nor did I change anything on Github (at least not that I knew?!). What is going on here?!

// edit: I tried to add the project's SSH key to my global list of SSH keys on Github (instead of in the SSH key list in project settings) because the one remaining project that's still working has it this way but it makes no difference. Still getting Permission denied (publickey) 😞

manuelbieh commented 6 years ago

Looks like, for whatever reason, I had strider-git 1.0.1 installed which caused the error. After rolling back to 0.2.6 it seems to work again.

knownasilya commented 6 years ago

I wonder if https://github.com/Strider-CD/strider-git/commit/2bf0c645b160f809b4f917b6a283e974d76442f6 fixed the issue you had with strider-git 1.0.1.. will release a new version.

Done. Reupdating strider-github should pull down the new version of strider-git for that dependency.

xgalen commented 6 years ago

Solved with the commit commented by @knownasilya