Azure / Azure/azure-quickstart-templates
Airflow template issue authenticating to DB
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
## Template w/ Issue
[airflow-postgres-app-services ](https://github.com/wesleyemery/azure-quickstart-templates/tree/master/application-workloads/airflow/airflow-postgres-app-services)
### Issue Details
Logs produced in app service when running ARM Template:
```
2021-09-16T12:59:46 Welcome, you are now connected to log-streaming service.
2021-09-16T13:21:41 Welcome, you are now connected to log-streaming service.
Starting Log Tail -n 10 of existing logs ----
/home/LogFiles/__lastCheckTime.txt (https://orchestration.scm.azurewebsites.net/api/vfs/LogFiles/__lastCheckTime.txt)09/16/2021 13:16:40
/home/LogFiles/kudu/trace/700af43187c0-52425f3c-0a50-49a6-8aa9-94ca6ed79b99.txt (https://orchestration.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/700af43187c0-52425f3c-0a50-49a6-8aa9-94ca6ed79b99.txt)
2021-09-16T12:50:40 Startup Request, url: /api/continuouswebjobs/?api-version=2018-02-01, method: GET, type: request, pid: 72,1,5, ScmType: None
2021-09-16T12:50:41 Outgoing response, type: response, statusCode: 404, statusText: NotFound
/home/LogFiles/kudu/trace/e044ea674f58-ed9d0f4c-355e-46ab-9a85-4740ef139c03.txt (https://orchestration.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/e044ea674f58-ed9d0f4c-355e-46ab-9a85-4740ef139c03.txt)
2021-09-16T12:59:36 Startup Request, url: /api/vfs/site/wwwroot/?_=1631796716738, method: GET, type: request, pid: 66,1,18, ScmType: None
/home/LogFiles/2021_09_16_lw1sdlwk0002TR_default_docker.log (https://orchestration.scm.azurewebsites.net/api/vfs/LogFiles/2021_09_16_lw1sdlwk0002TR_default_docker.log)
2021-09-16T13:17:18.688603756Z return dialect.connect(*cargs, **cparams)
2021-09-16T13:17:18.688615957Z File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 489, in connect
2021-09-16T13:17:18.688623357Z return self.dbapi.connect(*cargs, **cparams)
2021-09-16T13:17:18.688629857Z File "/usr/local/lib/python3.7/site-packages/psycopg2/__init__.py", line 126, in connect
2021-09-16T13:17:18.688636857Z conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
2021-09-16T13:17:18.688643757Z sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: Invalid Username specified. Please check the Username and retry connection. The Username should be in format.
2021-09-16T13:17:18.688651457Z FATAL: Invalid Username specified. Please check the Username and retry connection. The Username should be in format.
2021-09-16T13:17:18.688658657Z
2021-09-16T13:17:18.688665057Z (Background on this error at: http://sqlalche.me/e/e3q8)
/home/LogFiles/2021_09_16_lw1sdlwk0002TR_docker.log (https://orchestration.scm.azurewebsites.net/api/vfs/LogFiles/2021_09_16_lw1sdlwk0002TR_docker.log)
2021-09-16T13:16:45.716Z INFO - Starting container for site
2021-09-16T13:16:45.719Z INFO - docker run -d -p 4164:8081 --name orchestration_0_497acbcb_middleware -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=true -e WEBSITE_SITE_NAME=orchestration -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=orchestration.azurewebsites.net -e WEBSITE_INSTANCE_ID=27d12f19e155cacdc04c8f6426581bbe1813e1177da4fb2ccad41c392805fc92 -e HTTP_LOGGING_ENABLED=1 appsvc/middleware:1.4.7 /Host.ListenUrl=http://0.0.0.0:8081 /Host.DestinationHostUrl=http://172.16.0.2:8080 /Host.UseFileLogging=true
2021-09-16T13:16:52.479Z INFO - Initiating warmup request to container orchestration_0_497acbcb for site orchestration
2021-09-16T13:17:08.351Z INFO - Waiting for response to warmup request for container orchestration_0_497acbcb. Elapsed time = 15.8724577 sec
2021-09-16T13:17:20.853Z ERROR - Container orchestration_0_497acbcb for site orchestration has exited, failing site start
2021-09-16T13:17:20.854Z INFO - Initiating warmup request to container orchestration_0_497acbcb_middleware for site orchestration
2021-09-16T13:17:24.367Z INFO - Container orchestration_0_497acbcb_middleware for site orchestration initialized successfully and is ready to serve requests.
2021-09-16T13:17:24.443Z ERROR - Container orchestration_0_497acbcb didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2021-09-16T13:17:24.502Z INFO - Stopping site orchestration because it failed during startup.
/home/LogFiles/2021_09_16_lw1sdlwk0002TR_easyauth_docker.log (https://orchestration.scm.azurewebsites.net/api/vfs/LogFiles/2021_09_16_lw1sdlwk0002TR_easyauth_docker.log)
/home/LogFiles/webssh/.log (https://orchestration.scm.azurewebsites.net/api/vfs/LogFiles/webssh/.log)
Ending Log Tail of existing logs ---
Starting Live Log Stream ---
2021-09-16T13:22:41 No new trace in the past 1 min(s).
2021-09-16T13:23:41 No new trace in the past 2 min(s).
2021-09-16T13:24:41 No new trace in the past 3 min(s).
2021-09-16T13:25:41 No new trace in the past 4 min(s).
2021-09-16T13:26:41 No new trace in the past 5 min(s).
2021-09-16T13:27:41 No new trace in the past 6 min(s).
2021-09-16T13:28:41 No new trace in the past 7 min(s).
2021-09-16T13:29:41 No new trace in the past 8 min(s).
2021-09-16T13:30:41 No new trace in the past 9 min(s).
2021-09-16T13:31:41 No new trace in the past 10 min(s).
2021-09-16T13:32:41 No new trace in the past 11 min(s).
2021-09-16T13:33:41 No new trace in the past 12 min(s).
```
### Potential Source of Issue
```
2021-09-16T13:17:18.688643757Z sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: Invalid Username specified. Please check the Username and retry connection. The Username should be in format.
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the airflow-postgres-app-services template linked in the issue and reproduce the deployment while checking the App Service container logs. Trace the PostgreSQL connection settings and compare the configured username with the required username@hostname format. Done means the template starts successfully without the invalid-username connection error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, docker, postgresql, python
- Domain
- cloud, databases, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100