add_source() might fail due to network errors

Bug #1370933 reported by Björn Tillenius on 2014-09-18
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Autopilot Log Analyser
Low
Francis Ginther
Charm Helpers
Undecided
Chad Smith
Glance - Simplestreams Sync Charm
Undecided
Chad Smith
Landscape Charm
Undecided
Chad Smith
landscape-client-charm
Undecided
Chad Smith

Bug Description

I saw the following error when installing landscape-client, which uses charm-helper:

2014-09-18 07:34:50 INFO install Cannot add PPA: 'ppa:landscape/trunk'.
2014-09-18 07:34:50 INFO install Please check that the PPA name or format is correct.
2014-09-18 07:34:50 INFO install Traceback (most recent call last):
2014-09-18 07:34:50 INFO install File "/var/lib/juju/agents/unit-landscape-client-0/charm/hooks/install", line 93, in <module>
2014-09-18 07:34:50 INFO install sys.exit(hooks.execute(sys.argv))
2014-09-18 07:34:50 INFO install File "/var/lib/juju/agents/unit-landscape-client-0/charm/hooks/charmhelpers/core/hookenv.py", line 381, in execute
2014-09-18 07:34:50 INFO install self._hooks[hook_name]()
2014-09-18 07:34:50 INFO install File "/var/lib/juju/agents/unit-landscape-client-0/charm/hooks/install", line 34, in install
2014-09-18 07:34:50 INFO install add_apt_source(origin)
2014-09-18 07:34:50 INFO install File "/var/lib/juju/agents/unit-landscape-client-0/charm/hooks/install", line 89, in add_apt_source
2014-09-18 07:34:50 INFO install return add_source(url, key)
2014-09-18 07:34:50 INFO install File "/var/lib/juju/agents/unit-landscape-client-0/charm/hooks/charmhelpers/fetch/__init__.py", line 198, in add_source
2014-09-18 07:34:50 INFO install subprocess.check_call(['add-apt-repository', '--yes', source])
2014-09-18 07:34:50 INFO install File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
2014-09-18 07:34:50 INFO install raise CalledProcessError(retcode, cmd)
2014-09-18 07:34:50 INFO install subprocess.CalledProcessError: Command '['add-apt-repository', '--yes', u'ppa:landscape/trunk']' returned non-zero exit status 1
2014-09-18 07:34:50 ERROR juju.worker.uniter uniter.go:486 hook failed: exit status 1

When I retried the hook it succeeded, so it was probably a networking error. add_source() should retry adding it, in case there are network failures.

Related branches

tags: added: cloud-installer landscape
Jorge Niedbalski (niedbalski) wrote :

Hello @adam-collard,

How recurring does this happens? Do you think the helper library should deal with possible networking errors?

Thanks

Andreas Hasenack (ahasenack) wrote :

It happens every now and then. I just got another cloud deploy where this failed, this time in the glance-simplestreams-sync charm:

2016-06-22 15:19:05 INFO install Cannot add PPA: 'ppa:landscape/glance-simplestreams-sync'.
2016-06-22 15:19:05 INFO install Please check that the PPA name or format is correct.
2016-06-22 15:19:05 INFO install Traceback (most recent call last):
2016-06-22 15:19:05 INFO install File "/var/lib/juju/agents/unit-glance-simplestreams-sync-0/charm/hooks/install", line 281, in <module>
2016-06-22 15:19:05 INFO install hooks.execute(sys.argv)
2016-06-22 15:19:05 INFO install File "/var/lib/juju/agents/unit-glance-simplestreams-sync-0/charm/hooks/charmhelpers/core/hookenv.py", line 704, in execute
2016-06-22 15:19:05 INFO install self._hooks[hook_name]()
2016-06-22 15:19:05 INFO install File "/var/lib/juju/agents/unit-glance-simplestreams-sync-0/charm/hooks/install", line 199, in install
2016-06-22 15:19:05 INFO install add_source(hookenv.config('source'), hookenv.config('key'))
2016-06-22 15:19:05 INFO install File "/var/lib/juju/agents/unit-glance-simplestreams-sync-0/charm/hooks/charmhelpers/fetch/__init__.py", line 281, in add_source
2016-06-22 15:19:05 INFO install subprocess.check_call(['add-apt-repository', '--yes', source])
2016-06-22 15:19:05 INFO install File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
2016-06-22 15:19:05 INFO install raise CalledProcessError(retcode, cmd)
2016-06-22 15:19:05 INFO install subprocess.CalledProcessError: Command '['add-apt-repository', '--yes', u'ppa:landscape/glance-simplestreams-sync']' returned non-zero exit status 1

