[2.0b5] sudo: no tty present and no askpass program specified

Bug #1588857 reported by mahmoh
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Expired
Low
Unassigned

Bug Description

2.0.0~beta5+bzr5026-0ubuntu1~xenial1

2016-06-03 14:55:41+0000 [-] Unhandled Error
 Traceback (most recent call last):
   File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 434, in errback
     self._startRunCallbacks(fail)
   File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 501, in _startRunCallbacks
     self._runCallbacks()
   File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 588, in _runCallbacks
     current.result = callback(current.result, *args, **kw)
   File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1184, in gotResult
     _inlineCallbacks(r, g, deferred)
 --- <exception caught here> ---
   File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1126, in _inlineCallbacks
     result = result.throwExceptionIntoGenerator(g)
   File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
     return g.throw(self.type, self.value, self.tb)
   File "/usr/lib/python3/dist-packages/provisioningserver/rpc/boot_images.py", line 142, in _import_boot_images
     imported = yield deferToThread(_run_import, sources, **proxies)
   File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 246, in inContext
     result = inContext.theWork()
   File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 262, in <lambda>
     inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
   File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 118, in callWithContext
     return self.currentContext().callWithContext(ctx, func, *args, **kw)
   File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 81, in callWithContext
     return func(*args,**kw)
   File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 205, in wrapper
     return func(*args, **kwargs)
   File "/usr/lib/python3/dist-packages/provisioningserver/rpc/boot_images.py", line 116, in _run_import
     imported = boot_resources.import_images(sources)
   File "/usr/lib/python3/dist-packages/provisioningserver/import_images/boot_resources.py", line 275, in import_images
     sources, storage, product_mapping)
   File "/usr/lib/python3/dist-packages/provisioningserver/import_images/download_resources.py", line 287, in download_all_boot_resources
     keyring_file=source.get('keyring')),
   File "/usr/lib/python3/dist-packages/provisioningserver/import_images/download_resources.py", line 233, in download_boot_resources
     writer.sync(reader, rpath)
   File "/usr/lib/python3/dist-packages/simplestreams/mirrors/__init__.py", line 89, in sync
     return self.sync_index(reader, path, data, content)
   File "/usr/lib/python3/dist-packages/simplestreams/mirrors/__init__.py", line 236, in sync_index
     self.sync(reader, path=epath)
   File "/usr/lib/python3/dist-packages/simplestreams/mirrors/__init__.py", line 87, in sync
     return self.sync_products(reader, path, data, content)
   File "/usr/lib/python3/dist-packages/simplestreams/mirrors/__init__.py", line 323, in sync_products
     self.insert_item(item, src, target, pgree, ipath_cs)
   File "/usr/lib/python3/dist-packages/provisioningserver/import_images/download_resources.py", line 201, in insert_item
     self.store, tag, checksums, size, contentsource)
   File "/usr/lib/python3/dist-packages/provisioningserver/import_images/download_resources.py", line 122, in insert_root_image
     call_uec2roottar(root_image_path, root_tgz_path)
   File "/usr/lib/python3/dist-packages/provisioningserver/import_images/download_resources.py", line 84, in call_uec2roottar
     root_tgz_path,
   File "/usr/lib/python3/dist-packages/provisioningserver/utils/shell.py", line 129, in call_and_check
     raise ExternalProcessError(process.returncode, command, output=stderr)
 provisioningserver.utils.shell.ExternalProcessError: Command `sudo /usr/bin/uec2roottar --user=maas /var/lib/maas/boot-resources/cache/root-image-78c4caf368edf45272fedf7c74b3c29d8a8c74b8e526710f09a1b59488784188 /var/lib/maas/boot-resources/cache/root-tgz-78c4caf368edf45272fedf7c74b3c29d8a8c74b8e526710f09a1b59488784188` returned non-zero exit status 1:
 sudo: no tty present and no askpass program specified

Revision history for this message
mahmoh (mahmoh) wrote :
Changed in maas:
milestone: none → 2.0.0
importance: Undecided → Critical
Revision history for this message
mahmoh (mahmoh) wrote :
Download full text (5.2 KiB)

