Libc6 not found


#1

When I’m building my snap I’m getting the following error dispite my snapcraft having libc6 included:

Error

Priming tomcat 
'libc6' is required inside th e snap for this part to 
work properly.
Add it as a `stage-packages` entry for this part.

And my snapcraft.yaml

name: orion-monitor # you probably want to 'snapcraft register <name>'
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: monitoring of orion vms.
description: | 
  OrionMonitor is a webapp designed to monitor Orion Vms and stop/start them
  when they are not required.

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


apps:
  pi-gation:
    command: orion-monitor-launch
    daemon: simple
    plugs: [network, network-bind]

hooks:
  install:
    plugs: []

  configure:
    plugs: []

parts: 
  # build the web app
  orion-monitor-webapp:
    plugin: maven
    source: git@bitbucket.org:sbsutton/orionmonitor.git
    maven-options:
      [-DskipTests=true]
    organize:
      war/orionmonitor-1.0-SNAPSHOT.war : webapps/orionmonitor.war
    after: [tomcat]

  # copies the files in snap/src/scripts/ to 
  # the root of the snap directory - snap/
  pi-gation-launch:
    plugin: dump
    source: snap/src/scripts
    after: [tomcat, orion-monitor-webapp]
    stage-packages:
      - libc6

#2

@sergiusens Any ideas here ^


#3

Just and update.
So I think the error was generated by the after: [tomcat] as that included java which is the package that I would expect would need -libc6.

I’ve pull the tomcat part directly into my snapcraft.yaml and added the libc6 to that part directly which solved the problem.

The question still seems to be why its required at all.

Note: I’m running ubuntu 17.10 and I’m begging to think that snapcraft doesn’t work so well on 17.10.
Apart from this error I’m also getting a core dump (detailed elsewhere) which I fixed by spooling up a 16.04 server.


#4

Correct, on 17.10 you can cleanbuild; not much else will work. All these requests to add libc6 that you see while running snapcraft from edge are to make it closer to something tangible.


#5

Could the error message not perhaps suggest to use cleanbuild ?


#6

Yes, we have design for that, but I need to iron out this requested libc6 feature which is taking longer than expected.


#7

Perhaps the community needs to be a little more fourth right in saying that
17.10 isn’t stable. I’ve wasted a lot of time buildng on 17.10 as all the
doc says it works on a broad range of OSs. I would never have guessed test
17.10 was going to be an issue.


#8

17.10 is stable if you use snapcraft correctly on it, as i said before, there seems to be a documentation problem.

you have to use cleanbuild on every release that is not 16.04, there is no “issue” with 17.10 only with the way you used snapcraft (which exposes that the docs did not give you the correct information).


#9

This issue still happens in 18.04 bionic.


#10

@bitseater on Ubuntu 18.04 you must use cleanbuild or have the variable for experimental persistent LXD containers exported to your shell’s environment: export SNAPCRAFT_BUILD_ENVIRONMENT=lxd. Both use LXD to build your snap, so you need to install and configure LXD first.


#11

Thanks @daniel I’ll try this way