Ask Your Question
0

Sorry, an error occurred in Snapcraft: Failed to initialize rosdep: Error initializing rosdep database

asked 2020-04-09 03:04:02 -0500

Dean gravatar image

updated 2020-04-09 03:50:56 -0500

gvdhoorn gravatar image

When doing:

~/catkin_ws$ sudo snapcraft

in this page: http://wiki.ros.org/ROS/Tutorials/Pac...

received an error like these:

Sorry, an error occurred in Snapcraft:
Failed to initialize rosdep: Error initializing rosdep database:
ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down

If enter the web by hand:

https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list

will see that:

# os-specific listings first
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx

# generic
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte

# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead

My question is :

How to do to finish snapcraft?

edit retag flag offensive close merge delete

Comments

What OS version and ROS version are you using? I had this happen the other day when building on the wrong OS version for the given ROS release on accident (which I logged as a bug). However, you can avoid that if you use bases, which I just updated the tutorial to use.

kyrofa gravatar image kyrofa  ( 2020-04-09 11:27:13 -0500 )edit

OS version: ubuntu 18.04,ROS version:melodic. I just tried again,and the same errors appeared.What should I do? Thank you.

Dean gravatar image Dean  ( 2020-04-10 07:03:04 -0500 )edit

I check the command line, saw:

This snapcraft project does not specify the base keyword, explicitly setting the base keyword enables the latest snapcraft features. This project is best built on 'Ubuntu 16.04', but is building on a 'Ubuntu 18.04' host. Read more about bases at https://docs.snapcraft.io/t/base-snap...

FYI.

Dean gravatar image Dean  ( 2020-04-10 07:09:13 -0500 )edit

According to your hints, i added " base: core 18" , tried again,then i got another error, let me change the BIOS to permit vm, and i did so,and tried for more one time, it works for a very long time to do sth about vm, when it finished, i got again another error:

Failed to load plugin: properties failed to load for workspace: Additional properties are not allowed ('rosdistro' was unexpected) Run the same command again with --debug to shell into the environment if you wish to introspect this failure.

I did with --debug,and saw: Launching a VM. error: no changes of type "auto-refresh" found
snap "snapd" has no updates available Failed to load plugin: properties failed to load for workspace: Additional properties are not allowed ('rosdistro' was unexpected)

I didn't know how to do ?

Dean gravatar image Dean  ( 2020-04-10 08:51:26 -0500 )edit

Please look back through the tutorial, I updated it when I commented originally. By adding base: core18 you no longer specify the rosdistro.

kyrofa gravatar image kyrofa  ( 2020-04-10 10:10:00 -0500 )edit

Sorry about that,though I got it yesterday and tried just according to the new tutorial as belows: http://wiki.ros.org/ROS/Tutorials/Pac...

Is this tutorial you refered to yesterday? Is it updated? I didn't see sth new or different in it . I did my work according to this page all times.

Dean gravatar image Dean  ( 2020-04-10 17:57:52 -0500 )edit

Yes, it's updated. It now specifies a base and no longer specifies a rosdistro, which is the error you ran into 9 hours ago. It also explains what a base is, and how they relate to rosdistros.

kyrofa gravatar image kyrofa  ( 2020-04-10 17:59:09 -0500 )edit

Then how to solve it, so as to I can finish the whole tutorial of "Packaging your ROS project as a snap", now i can't have my snap yet.I didn't know how to to? Though I re-do accroding to the new updated tutorials,and saw the error again:

sudo snapcraft --debug
Launching a VM. error: no changes of type "auto-refresh" found
snap "snapd" has no updates available Failed to load plugin: properties failed to load for workspace: Additional properties are not allowed ('rosdistro' was unexpected)

Dean gravatar image Dean  ( 2020-04-10 18:22:01 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2020-04-10 18:31:50 -0500

kyrofa gravatar image

updated 2020-04-10 18:50:58 -0500

First of all, this error is technically a bug, but one you only hit if you're mismatching Ubuntu releases and ROS releases. Snapcraft has gained some features that help prevent that, but the tutorial didn't take advantage of them, which resulted in your attempting to build ROS Kinetic code on Ubuntu 18.04 (Bionic). I've updated the tutorial so this won't be an issue for future readers, but let me outline here what changes were necessary.

If your snapcraft.yaml specifies a base, snapcraft will build your snap in a VM that it creates on the fly (using another tool called multipass). The tutorial didn't do this, which meant that no VM was created, using your host instead.

The addition of a base also means that, at least for ROS 1 (the Catkin plugin), you no longer need to (indeed, it's an error to) specify a ROS distro, because there is only one possibility per base. If you use base: core (an Ubuntu 16.04 rootfs) you're using Kinetic. If you use base: core18 (an Ubuntu 18.04 rootfs), you're using Melodic. As a result, the workspace part in the snapcraft.yaml should look like this (note the lack of a rosdistro option):

parts:
  workspace:
    plugin: catkin
    source: .
    catkin-packages: [beginner_tutorials]
edit flag offensive delete link more

Comments

My parts doesn't look like this you listed, but is such as:

parts: workspace: build: compilers:. install: rosdep: src: state: ubuntu:

Dean gravatar image Dean  ( 2020-04-10 18:48:28 -0500 )edit

Not the directory, I'm talking about the part in the snapcraft.yaml. I edited the answer with a clarification.

kyrofa gravatar image kyrofa  ( 2020-04-10 18:50:41 -0500 )edit

I re-do from the step 1, and this time step 2 seems to work:

......

Pulling my-part
Building my-part Staging my-part Priming my-part Snapping 'my-snap-name' |
Snapped my-snap-name_0.1_amd64.snap

But doesn't work when i try step 3:

~/catkin_ws$ publisher-subscriber.roscore

Command 'publisher-subscriber.roscore' not found, but can be installed with:

sudo snap install publisher-subscriber

Dean gravatar image Dean  ( 2020-04-10 19:06:07 -0500 )edit

Did you run the sudo snap install bit? Is /snap/bin on your PATH?

kyrofa gravatar image kyrofa  ( 2020-04-10 19:14:06 -0500 )edit

In step 2:Creating a snap I did have my snap now:my-snap-name_0.1_amd64.snap

Then I begin to try step 3:Testing the snap

sudo snap install --dangerous my-snap-name_0.1_amd64.snap [sudo] dean 的pwd: error: snap "my-snap-name_0.1_amd64.snap" requires devmode or confinement override

Dean gravatar image Dean  ( 2020-04-10 19:19:06 -0500 )edit

--Did you run the sudo snap install bit?

No, I didn't.

I only did before:$ sudo snap install --classic snapcraft

--Is /snap/bin on your PATH?

Yes, i can see: /snap/bin on my computer.

Dean gravatar image Dean  ( 2020-04-10 19:25:25 -0500 )edit

error: snap "my-snap-name_0.1_amd64.snap" requires devmode or confinement override

This is a new question, how to solve it?

Dean gravatar image Dean  ( 2020-04-10 19:33:49 -0500 )edit

If you followed the tutorial, you should have confinement: strict, but it sounds like you have confinement: devmode? If so, fine, you'll just need to snap install --dangerous --devmode <path to snap>.

kyrofa gravatar image kyrofa  ( 2020-04-10 20:00:42 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2020-04-09 03:04:02 -0500

Seen: 58 times

Last updated: Apr 10