Page MenuHomePhabricator

toolforge-cli can't connect to toolforge-builds-api on local machine
Closed, DeclinedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Install the latest versions of toolforge-cli and toolforge-builds-api on your local machine
  • run toolforge build logs

What happens?:
you get this exception

requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.svc.tools.eqiad1.wikimedia.cloud', port=30003): Max retries exceeded with url: /builds/v1/build/minikube-user-buildpacks-pipelinerun-54bmh/logs (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f48c31dfee0>, 'Connection to api.svc.tools.eqiad1.wikimedia.cloud timed out. (connect timeout=10)'))

What should have happened instead?:
It should have returned the log of the latest build.

Software version (skip for WMF-hosted wikis like Wikipedia):
My local machine is Ubuntu 20.04

how to fix
This is kind of issue has been solved in the past in the jobs-framework-cli repo by calling requests.Session's session.mount method. This is probably the part we need to take here too.

Event Timeline

Raymond_Ndibe changed the task status from Open to In Progress.May 18 2023, 4:20 PM
Raymond_Ndibe claimed this task.

Change 921078 had a related patch set uploaded (by Raymond Ndibe; author: Raymond Ndibe):

[cloud/toolforge/toolforge-cli@main] toolforge-cli: add customfqdn and customaddr to ApiGatewayConfig

https://gerrit.wikimedia.org/r/921078

Raymond_Ndibe changed the task status from In Progress to Stalled.May 18 2023, 10:11 PM

Did you try using the configuration file for it?
I think that'd be nicer than having two different path codes for development and prod

Example of config I have locally:

dcaro@vulcanus$ cat ~/.toolforge.yaml 
---
build:
  dest_repository: 192.168.1.101
  builder_image: tools-harbor.wmcloud.org/toolforge/heroku-builder-classic:22
api_gateway:
  url: https://192.168.49.2:30003

Probably should be documented better though.

Change 921078 abandoned by Raymond Ndibe:

[cloud/toolforge/toolforge-cli@main] toolforge-cli: add customaddr to ApiGatewayConfig

Reason:

this patch is not necessary since we can just add this to the config file and call it a day

https://gerrit.wikimedia.org/r/921078