mozilla/release-services

"./please run shipit-workflow" fails with error about /etc/hosts

Closed this issue · 10 comments

➜  services git:(add-link) ./please run shipit-workflow
 => Checking if database `services` exists ... DONE
 => Running shipit-workflow on https://0.0.0.0:8015 ...
1+0 records in
1+0 records out
24 bytes copied, 4.1252e-05 s, 582 kB/s
[2018-04-04 19:21:53 +0000] [3199] [INFO] Starting gunicorn 19.7.1
[2018-04-04 19:21:53 +0000] [3199] [INFO] Listening at: https://0.0.0.0:8015 (3199)
[2018-04-04 19:21:53 +0000] [3199] [INFO] Using worker: sync
[2018-04-04 19:21:53 +0000] [3206] [INFO] Booting worker with pid: 3206
[2018-04-04 19:21:53 +0000] [3208] [INFO] Booting worker with pid: 3208
2018-04-04 19:21.53 Initializing                   app=shipit_workflow
2018-04-04 19:21.53 Initializing                   app=shipit_workflow
[2018-04-04 19:21:54 +0000] [3206] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/nix/store/fm1qxr30842dvr7xln00hij2jmbx40xw-python3.5-python3.5-gunicorn-19.7.1/lib/python3.5/site-packages/gunicorn/arbiter.py", line 578, in spawn_worker
    worker.init_process()
  File "/nix/store/fm1qxr30842dvr7xln00hij2jmbx40xw-python3.5-python3.5-gunicorn-19.7.1/lib/python3.5/site-packages/gunicorn/workers/base.py", line 127, in init_process
    self.load_wsgi()
  File "/nix/store/fm1qxr30842dvr7xln00hij2jmbx40xw-python3.5-python3.5-gunicorn-19.7.1/lib/python3.5/site-packages/gunicorn/workers/base.py", line 136, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/nix/store/fm1qxr30842dvr7xln00hij2jmbx40xw-python3.5-python3.5-gunicorn-19.7.1/lib/python3.5/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/nix/store/fm1qxr30842dvr7xln00hij2jmbx40xw-python3.5-python3.5-gunicorn-19.7.1/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/nix/store/fm1qxr30842dvr7xln00hij2jmbx40xw-python3.5-python3.5-gunicorn-19.7.1/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/nix/store/fm1qxr30842dvr7xln00hij2jmbx40xw-python3.5-python3.5-gunicorn-19.7.1/lib/python3.5/site-packages/gunicorn/util.py", line 352, in import_app
    __import__(module)
  File "/app/src/shipit_workflow/shipit_workflow/flask.py", line 11, in <module>
    app = shipit_workflow.create_app()
  File "/app/src/shipit_workflow/shipit_workflow/__init__.py", line 25, in create_app
    'db',
  File "/nix/store/dq1a1qcvc92s70cy3vhmma851mpyw0nj-python3.5-mozilla-backend-common-1.0.0/lib/python3.5/site-packages/backend_common/__init__.py", line 53, in create_app
    app.config.from_envvar('APP_SETTINGS')
  File "/nix/store/by2mic06ar45ysj8xpp5xi6s5hna5cj5-python3.5-Flask-0.12.2/lib/python3.5/site-packages/flask/config.py", line 109, in from_envvar
    return self.from_pyfile(rv, silent=silent)
  File "/nix/store/by2mic06ar45ysj8xpp5xi6s5hna5cj5-python3.5-Flask-0.12.2/lib/python3.5/site-packages/flask/config.py", line 130, in from_pyfile
    exec(compile(config_file.read(), filename, 'exec'), d.__dict__)
  File "/app/src/shipit_workflow/settings.py", line 34, in <module>
    taskcluster_access_token=os.environ.get('TASKCLUSTER_ACCESS_TOKEN'),
  File "/nix/store/0bjjvmrxsz520dk95vnlmv67lgad4ml3-python3.5-mozilla-cli-common-1.0.0/lib/python3.5/site-packages/cli_common/taskcluster.py", line 135, in get_secrets
    taskcluster_access_token,
  File "/nix/store/0bjjvmrxsz520dk95vnlmv67lgad4ml3-python3.5-mozilla-cli-common-1.0.0/lib/python3.5/site-packages/cli_common/taskcluster.py", line 109, in get_service
    options = get_options(service_name + '/v1', client_id, access_token)
  File "/nix/store/0bjjvmrxsz520dk95vnlmv67lgad4ml3-python3.5-mozilla-cli-common-1.0.0/lib/python3.5/site-packages/cli_common/taskcluster.py", line 66, in get_options
    raise Exception('Missing taskcluster in /etc/hosts')
