No access to private github repositories from debug mode

I have a problem with ssh connection to my private repos on github using debug mode. During normal run there is no problem. When I switch to debug mode there is ‘Permission denied’. I think ssh should be setup by default. Am I right?

In before_install section I have pip command installing package directly from github:

before_install:
  - pip install --user git+https://github.com...

When I use travis_run_before_install command connection to travis machine is broken instantly, after pip command fails, and debug job is finished - failed. No chance to reconnect to machine. Is it desired behaviour, when command fails in that section?

I use go image 1.11.x

Do you mean this?
https://docs.travis-ci.com/user/running-build-in-debug-mode/#permission-denied-error-message

No. I can connect through ssh to travis machine, but when I want access private github repository from travis machine using ssh there is no accesss to it

Ah, I understand what you are asking now. My apologies.

During the debug build, we remove the GitHub credentials we use to clone private repositories for security reasons. So, if you need to clone private repositories, you will have to set it up again.

Ok, thanks for clarification. According to second part, Is it ok that ssh connection is broken after travis_run_before_install is not successful?

Yes. Commands in before_install are expected to succeed; if it fails, the build terminates immediately; e.g., https://travis-ci.org/BanzaiMan/travis_production_test/builds/490603898#L439

The ssh session would have shown the message to this effect, but the session closure probably left you with nothing on your terminal.

$ ssh RMcxxm6GUTEe0w3SdTZuSAAie@to2.tmate.io
[server exited]
Connection to to2.tmate.io closed by remote host.
Connection to to2.tmate.io closed.

Well, we could argue that this (terminating the debug connection when a command fails at certain places) is not desirable. That’s probably a different topic.

Thanks again. It is not a big problem for me as it is right now

Continuing the discussion from No access to private github repositories from debug mode:

Hi BanzaiMan - I know this topic has been marked closed, but I I’m experiencing the same issue (being unable to clone a private repo during a debug build) and I would like to ask 2 questions:

  1. what did you meant by ‘if you need to clone private repositories, you will have to set it up again.’ - is there an ssh-agent running in the tmate session? Do you mean that we should add our ssh key to that?

  2. If you have removed Github credentials for security reasons, can I ask why? What was the risk and what would I be exposed to if I was to clone a private repo with my private credentials inside the debug session? I have to be clear that I understand the implication of this and any risks so I can make a call to accept them or not.

Thank you very much

Clare

Imprint