snapcraft.internal.errors.SnapcraftCommandError

Hi,
Whenever I try to run “snapcraft -d cleanbuild” or “snapcraft -d build” I get the following error:

snapcraft.internal.errors.SnapcraftCommandError: Failed to run '/home/crunch/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/usr/bin/python2 -m pip download --disable-pip-version-check --dest /home/crunch/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/python-packages Pillow Scrapy .': Exited with code 2

my snapcraft.yml parts-section looks like this:

parts:
fbuddy:
plugin: python
python-version: python2
build-packages: [cron, python2.7, python-gobject-2, python-notify, python-pip, python-tk]
python-packages: [Pillow, Scrapy]

Any help would be greatly appreciated!

You will get more user parseable output by running the commdan without --debug. The culprit to your issue probably lays some lines above that message given the run with --debug.

Here the whole stacktrace using --debug.

Exception:
Traceback (most recent call last):
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/basecommand.py", line 228, in main
    status = self.run(options, args)
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/commands/download.py", line 221, in run
    resolver.resolve(requirement_set)
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/resolve.py", line 103, in resolve
    self._resolve_one(requirement_set, req)
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/resolve.py", line 257, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/resolve.py", line 210, in _get_abstract_dist_for
    self.require_hashes
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 310, in prepare_linked_requirement
    progress_bar=self.progress_bar
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/download.py", line 824, in unpack_url
    unpack_file_url(link, location, download_dir, hashes=hashes)
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/download.py", line 700, in unpack_file_url
    shutil.copytree(link_path, location, symlinks=True)
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/usr/lib/python2.7/shutil.py", line 222, in copytree
    raise Error, errors

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/snapcraft/internal/common.py", line 67, in _run
    return runner(['/bin/sh'], stdin=run_file, **kwargs)
  File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/bin/sh']' returned non-zero exit status 2.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/bin/snapcraft", line 11, in <module>
    load_entry_point('snapcraft==2.42.1+18.4', 'console_scripts', 'snapcraft')()
  File "/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 80, in build
    _execute('build', parts, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 30, in _execute
    lifecycle.execute(command, project_options, parts)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 79, in execute
    _Executor(config, project_options).run(step, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 191, in run
    self._run_step(step, part, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 236, in _run_step
    getattr(part, step)()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 350, in pull
    self._runner.pull()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/_runner.py", line 81, in pull
    self._sourcedir)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/_runner.py", line 160, in _run_scriptlet
    scriptlet_name, function_call.strip())))
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/_runner.py", line 208, in _handle_builtin_function
    function(**function_args)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 357, in _do_pull
    self.plugin.pull()
  File "/usr/lib/python3/dist-packages/snapcraft/plugins/python.py", line 214, in pull
    self._download_project()
  File "/usr/lib/python3/dist-packages/snapcraft/plugins/python.py", line 318, in _download_project
    process_dependency_links=self.options.process_dependency_links)
  File "/usr/lib/python3/dist-packages/snapcraft/plugins/_python/_pip.py", line 245, in download
    self._python_package_dir] + args, cwd=cwd)
  File "/usr/lib/python3/dist-packages/snapcraft/plugins/_python/_pip.py", line 448, in _run
    **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/common.py", line 75, in run
    _run(cmd, subprocess.check_call, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/common.py", line 71, in _run
    call_error=call_error) from call_error
snapcraft.internal.errors.SnapcraftCommandError: Failed to run '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/usr/bin/python2 -m pip download --disable-pip-version-check --dest /home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/python-packages Pillow Scrapy .': Exited with code 2.

An other explanation I can think of is if there is something wrong with “packages” and “package_dir” definitions in setup.py…

version=‘0.0.1’,
packages=[’’, ‘’, ‘spiders’],
#package_dir={’’: ‘spiders’},
url=‘https://mysite.com/’,
license=‘GPL’,
author=‘roland’,