Ursula Junque (ursinha) on 2016-08-30
Changed in autopilot-log-analyser:
status: New → In Progress
importance: Undecided → Low
assignee: nobody → Ursula Junque (ursinha)
Changed in autopilot-log-analyser:
status: In Progress → Fix Committed
Francis Ginther (fginther) wrote :
Francis Ginther (fginther) wrote :
Download full text (3.7 KiB)

Here's a better comment.

Another flavor of this: https://ci.lscape.net/job/landscape-system-tests/5198

[from landscape-0-inner-logs/glance-simplestreams-sync-0/var/log/juju/unit-glance-simplestreams-sync-0.log]
2017-02-06 15:25:41 INFO install Cannot add PPA: 'ppa:~landscape/ubuntu/glance-simplestreams-sync'.
2017-02-06 15:25:41 INFO install The team named '~landscape' has no PPA named 'ubuntu/glance-simplestreams-sync'
2017-02-06 15:25:41 INFO install Please choose from the following available PPAs:
2017-02-06 15:25:41 INFO install * '14.10': LDS 14.10
2017-02-06 15:25:41 INFO install * '15.01': LDS 15.01
2017-02-06 15:25:41 INFO install * '15.01-proxy': LDS 15.01 with proxy test
2017-02-06 15:25:41 INFO install * '15.10': LDS 15.10
2017-02-06 15:25:41 INFO install * '15.10-proxy': LDS 15.10 with proxy test
2017-02-06 15:25:41 INFO install * '15.11': LDS 15.11
2017-02-06 15:25:41 INFO install * '16.03': LDS 16.03
2017-02-06 15:25:41 INFO install * '16.06': LDS 16.06
2017-02-06 15:25:41 INFO install * 'fake-kernel': fake kernel
2017-02-06 15:25:41 INFO install * 'glance-simplestreams-sync': glance simplestreams sync
2017-02-06 15:25:41 INFO install * 'landscape-api': Landscape API client
2017-02-06 15:25:41 INFO install * 'landscape-api-staging': Landscape API client staging
2017-02-06 15:25:41 INFO install * 'landscape-client-cloud-installer': Landscape Client for the LDS Cloud Installer
2017-02-06 15:25:41 INFO install * 'lds-demo': LDS Demo
2017-02-06 15:25:41 INFO install * 'lds-preview': LDS Preview
2017-02-06 15:25:41 INFO install * 'maas-1.8.2-fix-1576253': MAAS 1.8.2 packages for #1576253
2017-02-06 15:25:41 INFO install * 'opendaylight-0.2.3': OpenDaylight Helium 0.2.3
2017-02-06 15:25:41 INFO install * 'opendaylight-0.2.4': OpenDalight Helium 0.2.4 SR4
2017-02-06 15:25:41 INFO install * 'production': Landscape client production packages
2017-02-06 15:25:41 INFO install * 'staging': Landscape client staging packages
2017-02-06 15:25:41 INFO install * 'trunk': Landscape client trunk packages
2017-02-06 15:25:41 INFO install * 'txjuju-daily': txjuju daily builds
2017-02-06 15:25:41 INFO install Traceback (most recent call last):
2017-02-06 15:25:41 INFO install File "/var/lib/juju/agents/unit-glance-simplestreams-sync-0/charm/hooks/install.real", line 290, in <module>
2017-02-06 15:25:41 INFO install hooks.execute(sys.argv)
2017-02-06 15:25:41 INFO install File "/var/lib/juju/agents/unit-glance-simplestreams-sync-0/charm/hooks/charmhelpers/core/hookenv.py", line 704, in execute
2017-02-06 15:25:41 INFO install self._hooks[hook_name]()
2017-02-06 15:25:41 INFO install File "/var/lib/juju/agents/unit-glance-simplestreams-sync-0/charm/hooks/install.real", line 206, in install
2017-02-06 15:25:41 INFO install add_source(hookenv.config('source'), hookenv.config('key'))
2017-02-06 15:25:41 INFO install File "/var/lib/juju/agents/unit-glance-simplestreams-sync-0/charm/hooks/charmhelpers/fetch/__init__.py", line 281, in add_source
2017-02-06 15:25:41 INFO install subprocess.check_call(['add-apt-repository', '--yes', source])
2017-02-06 15:25:41 INFO install File "/usr/lib/...

Read more...

Francis Ginther (fginther) wrote :
Download full text (6.3 KiB)

And yet another flavor. This one from https://ci.lscape.net/job/landscape-system-tests/5125.