Exception: Missing taskcluster in /etc/hosts
[2018-04-04 19:21:54 +0000] [3206] [INFO] Worker exiting (pid: 3206)
[2018-04-04 19:21:54 +0000] [3208] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/nix/store/fm1qxr30842dvr7xln00hij2jmbx40xw-python3.5-python3.5-gunicorn-19.7.1/lib/python3.5/site-packages/gunicorn/arbiter.py", line 578, in spawn_worker
    worker.init_process()
  File "/nix/store/fm1qxr30842dvr7xln00hij2jmbx40xw-python3.5-python3.5-gunicorn-19.7.1/lib/python3.5/site-packages/gunicorn/workers/base.py", line 127, in init_process
    self.load_wsgi()
  File "/nix/store/fm1qxr30842dvr7xln00hij2jmbx40xw-python3.5-python3.5-gunicorn-19.7.1/lib/python3.5/site-packages/gunicorn/workers/base.py", line 136, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/nix/store/fm1qxr30842dvr7xln00hij2jmbx40xw-python3.5-python3.5-gunicorn-19.7.1/lib/python3.5/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/nix/store/fm1qxr30842dvr7xln00hij2jmbx40xw-python3.5-python3.5-gunicorn-19.7.1/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/nix/store/fm1qxr30842dvr7xln00hij2jmbx40xw-python3.5-python3.5-gunicorn-19.7.1/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/nix/store/fm1qxr30842dvr7xln00hij2jmbx40xw-python3.5-python3.5-gunicorn-19.7.1/lib/python3.5/site-packages/gunicorn/util.py", line 352, in import_app
    __import__(module)
  File "/app/src/shipit_workflow/shipit_workflow/flask.py", line 11, in <module>
    app = shipit_workflow.create_app()
  File "/app/src/shipit_workflow/shipit_workflow/__init__.py", line 25, in create_app
    'db',
  File "/nix/store/dq1a1qcvc92s70cy3vhmma851mpyw0nj-python3.5-mozilla-backend-common-1.0.0/lib/python3.5/site-packages/backend_common/__init__.py", line 53, in create_app
    app.config.from_envvar('APP_SETTINGS')
  File "/nix/store/by2mic06ar45ysj8xpp5xi6s5hna5cj5-python3.5-Flask-0.12.2/lib/python3.5/site-packages/flask/config.py", line 109, in from_envvar
    return self.from_pyfile(rv, silent=silent)
  File "/nix/store/by2mic06ar45ysj8xpp5xi6s5hna5cj5-python3.5-Flask-0.12.2/lib/python3.5/site-packages/flask/config.py", line 130, in from_pyfile
    exec(compile(config_file.read(), filename, 'exec'), d.__dict__)
  File "/app/src/shipit_workflow/settings.py", line 34, in <module>
    taskcluster_access_token=os.environ.get('TASKCLUSTER_ACCESS_TOKEN'),
  File "/nix/store/0bjjvmrxsz520dk95vnlmv67lgad4ml3-python3.5-mozilla-cli-common-1.0.0/lib/python3.5/site-packages/cli_common/taskcluster.py", line 135, in get_secrets
    taskcluster_access_token,
  File "/nix/store/0bjjvmrxsz520dk95vnlmv67lgad4ml3-python3.5-mozilla-cli-common-1.0.0/lib/python3.5/site-packages/cli_common/taskcluster.py", line 109, in get_service
    options = get_options(service_name + '/v1', client_id, access_token)
  File "/nix/store/0bjjvmrxsz520dk95vnlmv67lgad4ml3-python3.5-mozilla-cli-common-1.0.0/lib/python3.5/site-packages/cli_common/taskcluster.py", line 66, in get_options
    raise Exception('Missing taskcluster in /etc/hosts')
Exception: Missing taskcluster in /etc/hosts
[2018-04-04 19:21:54 +0000] [3208] [INFO] Worker exiting (pid: 3208)
[2018-04-04 19:21:54 +0000] [3199] [INFO] Shutting down: Master
[2018-04-04 19:21:54 +0000] [3199] [INFO] Reason: Worker failed to boot.
La0 commented

This will be solved once we have the per project configuration + signin wizard (Taskcluster will not be used by default)

relevant tickets #1220 and #1221

This also seems to be affecting ./please check. I tried with docs, shipit/api and shipit/frontend and received the same error about taskcluster not being in /etc/hosts

yeah, this is the error i want to work soon on it. this basically mean you need to provide taskcluster credentials via cli (--taskcluster-client-id and --taskcluster-access-token).

The idea for the future is to have a ./please signin command which would store tc credentials in your home (eg. ~/.pleaserc), more on this at #1221

I still have this issue for "./please check codecoverage/bot" on Ubuntu/16.04. Any help please..?
In fact, it occurs for other projects too(doc, releng-frontend etc)

You'll need to create a Taskcluster account on https://tools.taskcluster.net/, and then use ./please tools signin to sign-in (add secrets:get:garbage/YOUR_NICK/release_services in the list of scopes). Then, create a secret called garbage/YOUR_NICK/release_services from https://tools.taskcluster.net/secrets (it can be empty at the beginning). Then, you should be able to run ./please check codecoverage/bot (it might complain about some missing value from secrets, which you will need to add to the secret you just created).

@marco-c Sorry, it does not work. Still the same issue.
Steps I followed:

  1. Created account on tools.taskcluster.net
  2. ./please tools signin => opened the link on the terminal, on create New client page, entered the scope(secrets:get:garbage/YOUR_NICK/release_services). Got "Taskcluster credentials saved !" on terminal.
  3. On tools.taskcluster.net/secrets page, created a SecretName: garbage/YOUR_NICK/release_services
  4. run: ./please check codecoverage/bot

YOUR_NICK=mk6891

Please help

Run ./please check codecoverage/bot --taskcluster-client-id YOUR_CLIENT_ID --taskcluster-access-token YOUR_ACCESS_TOKEN --taskcluster-secret="garbage/mk6891/release_services" , where YOUR_CLIENT_ID and YOUR_ACCESS_TOKEN can be read in the configuration file at ~/.config/please/config.toml.

@marco-c Thanks for the information. It now works but fails with missing value NIX_CACHE_SECRET_KEYS in secrets, as you mentioned before. Can you please point me to a document or link which provides what values should these parameters have in the yaml?? I tried some things but doesn't work. Sorry, I am doing for the first time and missing all these information.

You will need to change your secret (garbage/mk6891/release_services) on taskcluster, e.g. for this one try using an empty array.