Ran the sudo command to extract the image manually then hit this, is this a new bug? This is all happening in a VM btw, not that it should make a difference:

84188 /var/lib/maas/boot-resources/cache/root-tgz-78c4caf368edf45272fedf7c74b3c29d8a8c74b8e526710f09a1b59488784188` returned non-zero exit status 1:
 sudo: no tty present and no askpass program specified

2016-06-03 15:08:39+0000 [-] Downloading images failed.
 Traceback (most recent call last):
   File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 434, in errback
     self._startRunCallbacks(fail)
   File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 501, in _startRunCallbacks
     self._runCallbacks()
   File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 588, in _runCallbacks
     current.result = callback(current.result, *args, **kw)
   File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1184, in gotResult
     _inlineCallbacks(r, g, deferred)
 --- <exception caught here> ---
   File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1126, in _inlineCallbacks
     result = result.throwExceptionIntoGenerator(g)
   File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
     return g.throw(self.type, self.value, self.tb)
   File "/usr/lib/python3/dist-packages/provisioningserver/pserv_services/image_download_service.py", line 121, in maybe_start_download
     yield self._start_download()
   File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1126, in _inlineCallbacks
     result = result.throwExceptionIntoGenerator(g)
   File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
     return g.throw(self.type, self.value, self.tb)
   File "/usr/lib/python3/dist-packages/provisioningserver/pserv_services/image_download_service.py", line 112, in _start_download
     get_proxy_url("https"))
   File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1126, in _inlineCallbacks
     result = result.throwExceptionIntoGenerator(g)
   File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
     return g.throw(self.type, self.value, self.tb)
   File "/usr/lib/python3/dist-packages/provisioningserver/rpc/boot_images.py", line 142, in _import_boot_images
     imported = yield deferToThread(_run_import, sources, **proxies)
   File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 246, in inContext
     result = inContext.theWork()
   File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 262, in <lambda>
     inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
   File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 118, in callWithContext
     return self.currentContext().callWithContext(ctx, func, *args, **kw)
   File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 81, in callWithContext
     return func(*args,**kw)
   File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 205, in wrapper
     return func(*args, **kwargs)
   Fil...

Read more...

Revision history for this message
mahmoh (mahmoh) wrote :

^vmbuilder VM.

Revision history for this message
Blake Rouse (blake-rouse) wrote :

You are getting all these errors because of a bad or missing sudoers file. Same reason you for bug 1588868.

This means your sudoers file is incorrect for your installation of MAAS. Check the contents of:

/etc/sudoers.d/99-maas

Is this a fresh install or upgrade?

Is this in a container or on a host?

Changed in maas:
status: New → Incomplete
Revision history for this message
mahmoh (mahmoh) wrote :

Hi Blake,

There were two sudoers files and they both had what looked like complete entries, attached.

Revision history for this message
mahmoh (mahmoh) wrote :

We installed b5 on metal and it appears to be working fine, this problem is very reproducible using this script which relies on vmbuilder:

https://github.com/jmcdice/ubuntu-os-cloud

Changed in maas:
status: Incomplete → New
Revision history for this message
Blake Rouse (blake-rouse) wrote :

I would say then vmbuilder is doing something wierd. The user should not be "maas" for the installing user. "maas" should be reserved for MAAS. As sudoers will then override the "maas" users to be incorrect.

Changed in maas:
status: New → Incomplete
Revision history for this message
mahmoh (mahmoh) wrote :

@Blake, the user was joey and not maas. vmbuilder may be doing some odd things but maas should still work in the VM I'd argue no matter what and this is a great way to automate a maas install. The question is who's going to dig into the problem to see what's actually happening? That git repo has all the code and can easily reproduce the problem, maybe after 2.0 is released?

Revision history for this message
Mike Pontillo (mpontillo) wrote :

For what it's worth, I have my own scripts which deploy MAAS onto a VM based on a cloud image, and don't see this issue there.

Changed in maas:
importance: Critical → Low
milestone: 2.0.0 → none
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for MAAS because there has been no activity for 60 days.]

Changed in maas:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.