juju / autopilot-log-collector

GNU General Public License v3.0
2 stars 6 forks source link

log collector broken on recent versions of juju #6

Open dpb1 opened 7 years ago

dpb1 commented 7 years ago
12:44:29 + cat /tmp/jenkins/workspace/landscape-system-tests/build-area/artifacts/test-output.subunit
12:44:29 + subunit2junitxml --no-passthrough -o /tmp/jenkins/workspace/landscape-system-tests/build-area/artifacts/test-output.xml
12:44:30 + . /tmp/jenkins/workspace/landscape-system-tests/build-area/artifacts/run-info
12:44:30 ++ SERVER_PPA=trunk
12:44:30 + export LANDSCAPE_API_KEY LANDSCAPE_API_SECRET LANDSCAPE_API_URI LANDSCAPE_API_SSL_CA_FILE
12:44:30 + get_cloud_deploy_activity
12:44:30 ++ sort -n
12:44:30 ++ jq -r '.[].id'
12:44:30 ++ python /tmp/jenkins/workspace/landscape-system-tests/build-area/api-client/landscape_api/base.py --json get-activities --query type:DeployOpenstackRegionRequest
12:44:30 ++ tail -n 1
12:44:30 python: can't open file '/tmp/jenkins/workspace/landscape-system-tests/build-area/api-client/landscape_api/base.py': [Errno 2] No such file or directory
12:44:30 + parent_id=
12:44:30 + '[' 2 -ne 0 -o -z '' ']'
12:44:30 + echo 'Failed to fetch the cloud deployment activity'
12:44:30 Failed to fetch the cloud deployment activity
12:44:30 + return 1
12:44:30 + '[' 2 -ne 0 ']'
12:44:30 + extra_logs=
12:44:30 + '[' -f system-tests-console.log ']'
12:44:30 + extra_logs=system-tests-console.log
12:44:30 + '[' -f deploy-openstack-region-activity.json ']'
12:44:30 + collect_logs system-tests-console.log
12:44:30 + local extra_log_files=system-tests-console.log
12:44:30 + echo 'Collecting logs, might fail if LDS failed to bootstrap or deploy'
12:44:30 Collecting logs, might fail if LDS failed to bootstrap or deploy
12:44:30 + juju ssh landscape-server/0 sudo 'HOME=/tmp JUJU_DATA=/var/lib/landscape/juju-homes/`sudo ls -rt /var/lib/landscape/juju-homes/ | tail -1` JUJU_MODEL=controller sudo -u landscape -E juju status --format=json'
12:44:30 + grep -vE '^sudo:'
12:44:30 Connection to 10.96.37.101 closed.
12:44:30 + grep -q 'error: no current controller' /tmp/jenkins/workspace/landscape-system-tests/build-area/artifacts/juju-status.json
12:44:30 + cp /tmp/jenkins/workspace/landscape-system-tests/build-area/artifacts/juju-status.json .
12:44:30 + extra_log_files='system-tests-console.log juju-status.json'
12:44:30 + cat /tmp/jenkins/workspace/landscape-system-tests/build-area/artifacts/juju-status.json
12:44:30 + json2yaml
12:44:30 + python -c 'import json,yaml; import sys; print yaml.safe_dump(json.loads(sys.stdin.read()))'
12:44:31 Traceback (most recent call last):
12:44:31   File "<string>", line 1, in <module>
12:44:31   File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
12:44:31     return _default_decoder.decode(s)
12:44:31   File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
12:44:31     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
12:44:31   File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
12:44:31     raise ValueError("No JSON object could be decoded")
12:44:31 ValueError: No JSON object could be decoded
12:44:31 ++ cat /tmp/jenkins/workspace/landscape-system-tests/build-area/artifacts/juju-status.json
12:44:31 ++ get_pending_nodes
12:44:31 ++ python -c 'import json,sys; status = json.loads(sys.stdin.read()); print " ".join([status["machines"][machine]["dns-name"] for machine in status["machines"].keys() if status["machines"][machine]["agent-state"] != "started"])'
12:44:31 Traceback (most recent call last):
12:44:31   File "<string>", line 1, in <module>
12:44:31   File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
12:44:31     return _default_decoder.decode(s)
12:44:31   File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
12:44:31     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
12:44:31   File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
12:44:31     raise ValueError("No JSON object could be decoded")
12:44:31 ValueError: No JSON object could be decoded
12:44:31 + pending_nodes=
12:44:31 + '[' -n '' ']'
12:44:31 + git clone https://github.com/juju/autopilot-log-collector.git autopilot-log-collector
12:44:31 Cloning into 'autopilot-log-collector'...
12:44:31 + autopilot-log-collector/collect-logs /tmp/jenkins/workspace/landscape-system-tests/build-area/artifacts/all-logs.tar.gz system-tests-console.log juju-status.json
12:44:32 Traceback (most recent call last):
12:44:32   File "autopilot-log-collector/collect-logs", line 649, in <module>
12:44:32     main(tarfile, args.extrafiles, juju, args.inner_model, args.inner)
12:44:32   File "autopilot-log-collector/collect-logs", line 622, in main
12:44:32     collect_logs(juju)
12:44:32   File "autopilot-log-collector/collect-logs", line 368, in collect_logs
12:44:32     units = get_units(juju)
12:44:32   File "autopilot-log-collector/collect-logs", line 264, in get_units
12:44:32     juju_units.append(JujuUnit(name, unit["public-address"]))
12:44:32 KeyError: 'public-address'
12:44:32 + tar xzf /tmp/jenkins/workspace/landscape-system-tests/build-area/artifacts/all-logs.tar.gz landscape-server-0/var/log/landscape-server/job-handler.log
12:44:32 tar (child): /tmp/jenkins/workspace/landscape-system-tests/build-area/artifacts/all-logs.tar.gz: Cannot open: No such file or directory
12:44:32 tar (child): Error is not recoverable: exiting now
12:44:32 tar: Child returned status 2
12:44:32 tar: Error is not recoverable: exiting now
12:44:32 + mv landscape-server-0/var/log/landscape-server/job-handler.log /tmp/jenkins/workspace/landscape-system-tests/build-area/artifacts
12:44:32 mv: cannot stat 'landscape-server-0/var/log/landscape-server/job-handler.log': No such file or directory
12:44:32 + maas_login
12:44:32 + maas login system-tests http://10.96.0.10/MAAS/ Dc6fwNPvWKpWyntrgz:HGW3h8QghBfvWEp4QT:ZT6KaSTKL6QH4GB33HxgNyXBrGhDr6Um
12:44:33 
dpb1 commented 7 years ago

look here for an example: https://ci.lscape.net/job/landscape-system-tests/5098/console

fginther commented 7 years ago

collect-logs barfs when there is no "public-address"