cli icon indicating copy to clipboard operation
cli copied to clipboard

Heroku cli issues - behind corporate proxy

Open noenthu opened this issue 8 years ago • 8 comments

Noticing issues with running commands like heroku logs behind our corporate proxy lately. I set the environment variable and enabled debug for the log below.

If I curl the URL in the 201 response (logplex_url) I am able to retrieve the logs.. but the heroku cli is throwing an error.

proxy set to https://10.10.5.18:8080 --> POST /apps/t/log-sessions --> {"lines":100} <-- 201 Created <-- {"created_at":"2018-01-29T21:02:45Z","id":"someidhere","logplex_url":"removed for posting here","updated_at":"2018-01-29T21:02:45Z"} ERROR: TypeError: Cannot read property 'once' of null at EventEmitter.ee.once.req (/home/username/.local/share/heroku/client/6.15.18-fdf2097/node_modules/heroku-cli-util/node_modules/got/index.js:229:20) at Object.onceWrapper (events.js:255:19) at EventEmitter.emit (events.js:165:20) at Immediate.setImmediate (/home/username/.local/share/heroku/client/6.15.18-fdf2097/node_modules/heroku-cli-util/node_modules/got/index.js:264:8) at runCallback (timers.js:756:18) at tryOnImmediate (timers.js:717:5) at processImmediate [as _immediateCallback] (timers.js:697:5) Exiting with code: 1

noenthu avatar Jan 29 '18 21:01 noenthu

we use got as a dependency which is also out of date, I might need to bump it

jdx avatar Jan 29 '18 21:01 jdx

Hi, I am facing the same issue with heroku logs command. I am behind firewall and able to login via "heroku login" command after setting HTTP_PROXY environment variable. I am able to execute other commands as well but whenever I am trying "heroku logs" command it is not giving any result.

The same command work when I login from network without proxy restriction. Is there anything in Heroku CLI which needs to be set to make "heroku logs" run behind corporate firewall?

Thanks for your help.

manojmacwan avatar May 10 '18 06:05 manojmacwan

I think I found the issue. We started using SSE for logs and it wasn't setup to look at the proxy. I just pushed a potential fix. Would you mind updating to the beta with heroku update beta and trying again?

jdx avatar May 10 '18 07:05 jdx

I tried updating but i have the same problem.

when i type heroku version i get:

heroku/7.4.1-beta.b93fad7 win32-x64 node-v10.4.1

dav-sap avatar Jun 20 '18 07:06 dav-sap

Still no chance to get heroku logs --tail working via proxy?

heroku/7.27.1 win32-x64 node-v11.14.0

ptytb avatar Aug 08 '19 12:08 ptytb

Same issue with heroku logs under proxy here. Any perspective for a solution?

heroku/7.35.0 win32-x64 node-v12.13.0

aghasemi avatar Nov 13 '19 11:11 aghasemi

Same here.

heroku/7.42.13 linux-x64 node-v12.16.2

stevencch99 avatar Sep 01 '20 01:09 stevencch99

Hello there,

I just encountered the same problem.

heroku/7.67.1 linux-x64 node-v14.19.0 Usually we use username/password to control access to the internet and basically heroku cli works with our configuration: e.g. ( access log of our proxyserver)

2022-12-21T14:51:27+0100    321 x.x.x.x TCP_MISS/000 5038 CONNECT backboard.heroku.com:443 username FIRST_UP_PARENT/proxyserver -
2022-12-21T14:51:28+0100    443 x.x.x.x TCP_MISS/000 4803 CONNECT api.heroku.com:443 username FIRST_UP_PARENT/proxyserver –

Only if we try to get the logs heoku cli it looks like heroku cli does not send the credentials with the request, resulting in a 407.

2022-12-21T14:51:28+0100 0 x.x.x.x TCP_DENIED/407 4009 GET https://dublin.sessions.logs.heroku.com/stream? - NONE/- text/html

As soon as we switch to ip based access control in our proxy server heroku cli works completely fine, also with logs.

Bye, Dirk

DirkFries avatar Dec 22 '22 11:12 DirkFries