Apache Airflow SparkSQLOperator keeps printing empty logs - airflow

I wrote a very simple airflow dag as follows:
import airflow
from airflow import DAG from airflow.contrib.operators.spark_sql_operator import SparkSqlOperator
from datetime import timedelta from datetime import datetime as dt
default_args = {
'owner': 'zxy', 'depends_on_past': False,
'email_on_failure': True, 'email_on_retry': True,
'retries': 1,
'retry_delay': timedelta(minutes=5)
}
dag = DAG(
'my_first_dag',
default_args=default_args,
#start_date=dt.strptime('2018-05-16', '%Y-%m-%d'),
start_date=airflow.utils.dates.days_ago(2),
description='My First Airflow DAG',
schedule_interval=timedelta(minutes=5))
sql = r'''select count(u) from some_table where time=20180513 and platform='iOS' '''
t1 = SparkSqlOperator(task_id='Count_Ads_U', conn_id='spark_default',sql=sql, dag=dag)
Then I ran airflow scheduler to schedule the job.
The job gave the right number successfully, but the job kept printing blank logs as follows hence cannot stop sucessfully:
[2018-05-16 06:33:07,505] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,505] {spark_sql_hook.py:142} INFO - b'18/05/16
06:33:07 INFO spark. SparkContext: Successfully stopped
SparkContext\n'
[2018-05-16 06:33:07,506] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,506] {spark_sql_hook.py:142} INFO - b'18/05/16
06:33:07 INFO util. ShutdownHookManager: Shutdown hook called\n'
[2018-05-16 06:33:07,506] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,506] {spark_sql_hook.py:142} INFO - b'18/05/16
06:33:07 INFO util. ShutdownHookManager: Deleting directory
/tmp/spark-fbb4089c-338b-4b0e-a394-975f45b307a8\n'
[2018-05-16 06:33:07,509] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,509] {spark_sql_hook.py:142} INFO - b'18/05/16
06:33:07 INFO util. ShutdownHookManager: Deleting directory
/apps/data/spark/temp/spark-f6b6695f-24e4-4db0-ae2b-29b6836ab9c3\n'
[2018-05-16 06:33:07,902] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,902] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,903] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,902] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,903] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,902] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,903] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,902] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,903] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,903] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,903] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,903] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,903] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,903] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,903] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,903] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,903] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,903] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,903] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,903] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,903] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,903] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,903] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,903] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,903] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,903] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,904] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,903] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,904] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,903] {spark_sql_hook.py:142} INFO - b''
[2018-05-16 06:33:07,904] {base_task_runner.py:98} INFO - Subtask:
[2018-05-16 06:33:07,903] {spark_sql_hook.py:142} INFO - b''
The empty log went on endlessly until I stopped the scheduler by Ctr+C.
airflow version is v1.9.0.