[from landscape-0-inner-logs/ceilometer-0/var/log/juju/unit-landscape-client-57.log]
2017-01-28 10:08:04 INFO install gpg: keyring `/tmp/tmp9p2uy5f6/secring.gpg' created
2017-01-28 10:08:04 INFO install gpg: keyring `/tmp/tmp9p2uy5f6/pubring.gpg' created
2017-01-28 10:08:04 INFO install gpg: requesting key 4652B4E6 from hkp server keyserver.ubuntu.com
2017-01-28 10:08:14 INFO install gpgkeys: key 35F77D63B5CEC106C577ED856E85A86E4652B4E6 can't be retrieved
2017-01-28 10:08:14 INFO install gpg: no valid OpenPGP data found.
2017-01-28 10:08:14 INFO install gpg: Total number processed: 0
2017-01-28 10:08:14 INFO install gpg: keyserver communications error: keyserver helper general error
2017-01-28 10:08:14 INFO install gpg: keyserver communications error: unknown pubkey algorithm
2017-01-28 10:08:14 INFO install gpg: keyserver receive failed: unknown pubkey algorithm
2017-01-28 10:08:14 INFO install Ign:1 http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton InRele
ase
2017-01-28 10:08:14 INFO install Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
2017-01-28 10:08:14 INFO install Hit:3 http://archive.ubuntu.com/ubuntu xenial InRelease
2017-01-28 10:08:14 INFO install Get:4 http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton Releas
e [7881 B]
2017-01-28 10:08:14 INFO install Get:5 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
2017-01-28 10:08:15 INFO install Get:6 http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton Releas
e.gpg [543 B]
2017-01-28 10:08:15 INFO install Get:7 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
2017-01-28 10:08:15 INFO install Get:8 http://ppa.launchpad.net/landscape/landscape-client-cloud-installer/ubuntu xe
nial InRelease [17.6 kB]
2017-01-28 10:08:15 INFO install Get:9 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [202 kB
]
017-01-28 10:08:16 INFO install Ign:8 http://ppa.launchpad.net/landscape/landscape-client-cloud-installer/ubuntu xenial InRelease
2017-01-28 10:08:16 INFO install Get:10 http://ppa.launchpad.net/landscape/landscape-client-cloud-installer/ubuntu xenial/main amd64 Packages [864 B]
2017-01-28 10:08:16 INFO install Get:11 http://ppa.launchpad.net/landscape/landscape-client-cloud-installer/ubuntu xenial/main Translation-en [364 B]
2017-01-28 10:08:22 INFO install Fetched 536 kB in 2s (246 kB/s)
2017-01-28 10:08:24 INFO install Reading package lists...
2017-01-28 10:08:24 INFO install W: GPG error: http://ppa.launchpad.net/landscape/landscape-client-cloud-installer/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6E85A86E4652B4E6
2017-01-28 10:08:24 INFO install W: The repository 'http://ppa.launchpad.net/landscape/landscape-client-cloud-installer/ubuntu xenial InRelease' is not signed.
2017-01-28 10:08:25 INFO juju-log Installing ['landscape-client'] with options: ['--option=Dpkg::Options::=--force-confold']
2017-01-28 10:08:25 INFO install Reading package lists...
2017-01-28 10:08:25 INFO in...

Read more...

Francis Ginther (fginther) wrote :

Actually, comment #6 fits better under lp:1587606 which applies to transient add-key calls being fatal to charm completion.

Changed in autopilot-log-analyser:
status: Fix Committed → In Progress
assignee: Ursula Junque (ursinha) → Francis Ginther (fginther)
Changed in autopilot-log-analyser:
status: In Progress → Fix Committed
Changed in autopilot-log-analyser:
status: Fix Committed → In Progress
Chad Smith (chad.smith) on 2017-03-03
Changed in charm-helpers:
assignee: nobody → Chad Smith (chad.smith)
status: New → In Progress
Changed in charm-helpers:
status: In Progress → Fix Committed
status: Fix Committed → Fix Released
Changed in autopilot-log-analyser:
status: In Progress → Fix Released
Changed in landscape-client-charm:
assignee: nobody → Chad Smith (chad.smith)
status: New → In Progress
Chad Smith (chad.smith) on 2017-03-03
Changed in landscape-charm:
assignee: nobody → Chad Smith (chad.smith)
status: New → In Progress
Chad Smith (chad.smith) on 2017-03-04
Changed in glance-simplestreams-sync-charm:
status: New → In Progress
assignee: nobody → Chad Smith (chad.smith)
Changed in landscape-client-charm:
status: In Progress → Fix Released
Changed in landscape-charm:
status: In Progress → Fix Committed
James Page (james-page) wrote :

I've pushed the proposed review + a few other fixes for newer ch to:

  https://github.com/openstack-charmers/charm-glance-simplestreams-sync

which is the new location for g-ss-sync as of today.

Changed in glance-simplestreams-sync-charm:
status: In Progress → Fix Committed
Simon Poirier (simpoir) on 2019-06-07
Changed in landscape-charm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers