|
| 1 | +# Debugging Cromwell / CromIAM Deployments |
| 2 | + |
| 3 | +## Shim requires oauth but UI doesn't log you in |
| 4 | + |
| 5 | +#### Symptoms |
| 6 | + |
| 7 | +The UI is making unauthenticated requests to the shim layer, but the shim is |
| 8 | +rejecting them as unauthorized. |
| 9 | + |
| 10 | +In the UI, Job Manager prompts you to log in but cannot proceed past this page: |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | + |
| 19 | +In the javascript console you see messages like: `ERROR Error: Uncaught (in promise): Object: {"status":401,"title":"Unauthorized","message":"User not authorized to access this resource."}` |
| 20 | + |
| 21 | +#### Cause |
| 22 | + |
| 23 | +You've set up the Cromwell shim's `docker-compose.yml` to include the following: |
| 24 | + |
| 25 | +```yaml |
| 26 | +services: |
| 27 | + cromwell: |
| 28 | + environment: |
| 29 | + - USE_CAAS=True |
| 30 | +``` |
| 31 | +
|
| 32 | +Or, perhaps you've set the environment variable `USE_CAAS=True` manually. |
| 33 | + |
| 34 | +**But**: you haven't told the UI to log users in. |
| 35 | + |
| 36 | +#### Resolution |
| 37 | + |
| 38 | +Add an `authentication` section to the end of the Cromwell shim's `capabilities.conf`. When the UI |
| 39 | +reads this, it then knows how to direct users to the oauth login. |
| 40 | + |
| 41 | +```json |
| 42 | +{ |
| 43 | + ..., |
| 44 | + |
| 45 | + "authentication": { |
| 46 | + "isRequired": true, |
| 47 | + "scopes": [ |
| 48 | + "openid", |
| 49 | + "email", |
| 50 | + "profile" |
| 51 | + ] |
| 52 | + } |
| 53 | +} |
| 54 | +``` |
| 55 | + |
| 56 | +## Unable to connect to Cromwell URL |
| 57 | + |
| 58 | +#### Symptoms |
| 59 | + |
| 60 | +The UI asks me to log in but when I do, I just get redirected back to the |
| 61 | +same`Authenticate` page. |
| 62 | + |
| 63 | +In the Cromwell Shim logs, I see a long stack trace starting with: |
| 64 | + |
| 65 | +``` |
| 66 | +cromwell_1 | ERROR:flask.app:Exception on /api/v1/jobs/query [POST] |
| 67 | +cromwell_1 | Traceback (most recent call last): |
| 68 | +cromwell_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2292, in wsgi_app |
| 69 | +cromwell_1 | response = self.full_dispatch_request() |
| 70 | +``` |
| 71 | + |
| 72 | +Followed by an error message like this (with your Cromwell URL replacing `https://some/host`): |
| 73 | + |
| 74 | +``` |
| 75 | +ConnectionError: HTTPConnectionPool(host='https://some/host', port=8000): Max retries exceeded with url: /api/workflows/v1/query (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f32d1908510>: Failed to establish a new connection: [Errno 111] Connection refused',)) |
| 76 | +``` |
| 77 | + |
| 78 | +#### Cause |
| 79 | + |
| 80 | +The Cromwell Shim is unable to make a connection to the CromIAM service. |
| 81 | + |
| 82 | +#### Resolution |
| 83 | + |
| 84 | +There are a few things to check here: |
| 85 | + |
| 86 | +- Is the URL correct? |
| 87 | + - If not - change the `CROMWELL_URL` environment variable - either manually on the command line or in `docker-compose.yaml` |
| 88 | + - Don't forget to format it appropriately, eg `export CROMWELL_URL=https://<<hostname>>/api/workflows/v1` |
| 89 | +- Is the network link between shim and CromIAM available? |
| 90 | + - If not, resolve the issue before restarting Job Manager |
| 91 | +- Is the CromIAM service actually running? |
| 92 | + - If not, resolve the issue before restarting Job Manager |
| 93 | + |
| 94 | + |
0 commit comments