Build error, npm@latest

Hi,
what is cause of this build error?
https://launchpadlibrarian.net/380357387/buildlog_snap_ubuntu_xenial_amd64_wekan-devel_BUILDING.txt.gz

[27/Jul/2018:18:33:54 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 503 1777 "-" "-"
[27/Jul/2018:18:34:04 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 503 1777 "-" "-"
[27/Jul/2018:18:35:04 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 503 1777 "-" "-"
npm ERR! code E503
npm ERR! 503 Service Unavailable: npm@latest

@lucyllewy

But how can it be fixed? Is snapcraft build service unable to download npm@latest

Looks like that could be this bug https://bugs.launchpad.net/launchpad-buildd/+bug/1781970

I’m trying to build snap in Docker, and I got this error:

lifecycle that generated the following traceback:
Traceback (most recent call last):
  File "/usr/bin/snapcraft", line 9, in <module>
    load_entry_point('snapcraft==2.42.1', 'console_scripts', 'snapcraft')()
  File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1037, in invoke
    return Command.invoke(self, ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/_runner.py", line 79, in run
    ctx.forward(lifecyclecli.commands['snap'])
  File "/usr/lib/python3/dist-packages/click/core.py", line 552, in forward
    return self.invoke(cmd, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 135, in snap
    project_options, directory=directory, output=output)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_packer.py", line 46, in snap
    execute('prime', project_options)
  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 549, in stage                                    self._runner.stage()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/_runner.py", line 110, in stage
    self._stagedir)
  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 568, in _do_stage
    self.stagedir, fixup_func=fixup_func)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 918, in _migrate_files
    os.remove(dst)
IsADirectoryError: [Errno 21] Is a directory: '/home/wekan/repos/wekan/stage/lib'

Is there any working way to currently build Wekan snap?
I have tried:

  • Canonical’s build service
  • docker
  • lxc
  • vagrant / VirtualBox Ubuntu 16.04 VM

And everything is broken.

We can’t help without seeing your snapcraft.yaml and the error message that building with that specific yaml emits. Saying “everything is broken” doesn’t give us enough information about what the problem is. For example, are you talking about the error that caused you to start this thread where npm could not access it’s repository, or are you referring to the error where snapcraft tells you it can’t overwrite a directory with a file, or is there a different error that you haven’t told us about?

@lucyllewy

Yes, npm install step does not work, build error log link is first at this forum post.

snapcraft.yaml is here:

https://github.com/wekan/wekan/blob/devel/snapcraft.yaml

When I tried to build that snap using docker image provided at snapcraft documentation website, it gave python error above.

I would like to know how I can manually build snap package, so I can upload it to store. This is because I’m unable to solve snapcraft build service error, because it can’t install latest npm. I can build wekan from source and docker just fine, npm install does work, just not on canonical’s build service.

Here is info how I build releases using snap build service usually:

Latest build log is here:
https://code.launchpad.net/~wekan-team/+snap/wekan-devel/+build/291546/+files/buildlog_snap_ubuntu_xenial_amd64_wekan-devel_BUILDING.txt.gz

Looking at your snapcraft.yaml you’re installing npm from a Debian package (build-packages), then using that npm to attempt to install npm (node-packages) which is failing (I assume because you don’t have write access to /usr/local)

Please consider where you want to get npm from. You could stick with the Ubuntu archive (build-packages) or try the snap (build-snaps). Note that your snapcraft.yaml suggests you want to get node 8.11.3 which is the version in the 8/latest channel of the node snap!