Problem solved.
This is caused by a byte literal vs string literal problem if your are using Python 3.x(line 146 of https://github.com/apache/incubator-airflow/blob/master/airflow/contrib/hooks/spark_sql_hook.py):
for line in iter(self._sp.stdout.readline, ''):
self.log.info(line)
The sentinel used in the iter is '', which is the empty string literal. But the actual content in the stdout are byte literals instead of string literals(see this post for reference: What does the 'b' character do in front of a string literal?), as can tell from the b prefix in each line of log, so the for loop never ends for some reason.
I fixed the problem by replacing '' with b''.

Related

Airflow: Indefinitely running HTTP Task with no response

Please help me understand on why is this http task running for long time, with no progress.
I`m running the official example on HTTP but looks like missing something here.
https://github.com/apache/airflow/blob/providers-http/4.1.1/tests/system/providers/http/example_http.py
AIRFLOW_CTX_DAG_EMAIL=airflow#example.com
AIRFLOW_CTX_DAG_OWNER=airflow
AIRFLOW_CTX_DAG_ID=example_http_operator
AIRFLOW_CTX_TASK_ID=http_sensor_check
AIRFLOW_CTX_EXECUTION_DATE=2023-02-17T20:53:45.614721+00:00
AIRFLOW_CTX_TRY_NUMBER=1
AIRFLOW_CTX_DAG_RUN_ID=manual__2023-02-17T20:53:45.614721+00:00
[2023-02-17, 20:53:48 UTC] {__init__.py:117} DEBUG - Preparing lineage inlets and outlets
[2023-02-17, 20:53:48 UTC] {__init__.py:155} DEBUG - inlets: [], outlets: []
[2023-02-17, 20:53:48 UTC] {http.py:122} INFO - Poking:
[2023-02-17, 20:53:48 UTC] {base.py:73} INFO - Using connection ID 'http_default' for task execution.
[2023-02-17, 20:53:48 UTC] {http.py:150} DEBUG - Sending 'GET' to url: https://jsonplaceholder.typicode.com/
[2023-02-17, 20:53:52 UTC] {taskinstance.py:769} DEBUG - Refreshing TaskInstance <TaskInstance: example_http_operator.http_sensor_check manual__2023-02-17T20:53:45.614721+00:00 [running]> from DB
[2023-02-17, 20:53:52 UTC] {base_job.py:240} DEBUG - [heartbeat]
[2023-02-17, 20:53:58 UTC] {taskinstance.py:769} DEBUG - Refreshing TaskInstance <TaskInstance: example_http_operator.http_sensor_check manual__2023-02-17T20:53:45.614721+00:00 [running]> from DB
[2023-02-17, 20:53:58 UTC] {base_job.py:240} DEBUG - [heartbeat]
[2023-02-17, 20:54:03 UTC] {taskinstance.py:769} DEBUG - Refreshing TaskInstance <TaskInstance: example_http_operator.http_sensor_check manual__2023-02-17T20:53:45.614721+00:00 [running]> from DB
[2023-02-17, 20:54:03 UTC] {base_job.py:240} DEBUG - [heartbeat]
[2023-02-17, 20:54:08 UTC] {taskinstance.py:769} DEBUG - Refreshing TaskInstance <TaskInstance: example_http_operator.http_sensor_check manual__2023-02-17T20:53:45.614721+00:00 [running]> from DB
[2023-02-17, 20:54:08 UTC] {base_job.py:240} DEBUG - [heartbeat]
[2023-02-17, 20:54:13 UTC] {taskinstance.py:769} DEBUG - Refreshing TaskInstance <TaskInstance: example_http_operator.http_sensor_check manual__2023-02-17T20:53:45.614721+00:00 [running]> from DB
Surprisingly, I`m able to test this code from CLI without any issue but having trouble run this from UI.
AIRFLOW_CTX_DAG_EMAIL=airflow#example.com
AIRFLOW_CTX_DAG_OWNER=airflow
AIRFLOW_CTX_DAG_ID=example_http_operator
AIRFLOW_CTX_TASK_ID=http_sensor_check
AIRFLOW_CTX_EXECUTION_DATE=2023-02-17T21:05:22.781965+00:00
AIRFLOW_CTX_TRY_NUMBER=1
AIRFLOW_CTX_DAG_RUN_ID=__airflow_temporary_run_2023-02-17T21:05:22.781968+00:00__
[2023-02-17 16:05:23,328] {__init__.py:117} DEBUG - Preparing lineage inlets and outlets
[2023-02-17 16:05:23,328] {__init__.py:155} DEBUG - inlets: [], outlets: []
[2023-02-17 16:05:23,329] {http.py:122} INFO - Poking:
[2023-02-17 16:05:23,332] {base.py:73} INFO - Using connection ID 'http_default' for task execution.
[2023-02-17 16:05:23,332] {http.py:150} DEBUG - Sending 'GET' to url: https://jsonplaceholder.typicode.com/
[2023-02-17 16:05:23,335] {connectionpool.py:1003} DEBUG - Starting new HTTPS connection (1): jsonplaceholder.typicode.com:443
[2023-02-17 16:05:23,667] {connectionpool.py:456} DEBUG - https://jsonplaceholder.typicode.com:443 "GET / HTTP/1.1" 200 None
[2023-02-17 16:05:23,669] {base.py:228} INFO - Success criteria met. Exiting.
[2023-02-17 16:05:23,669] {__init__.py:75} DEBUG - Lineage called with inlets: [], outlets: []
[2023-02-17 16:05:23,670] {taskinstance.py:1329} DEBUG - Clearing next_method and next_kwargs.
[2023-02-17 16:05:23,670] {taskinstance.py:1318} INFO - Marking task as SUCCESS. dag_id=example_http_operator, task_id=http_sensor_check, execution_date=20230217T210522, start_date=, end_date=20230217T210523
[2023-02-17 16:05:23,670] {taskinstance.py:2241} DEBUG - Task Duration set to None
[2023-02-17 16:05:23,696] {cli_action_loggers.py:83} DEBUG - Calling callbacks: []
[2023-02-17 16:05:23,696] {settings.py:407} DEBUG - Disposing DB connection pool (PID 65429)

Geeting ModuleNotFoundError: No module named 'pytz' in composer DAG run

I am doing Bigquery operation in composer DAG and getting the following error :
Event with job id 36cc0fe962103bf2bb7a9c Failed
[2021-08-19 15:13:07,807] {base_task_runner.py:113} INFO - Job 263145: Subtask sample [2021-08-19 15:13:07,806] {pod_launcher.py:125} INFO - b' from google.cloud.bigquery.routine import RoutineReference\n'
[2021-08-19 15:13:07,807] {base_task_runner.py:113} INFO - Job 263145: Subtask sample [2021-08-19 15:13:07,807] {pod_launcher.py:125} INFO - b' File "/usr/local/lib/python3.7/dist-packages/google/cloud/bigquery/routine/__init__.py", line 18, in <module>\n'
[2021-08-19 15:13:07,810] {base_task_runner.py:113} INFO - Job 263145: Subtask sample [2021-08-19 15:13:07,808] {pod_launcher.py:125} INFO - b' from google.cloud.bigquery.enums import DeterminismLevel\n'
[2021-08-19 15:13:07,810] {base_task_runner.py:113} INFO - Job 263145: Subtask sample [2021-08-19 15:13:07,808] {pod_launcher.py:125} INFO - b' File "/usr/local/lib/python3.7/dist-packages/google/cloud/bigquery/enums.py", line 21, in <module>\n'
[2021-08-19 15:13:07,811] {base_task_runner.py:113} INFO - Job 263145: Subtask sample [2021-08-19 15:13:07,808] {pod_launcher.py:125} INFO - b' from google.cloud.bigquery.query import ScalarQueryParameterType\n'
[2021-08-19 15:13:07,812] {base_task_runner.py:113} INFO - Job 263145: Subtask sample [2021-08-19 15:13:07,809] {pod_launcher.py:125} INFO - b' File "/usr/local/lib/python3.7/dist-packages/google/cloud/bigquery/query.py", line 23, in <module>\n'
[2021-08-19 15:13:07,812] {base_task_runner.py:113} INFO - Job 263145: Subtask sample [2021-08-19 15:13:07,809] {pod_launcher.py:125} INFO - b' from google.cloud.bigquery.table import _parse_schema_resource\n'
[2021-08-19 15:13:07,812] {base_task_runner.py:113} INFO - Job 263145: Subtask sample [2021-08-19 15:13:07,809] {pod_launcher.py:125} INFO - b' File "/usr/local/lib/python3.7/dist-packages/google/cloud/bigquery/table.py", line 23, in <module>\n'
[2021-08-19 15:13:07,813] {base_task_runner.py:113} INFO - Job 263145: Subtask sample [2021-08-19 15:13:07,809] {pod_launcher.py:125} INFO - b' import pytz\n'
[2021-08-19 15:13:07,813] {base_task_runner.py:113} INFO - Job 263145: Subtask sample [2021-08-19 15:13:07,809] {pod_launcher.py:125} INFO - b"ModuleNotFoundError: No module named 'pytz'\n"
I didn't use pytz in my airflow or BQ method . I have tried to add pytz in my composer environment but it didn't work.Please suggest.
This error is due to the breakage https://github.com/googleapis/python-bigquery/issues/885 and a fix for this is released on Bigquery version 2.24.1.
You can update your bigquery dependency using the command gcloud composer environments update. See Installing a Python dependency from PyPI for more details.
For testing purposes, environment has Composer Version=1.16.14 and Airflow Version=1.10.15. Using the pre installed packages listed in Cloud Composer pre installed packages, I only copied the Google dependencies and updated the packages below. This is because they are dependencies of Bigquery as per Bigquery constraints.
google-cloud-bigquery==2.24.1
google-api-core==1.29.0
grpcio==1.38.1
Full requirements.txt:
google-ads==4.0.0
google-api-core==1.29.0
google-api-python-client==1.12.8
google-apitools==0.5.31
google-auth==1.28.0
google-auth-httplib2==0.1.0
google-auth-oauthlib==0.4.3
google-cloud-automl==2.2.0
google-cloud-bigquery==2.24.1
google-cloud-bigquery-datatransfer==3.1.0
google-cloud-bigquery-storage==2.1.0
google-cloud-bigtable==1.7.0
google-cloud-build==2.0.0
google-cloud-container==1.0.1
google-cloud-core==1.6.0
google-cloud-datacatalog==3.1.0
google-cloud-dataproc==2.3.0
google-cloud-datastore==1.15.3
google-cloud-dlp==1.0.0
google-cloud-kms==2.2.0
google-cloud-language==1.3.0
google-cloud-logging==2.2.0
google-cloud-memcache==0.3.0
google-cloud-monitoring==2.0.0
google-cloud-os-login==2.1.0
google-cloud-pubsub==2.3.0
google-cloud-pubsublite==0.3.0
google-cloud-redis==2.1.0
google-cloud-secret-manager==1.0.0
google-cloud-spanner==1.19.1
google-cloud-speech==1.3.2
google-cloud-storage==1.36.2
google-cloud-tasks==2.2.0
google-cloud-texttospeech==1.0.1
google-cloud-translate==1.7.0
google-cloud-videointelligence==1.16.1
google-cloud-vision==1.0.0
google-cloud-workflows==0.2.0
google-crc32c==1.1.2
google-pasta==0.2.0
google-resumable-media==1.2.0
googleapis-common-protos==1.53.0
grpc-google-iam-v1==0.12.3
grpcio==1.38.1
grpcio-gcp==0.2.2
Command:
gcloud composer environments update your-composer-environment-name --update-pypi-packages-from-file requirements.txt --location your-composer-location

error running Alfresco "Cannot find Alfresco Repository on this server."

I just installed Tomcat 9 and copied Alfresco WAR files into Tomcat's webapps directory. I also copied Alfresco configuration file into Tomcat directories. when I run Tomcat I get multiple error messages about MySQL Driver that can not be found. but I configured Alfresco to use PostgresSQL (Not MySQL).
this is the alfresco-global.properties :
db.username=root
db.password=root
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/alfresco
alfresco.rmi.services.host=0.0.0.0
smart.folders.enabled=true
smart.folders.model=alfresco/model/smartfolder-model.xml
smart.folders.model.labels=alfresco/messages/smartfolder-model
and this is Tomcat log:
NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
10-Mar-2020 16:24:04.393 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/9.0.31
10-Mar-2020 16:24:04.398 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Feb 5 2020 19:32:12 UTC
10-Mar-2020 16:24:04.399 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.31.0
10-Mar-2020 16:24:04.399 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10
10-Mar-2020 16:24:04.402 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.0
10-Mar-2020 16:24:04.402 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
10-Mar-2020 16:24:04.402 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk-11.0.4
10-Mar-2020 16:24:04.402 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 11.0.4+10-LTS
10-Mar-2020 16:24:04.403 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
10-Mar-2020 16:24:04.403 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\apache-tomcat-9.0.31
10-Mar-2020 16:24:04.403 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\apache-tomcat-9.0.31
10-Mar-2020 16:24:04.421 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
10-Mar-2020 16:24:04.421 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
10-Mar-2020 16:24:04.421 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
10-Mar-2020 16:24:04.422 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\apache-tomcat-9.0.31\conf\logging.properties
10-Mar-2020 16:24:04.422 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
10-Mar-2020 16:24:04.422 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
10-Mar-2020 16:24:04.422 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
10-Mar-2020 16:24:04.424 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
10-Mar-2020 16:24:04.424 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\apache-tomcat-9.0.31
10-Mar-2020 16:24:04.424 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\apache-tomcat-9.0.31
10-Mar-2020 16:24:04.425 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\apache-tomcat-9.0.31\temp
10-Mar-2020 16:24:04.425 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk-11.0.4\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:\Ora\product\11.2.0\client_1\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jdk-11.0.4\bin;D:\programs\redis-latest;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Redis\;C:\Users\mehrdad.s\AppData\Local\Microsoft\WindowsApps;C:\Users\mehrdad.s\AppData\Roaming\npm;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\MongoDB\Server\4.2\bin;C:\apache-maven-3.6.3\bin;.]
10-Mar-2020 16:24:04.908 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8888"]
10-Mar-2020 16:24:05.085 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1,052] milliseconds
10-Mar-2020 16:24:05.172 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
10-Mar-2020 16:24:05.173 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.31]
10-Mar-2020 16:24:05.188 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying deployment descriptor [C:\apache-tomcat-9.0.31\conf\Catalina\localhost\alfresco.xml]
Mar 10, 2020 4:24:27 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Mar 10, 2020 4:24:27 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Mar 10, 2020 4:24:27 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Cannot load JDBC driver class 'org.gjt.mm.mysql.Driver'
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
at org.alfresco.repo.domain.dialect.DialectFactoryBean.getObject(DialectFactoryBean.java:59)
at org.alfresco.repo.domain.dialect.DialectFactoryBean.getObject(DialectFactoryBean.java:1)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:171)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:101)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1674)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getObjectForBeanInstance(AbstractAutowireCapableBeanFactory.java:1249)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:257)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.config.PropertyPathFactoryBean.setBeanFactory(PropertyPathFactoryBean.java:196)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1800)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1765)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:346)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1681)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1433)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1681)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1433)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:662)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:188)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1341)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1187)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1681)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1433)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303)

