tensorflow / tensorboard

TensorFlow's Visualization Toolkit
Apache License 2.0
6.67k stars 1.65k forks source link

tensorboard dev behind proxy #4521

Open quetil opened 3 years ago

quetil commented 3 years ago

Hello all,

I'd like to test and use tensorboard dev, but I'm working behind a proxy. So when I write the proxy in the environment variable, I got a SLL error (or certificate chain error). So I looked for a way to write the cafile.pem location so tensorboard can use it, but I didn't find a way. Usually, for such command there is a flag --cafile and a flag --proxy, so maybe it's feature that can be requested?

Do you have any ideas?

Thank you in advance,

Adrien

bmd3k commented 3 years ago

Hello Adrien!

We are using gRPC for tensorboard dev calls so perhaps the support you need is already built in at lower levels. Could you try some of the environment variables described here? https://github.com/grpc/grpc/blob/master/doc/environment_variables.md

I haven't really tried it but perhaps https_proxy and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH are the variables you need.

If you get it to work, do you mind posting some details here? If you're having troubles please feel free to post followup questions.

quetil commented 3 years ago

Hello Brian,

Thanks for the reply, very much appreciated ! Well searched, I thought it was going to work ! But still the following error message:

Failed to connect to backend: HTTPSConnectionPool(host='tensorboard.dev', port=443): Max retries exceeded with url: /api/uploader (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1124)')))

It seems grpc doesn't look at the GRPC_DEFAULT_SSL_ROOTS_FILE_PATH 🤔

I'll continue to investigate and keep this thread in touch if any progress!

bmd3k commented 3 years ago

Sorry, there was a typo in my response, which I have updated. The name of the env var is actually 'GRPC_DEFAULT_SSL_ROOTS_FILE_PATH'.

I have been able to configure GRPC with this variable in the past. I've just never done it in combination with a proxy.

quetil commented 3 years ago

No worries, I noticed the typo and already tried with the right env var GRPC_DEFAULT_SSL_ROOTS_FILE_PATH, but still the same error message. Maybe it's not the right pem file (but it's working for pip and conda for instance). I'll continue to investigate

arghyaganguly commented 3 years ago

@quetil , can this issue be closed?

quetil commented 3 years ago

I'd prefer to be sure and to have someone which is telling us "it's working" in a classic environnement. And then, if it's the case, it will probably be a wrong config in the enterprise virtual machine I'm working on, which is blocking the right behavior.