What is the meaning of to empty entries in packages? Why are you not using proper single quotes '? Last, does pip install . of your project work in a venv? The actual error is probably printed much above, have you run without --debug? This is an actual error during execution and not from something deeply inside snapcraft in order to need to use --debug.

I don’t know the meaning of the empty packages. They where generated automatically. At least they don’t seem the have any influence on running pip install .: Here the output

Processing /home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline
Building wheels for collected packages: facebookbuddy
  Running setup.py bdist_wheel for facebookbuddy ... done
  Stored in directory: /tmp/pip-ephem-wheel-cache-DZ665Q/wheels/63/45/d0/c348f6212748f9193fed5035b0b0cc56e8588b643498af13dc
Successfully built facebookbuddy
Installing collected packages: facebookbuddy
Successfully installed facebookbuddy-0.0.1

also when I run snapcraft build without --debug I get:
Preparing to pull facebook
Pulling facebook
Failed to run ‘/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/usr/bin/python2 -m pip’: Exited with code 1.

again with --debug output starts like this:
Preparing to pull facebook
Running on ‘bionic’
Pulling facebook
snapcraft is running as a snap False, SNAP_NAME set to ‘’
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/snapcraft/internal/common.py”, line 67, in _run
return runner([’/bin/sh’], stdin=run_file, **kwargs)
File “/usr/lib/python3.6/subprocess.py”, line 336, in check_output
**kwargs).stdout
File “/usr/lib/python3.6/subprocess.py”, line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘[’/bin/sh’]’ returned non-zero exit status 1.

The above exception was the direct cause of the following exception:
... 

I am totally stuck.

Do you have your sources up anywhere to look at?

The empty packages comment came from reading your snippets of setup.py.

No - not yet. Here a screenshot of the project directory though.

Let me know what file might be causing this and I’ll show you its contents. Thanks again!

and here another exception which is raised when running: snapcraft --debug build:

Processing /home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src Exception: Traceback (most recent call last): File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/basecommand.py", line 228, in main status = self.run(options, args) File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/commands/download.py", line 221, in run resolver.resolve(requirement_set) File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/resolve.py", line 103, in resolve self._resolve_one(requirement_set, req) File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/resolve.py", line 257, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/resolve.py", line 210, in _get_abstract_dist_for self.require_hashes File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 310, in prepare_linked_requirement progress_bar=self.progress_bar File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/download.py", line 824, in unpack_url unpack_file_url(link, location, download_dir, hashes=hashes) File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/download.py", line 700, in unpack_file_url shutil.copytree(link_path, location, symlinks=True) File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/usr/lib/python2.7/shutil.py", line 222, in copytree raise Error, errors Error: [(

shutil.py line 22 …?

@spicyroland, as @sergiusens has said a few times, the real error is above the traceback, but all you’re providing is the traceback. Please, we need the entire output, not just the part you believe is relevant, or we simply don’t have the information we need to help you.

@kyrofa ok here the entire output.
First I always make a clean build using: sudo snapcraft --debug cleanbuild. But here I always get an error saying that it cannot find my fbuddy.desktop file.

Priming facebook 
Files from the build host were migrated into the snap to satisfy dependencies that would otherwise not be met. This feature will be removed in a future release. If these libraries are needed in the final snap, ensure that the following are either satisfied by a stage-packages entry or through a part:
usr/lib/x86_64-linux-gnu/libdb-5.3.so
Failed to generate snap metadata: The path 'prime/fbuddy.desktop' set for 'desktop' in 'fbuddy' does not exist. Make sure that the files are in the `prime` directory.
Debug mode enabled, dropping into a shell
root@snapcraft-purely-choice-cod:~# 

next I always exit the lxd container - in this case root@snapcraft-purely-coice-cod and run a normal build using sudo snapcraft --debug build. Here the intire output of this command:

Setting up part 'facebook' with plugin 'python' and properties {'plugin': 'python', 'python-version': 'python2', 'build-packages': ['cron', 'python-setuptools', 'python-gobject-2', 'python-notify', 'python-pip', 'python-tk'], 'stage': [], 'prime': []}.
Marking 'python-setuptools' (and its dependencies) to be fetched
Marking 'python-dev' (and its dependencies) to be fetched
Marking 'python-tk' (and its dependencies) to be fetched
Marking 'python-pip' (and its dependencies) to be fetched
Marking 'python-gobject-2' (and its dependencies) to be fetched
Marking 'python-pkg-resources' (and its dependencies) to be fetched
Marking 'cron' (and its dependencies) to be fetched
Marking 'python-notify' (and its dependencies) to be fetched
Preparing to pull facebook 
Running on 'bionic'
Pulling facebook 
snapcraft is running as a snap False, SNAP_NAME set to ''
The directory '/home/rolonso/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/rolonso/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/rolonso/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/rolonso/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Processing /home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src

Exception:
Traceback (most recent call last):
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/basecommand.py", line 228, in main
    status = self.run(options, args)
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/commands/download.py", line 221, in run
    resolver.resolve(requirement_set)
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/resolve.py", line 103, in resolve
    self._resolve_one(requirement_set, req)
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/resolve.py", line 257, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/resolve.py", line 210, in _get_abstract_dist_for
    self.require_hashes
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 310, in prepare_linked_requirement
    progress_bar=self.progress_bar
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/download.py", line 824, in unpack_url
    unpack_file_url(link, location, download_dir, hashes=hashes)
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/lib/python2.7/site-packages/pip/_internal/download.py", line 700, in unpack_file_url
    shutil.copytree(link_path, location, symlinks=True)
  File "/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/usr/lib/python2.7/shutil.py", line 222, in copytree
    raise Error, errors
Error: [('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/database/boavista_friends.db', '/tmp/pip-req-build-ITZdEJ/database/boavista_friends.db', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/database/boavista_friends.db'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/database/buendner_friends.db', '/tmp/pip-req-build-ITZdEJ/database/buendner_friends.db', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/database/buendner_friends.db'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/database/console.sql', '/tmp/pip-req-build-ITZdEJ/database/console.sql', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/database/console.sql'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/database/friends.db', '/tmp/pip-req-build-ITZdEJ/database/friends.db', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/database/friends.db'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/facebookbuddy_source.tar.bz2', '/tmp/pip-req-build-ITZdEJ/facebookbuddy_source.tar.bz2', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/facebookbuddy_source.tar.bz2'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/facebookfriends.py', '/tmp/pip-req-build-ITZdEJ/facebookfriends.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/facebookfriends.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/addfriend-button.png', '/tmp/pip-req-build-ITZdEJ/images/addfriend-button.png', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/addfriend-button.png'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/fbuddy.png', '/tmp/pip-req-build-ITZdEJ/images/fbuddy.png', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/fbuddy.png'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/fbuddy.svg', '/tmp/pip-req-build-ITZdEJ/images/fbuddy.svg', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/fbuddy.svg'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/goa-account-facebook.png', '/tmp/pip-req-build-ITZdEJ/images/goa-account-facebook.png', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/goa-account-facebook.png'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/noprofile_image.jpg', '/tmp/pip-req-build-ITZdEJ/images/noprofile_image.jpg', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/noprofile_image.jpg'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/noprofile_image.png', '/tmp/pip-req-build-ITZdEJ/images/noprofile_image.png', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/noprofile_image.png'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/scrapy.png', '/tmp/pip-req-build-ITZdEJ/images/scrapy.png', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/scrapy.png'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/scrapy_cropped.png', '/tmp/pip-req-build-ITZdEJ/images/scrapy_cropped.png', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/images/scrapy_cropped.png'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/items.py', '/tmp/pip-req-build-ITZdEJ/items.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/items.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/items.pyc', '/tmp/pip-req-build-ITZdEJ/items.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/items.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/LICENSE', '/tmp/pip-req-build-ITZdEJ/LICENSE', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/LICENSE'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/logs/log.txt', '/tmp/pip-req-build-ITZdEJ/logs/log.txt', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/logs/log.txt'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/logs/_xhr_scroll_request_facebook', '/tmp/pip-req-build-ITZdEJ/logs/_xhr_scroll_request_facebook', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/logs/_xhr_scroll_request_facebook'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/middlewares.py', '/tmp/pip-req-build-ITZdEJ/middlewares.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/middlewares.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/middlewares.pyc', '/tmp/pip-req-build-ITZdEJ/middlewares.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/middlewares.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/multi-actions.py', '/tmp/pip-req-build-ITZdEJ/multi-actions.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/multi-actions.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/pipelines.py', '/tmp/pip-req-build-ITZdEJ/pipelines.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/pipelines.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/pipelines.pyc', '/tmp/pip-req-build-ITZdEJ/pipelines.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/pipelines.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/README.md', '/tmp/pip-req-build-ITZdEJ/README.md', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/README.md'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/settings.py', '/tmp/pip-req-build-ITZdEJ/settings.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/settings.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/settings.pyc', '/tmp/pip-req-build-ITZdEJ/settings.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/settings.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/setup.py', '/tmp/pip-req-build-ITZdEJ/setup.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/setup.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/base.py', '/tmp/pip-req-build-ITZdEJ/spiders/base.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/base.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/base.pyc', '/tmp/pip-req-build-ITZdEJ/spiders/base.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/base.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/friendslist.py', '/tmp/pip-req-build-ITZdEJ/spiders/friendslist.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/friendslist.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/friendslist.pyc', '/tmp/pip-req-build-ITZdEJ/spiders/friendslist.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/friendslist.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/latestpost.py', '/tmp/pip-req-build-ITZdEJ/spiders/latestpost.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/latestpost.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/latestpost.pyc', '/tmp/pip-req-build-ITZdEJ/spiders/latestpost.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/latestpost.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/mobilefriends.py', '/tmp/pip-req-build-ITZdEJ/spiders/mobilefriends.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/mobilefriends.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/mobilefriends.pyc', '/tmp/pip-req-build-ITZdEJ/spiders/mobilefriends.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/mobilefriends.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/timeline.py', '/tmp/pip-req-build-ITZdEJ/spiders/timeline.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/timeline.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/timeline.pyc', '/tmp/pip-req-build-ITZdEJ/spiders/timeline.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/timeline.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/__init__.py', '/tmp/pip-req-build-ITZdEJ/spiders/__init__.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/__init__.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/__init__.pyc', '/tmp/pip-req-build-ITZdEJ/spiders/__init__.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/__init__.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/__pycache__/timeline - Copy.cpython-36.pyc', '/tmp/pip-req-build-ITZdEJ/spiders/__pycache__/timeline - Copy.cpython-36.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/__pycache__/timeline - Copy.cpython-36.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/__pycache__/timeline.cpython-36.pyc', '/tmp/pip-req-build-ITZdEJ/spiders/__pycache__/timeline.cpython-36.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/__pycache__/timeline.cpython-36.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/__pycache__/__init__.cpython-36.pyc', '/tmp/pip-req-build-ITZdEJ/spiders/__pycache__/__init__.cpython-36.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/spiders/__pycache__/__init__.cpython-36.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/tools.py', '/tmp/pip-req-build-ITZdEJ/tools.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/tools.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/tools.pyc', '/tmp/pip-req-build-ITZdEJ/tools.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/tools.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/__init__.py', '/tmp/pip-req-build-ITZdEJ/__init__.py', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/__init__.py'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/__init__.pyc', '/tmp/pip-req-build-ITZdEJ/__init__.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/__init__.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/__pycache__/settings.cpython-36.pyc', '/tmp/pip-req-build-ITZdEJ/__pycache__/settings.cpython-36.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/__pycache__/settings.cpython-36.pyc'"), ('/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/__pycache__/__init__.cpython-36.pyc', '/tmp/pip-req-build-ITZdEJ/__pycache__/__init__.cpython-36.pyc', "[Errno 5] Input/output error: '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/src/__pycache__/__init__.cpython-36.pyc'")]

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/snapcraft/internal/common.py", line 67, in _run
    return runner(['/bin/sh'], stdin=run_file, **kwargs)
  File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/bin/sh']' returned non-zero exit status 2.`

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/bin/snapcraft", line 11, in <module>
    load_entry_point('snapcraft==2.42.1+18.4', 'console_scripts', 'snapcraft')()
  File "/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 80, in build
    _execute('build', parts, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 30, in _execute
    lifecycle.execute(command, project_options, parts)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 79, in execute
    _Executor(config, project_options).run(step, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 191, in run
    self._run_step(step, part, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 236, in _run_step
    getattr(part, step)()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 350, in pull
    self._runner.pull()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/_runner.py", line 81, in pull
    self._sourcedir)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/_runner.py", line 160, in _run_scriptlet
    scriptlet_name, function_call.strip())))
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/_runner.py", line 208, in _handle_builtin_function
    function(**function_args)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 357, in _do_pull
    self.plugin.pull()
  File "/usr/lib/python3/dist-packages/snapcraft/plugins/python.py", line 214, in pull
    self._download_project()
  File "/usr/lib/python3/dist-packages/snapcraft/plugins/python.py", line 318, in _download_project
    process_dependency_links=self.options.process_dependency_links)
  File "/usr/lib/python3/dist-packages/snapcraft/plugins/_python/_pip.py", line 245, in download
    self._python_package_dir] + args, cwd=cwd)
  File "/usr/lib/python3/dist-packages/snapcraft/plugins/_python/_pip.py", line 448, in _run
    **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/common.py", line 75, in run
    _run(cmd, subprocess.check_call, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/common.py", line 71, in _run
    call_error=call_error) from call_error
snapcraft.internal.errors.SnapcraftCommandError: Failed to run '/home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/install/usr/bin/python2 -m pip download --disable-pip-version-check --dest /home/rolonso/Dropbox/Private/FacebookTimeline/FacebookTimeline/parts/facebook/python-packages .': Exited with code 2.

and finally here the contents of my snapcraft.yaml:

version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: The Facebook Buddy - follow someone's facebook timeline # 79 char long summary
description: |
  With this tool you can:
  1. search for users on facebook.
  2. search through a users friendslist using a url in the format [m.facebook.com/<username>/friends].
  3. follow/unfollow (track) facebookusers.
  4. get notified whenever someone you follow posts something on his/her timeline.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots
icon: images/fbuddy.png

apps:
  fbuddy:
    command: fbuddy
    plugs: [network, x11]
    desktop: fbuddy.desktop

parts:
  facebook:
     plugin: python 
     python-version: python2
     build-packages: [cron, python-setuptools, python-gobject-2, python-notify, python-pip, python-tk]

I also tried putting fbuddy.desktop directly inside the prime-directory as suggested but still - the same error saying

Failed to generate snap metadata: The path ‘prime/fbuddy.desktop’ set for ‘desktop’ in ‘fbuddy’ does not exist. Make sure that the files are in the prime directory

so finally I commented the line #desktop: fbuddy.desktop and ran the build again: No it says:

Failed to generate snap metadata: The specified command ‘fbuddy’ defined in the app ‘fbuddy’ does not exist or is not executable

I don’t understand - what’s wrong with my apps definition? Thanks for your help!

Can you please edit your post and surround the pasted output with three backticks (```)? It’s incredibly hard to parse otherwise.

@kyrofa ah sorry for that - changed it!

Just a guess, but can you try doing this outside of your dropbox folder?

1 Like