why password connection are lost?

I have to update (re-type and save) my ssh connection password every time I restart airflow. Why is that?
I'm running airflow 1.10.3 in a docker container and I can see that all passwords are stored properly in the postgres database.
*** Reading local file: /root/airflow/logs/archive/check_source/2019-07-07T00:00:00+00:00/4.log
[2019-07-08 01:30:27,253] {__init__.py:1139} INFO - Dependencies all met for <TaskInstance: archive.check_source 2019-07-07T00:00:00+00:00 [queued]>
[2019-07-08 01:30:27,267] {__init__.py:1139} INFO - Dependencies all met for <TaskInstance: archive.check_source 2019-07-07T00:00:00+00:00 [queued]>
[2019-07-08 01:30:27,267] {__init__.py:1353} INFO -
--------------------------------------------------------------------------------
[2019-07-08 01:30:27,267] {__init__.py:1354} INFO - Starting attempt 4 of 4
[2019-07-08 01:30:27,268] {__init__.py:1355} INFO -
--------------------------------------------------------------------------------
[2019-07-08 01:30:27,295] {__init__.py:1374} INFO - Executing <Task(SSHOperator): check_source> on 2019-07-07T00:00:00+00:00
[2019-07-08 01:30:27,296] {base_task_runner.py:119} INFO - Running: [u'airflow', u'run', 'archive', 'check_source', '2019-07-07T00:00:00+00:00', u'--job_id', '1321', u'--raw', u'-sd', u'DAGS_FOLDER/archive.py', u'--cfg_path', '/tmp/tmpQwBRud']
[2019-07-08 01:30:28,392] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source [2019-07-08 01:30:28,392] {settings.py:182} INFO - settings.configure_orm(): Using pool settings. pool_size=5, pool_recycle=1800, pid=656
[2019-07-08 01:30:28,741] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source [2019-07-08 01:30:28,740] {__init__.py:51} INFO - Using executor LocalExecutor
[2019-07-08 01:30:28,975] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source [2019-07-08 01:30:28,974] {__init__.py:305} INFO - Filling up the DagBag from /root/airflow/dags/archive.py
[2019-07-08 01:30:29,073] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source [2019-07-08 01:30:29,073] {cli.py:517} INFO - Running <TaskInstance: archive_to_glacier.check_source 2019-07-07T00:00:00+00:00 [running]> on host airflow-webserver-66d5747dc7-99mhr
[2019-07-08 01:30:29,158] {ssh_operator.py:80} INFO - ssh_hook is not provided or invalid. Trying ssh_conn_id to create SSHHook.
[2019-07-08 01:30:29,204] {__init__.py:1580} ERROR - SSH operator error:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/airflow/models/__init__.py", line 1441, in _run_raw_task
result = task_copy.execute(context=context)
File "/usr/lib/python2.7/site-packages/airflow/contrib/operators/ssh_operator.py", line 167, in execute
raise AirflowException("SSH operator error: {0}".format(str(e)))
AirflowException: SSH operator error:
[2019-07-08 01:30:29,206] {__init__.py:1609} INFO - All retries failed; marking task as FAILED
[2019-07-08 01:30:29,232] {logging_mixin.py:95} INFO - [2019-07-08 01:30:29,232] {configuration.py:287} WARNING - section/key [smtp/smtp_user] not found in config
[2019-07-08 01:30:29,314] {logging_mixin.py:95} INFO - [2019-07-08 01:30:29,313] {email.py:126} INFO - Sent an alert email to [u'bruno.pessanha#imc.com']
[2019-07-08 01:30:29,605] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source Traceback (most recent call last):
[2019-07-08 01:30:29,606] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source File "/usr/bin/airflow", line 32, in <module>
[2019-07-08 01:30:29,606] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source args.func(args)
[2019-07-08 01:30:29,606] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source File "/usr/lib/python2.7/site-packages/airflow/utils/cli.py", line 74, in wrapper
[2019-07-08 01:30:29,606] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source return f(*args, **kwargs)
[2019-07-08 01:30:29,606] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source File "/usr/lib/python2.7/site-packages/airflow/bin/cli.py", line 523, in run
[2019-07-08 01:30:29,606] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source _run(args, dag, ti)
[2019-07-08 01:30:29,606] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source File "/usr/lib/python2.7/site-packages/airflow/bin/cli.py", line 442, in _run
[2019-07-08 01:30:29,606] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source pool=args.pool,
[2019-07-08 01:30:29,606] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source File "/usr/lib/python2.7/site-packages/airflow/utils/db.py", line 73, in wrapper
[2019-07-08 01:30:29,608] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source return func(*args, **kwargs)
[2019-07-08 01:30:29,608] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source File "/usr/lib/python2.7/site-packages/airflow/models/__init__.py", line 1441, in _run_raw_task
[2019-07-08 01:30:29,608] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source result = task_copy.execute(context=context)
[2019-07-08 01:30:29,608] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source File "/usr/lib/python2.7/site-packages/airflow/contrib/operators/ssh_operator.py", line 167, in execute
[2019-07-08 01:30:29,608] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source raise AirflowException("SSH operator error: {0}".format(str(e)))
[2019-07-08 01:30:29,608] {base_task_runner.py:101} INFO - Job 1321: Subtask check_source airflow.exceptions.AirflowException: SSH operator error:
[2019-07-08 01:30:32,260] {logging_mixin.py:95} INFO - [2019-07-08 01:30:32,259] {jobs.py:2562} INFO - Task exited with return code 1
try to add new ssh_conn_id in Admin -> Connections. https://airflow.apache.org/howto/connection/index.html
Because of:
INFO - ssh_hook is not provided or invalid. Trying ssh_conn_id to create SSHHook.

openstack service failed when creating the password plugin

I installed openstack through packstack. However I am having a tough time dealing with the commands.
openstack service list --long
I get:
Discovering versions from the identity service failed when creating
the password plugin. Attempting to determine version from URL. Unable
to establish connection to http://10.23.77.68:5000/v2.0/tokens
10.23.77.68 is my controller node
I ran another command for the neutron, gave me the same response. Kindly help. Absolutely new in this arena.
I do not know what logs to paste, as I am very new,but you can let me know. However I can start with nova-api.log
2016-06-26 21:48:54.675 7560 INFO nova.osapi_compute.wsgi.server
[req-fdf8e231-59b3-46f7-b988-57e7be7d5e17
765512ebca194201b741a9688e07b598 1a7f14a22e56468fa12ebe04ef7ee336 - -
-] 10.23.77.68 "GET /v2/1a7f14a22e56468fa12ebe04ef7ee336/servers/detail HTTP/1.1" status:
200 len: 15838 time: 0.5084898 2016-06-26 21:53:54.151 7535 INFO
nova.osapi_compute.wsgi.server
[req-5dd24a35-fb47-45d6-94da-19303e27a95b
765512ebca194201b741a9688e07b598 1a7f14a22e56468fa12ebe04ef7ee336 - -
-] 10.23.77.68 "GET /v2/1a7f14a22e56468fa12ebe04ef7ee336 HTTP/1.1" status: 404 len: 264 time: 0.2648351 2016-06-26 21:53:54.167 7535 INFO
nova.osapi_compute.wsgi.server
[req-a5eac33d-660c-41a5-8269-2ba8c3063984
765512ebca194201b741a9688e07b598 1a7f14a22e56468fa12ebe04ef7ee336 - -
-] 10.23.77.68 "GET /v2/ HTTP/1.1" status: 200 len: 573 time: 0.0116799 2016-06-26 21:53:55.033 7535 INFO nova.osapi_compute.wsgi.server
[req-2eeb31d2-947e-45be-bfb8-b8f8ebf602b8
765512ebca194201b741a9688e07b598 1a7f14a22e56468fa12ebe04ef7ee336 - -
-] 10.23.77.68 "GET /v2/1a7f14a22e56468fa12ebe04ef7ee336/servers/detail HTTP/1.1" status:
200 len: 15838 time: 0.6974850
EDIT :
/var/log/keystone.log is
[root#controller ~]# tail /var/log/keystone/keystone.log 2016-06-29
15:11:21.975 22759 INFO keystone.common.wsgi
[req-ce18ee5e-2323-4f7a-937c-71cb3b96e9a0
765512ebca194201b741a9688e07b598 1a7f14a22e56468fa12ebe04ef7ee336 -
default default] GET http://10.23.77.68:35357/v2.0/users 2016-06-29
15:11:21.976 22759 WARNING oslo_log.versionutils
[req-ce18ee5e-2323-4f7a-937c-71cb3b96e9a0
765512ebca194201b741a9688e07b598 1a7f14a22e56468fa12ebe04ef7ee336 -
default default] Deprecated: get_users of the v2 API is deprecated as
of Mitaka in favor of a similar function in the v3 API and may be
removed in Q. 2016-06-29 15:11:36.526 22854 INFO keystone.common.wsgi
[req-a63438d5-603e-423f-8c9d-25cf44ac12dc - - - - -] GET
http://10.23.77.68:35357/ 2016-06-29 15:11:36.536 28937 INFO
keystone.common.wsgi [req-177f988e-43ac-49ee-bf9a-e12084646f28 - - - -
-] POST http://10.23.77.68:35357/v2.0/tokens 2016-06-29 15:11:36.682 28393 INFO keystone.common.wsgi
[req-48ccc8d8-e9cb-4e1e-b8bc-ceba9139d654
f93c5815f49342c8809ed489801ae9e1 b0d28d12a3814157b93b5badf9340d1f -
default default] GET http://10.23.77.68:35357/v3/auth/tokens
2016-06-29 15:11:37.047 22096 INFO keystone.common.wsgi
[req-98c1fd31-e5b5-48e8-afd6-8d635ae4cb6a
85c9b4514a3042f991cb00c8b1a5b3ca b0d28d12a3814157b93b5badf9340d1f -
default default] GET http://10.23.77.68:35357/ 2016-06-29 15:11:37.056
25970 INFO keystone.common.wsgi
[req-971dd038-0433-4d36-a341-654a0f421472 - - - - -] POST
http://10.23.77.68:35357/v2.0/tokens 2016-06-29 15:11:37.182 24078
INFO keystone.common.wsgi [req-33cd309d-38c3-4faa-acfb-4406708cd6c8
85c9b4514a3042f991cb00c8b1a5b3ca b0d28d12a3814157b93b5badf9340d1f -
default default] GET http://10.23.77.68:35357/v3/auth/tokens
2016-06-29 15:12:23.884 22587 INFO keystone.common.wsgi
[req-44e1df97-e487-4e82-9293-c1344d0cbaef
85c9b4514a3042f991cb00c8b1a5b3ca b0d28d12a3814157b93b5badf9340d1f -
default default] GET http://10.23.77.68:35357/v3/auth/tokens
2016-06-29 15:12:27.816 27690 INFO keystone.common.wsgi
[req-0755f2a0-8280-4567-af0f-270df896e6f6
85c9b4514a3042f991cb00c8b1a5b3ca b0d28d12a3814157b93b5badf9340d1f -
default default] GET http://10.23.77.68:35357/v3/auth/tokens
[root#controller ~]#
Could you please tell which version of Openstack are you ruuning ? Liberty or Mitaka ?
Also at what stage did the installation stop ?
Source the keystonerc_admin file. This file contains the credentials that will give you access to using these commands/APIs
command: source
you can use curl http://10.23.77.68:5000 on your controller ndoe, if it successfully return version list, then keystone service is ok, you need to check the connect between control node and other nodes, otherwise, you need to check keystone log in 10.23.77.68, it seems this service is not running
Have you try restarting the httpd service and memcached?
systemctl start httpd.service

Resources