useless "no such file or directory" message

Bug #1633613 reported by Horacio Durán
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Invalid
Medium
Unassigned

Bug Description

while running snapcraft I get the following output

Preparing to pull caddy
Pulling caddy
Cloning into '/home/hduran/Develop/snappy/caddy/parts/caddy/src'...
remote: Counting objects: 8769, done.
remote: Compressing objects: 100% (40/40), done.
remote: Total 8769 (delta 17), reused 0 (delta 0), pack-reused 8729
Receiving objects: 100% (8769/8769), 2.18 MiB | 71.00 KiB/s, done.
Resolving deltas: 100% (5775/5775), done.
Checking connectivity... done.
go get -t -d ./github.com/mholt/caddy/...
Preparing to build caddy
Building caddy
go install ./github.com/mholt/caddy/...
Staging caddy
Priming caddy
[Errno 2] No such file or directory: '/home/hduran/Develop/snappy/caddy/prime/bin/caddy'

What am I supposed to do with this information?
I am attaching the snapcraft.yaml which I am aware is wrong but the information provided by the tool is beyond useless.

Revision history for this message
Horacio Durán (hduran-8) wrote :
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

It means you've defined an app to launch `bin/caddy`, but there is no `bin/caddy` in the `prime` directory to launch. Admittedly, this could be more friendly.

Changed in snapcraft:
status: New → Confirmed
importance: Undecided → Medium
Changed in snapcraft:
assignee: nobody → Sergio Schvezov (sergiusens)
milestone: none → 2.20
status: Confirmed → Triaged
Revision history for this message
Horacio Durán (hduran-8) wrote :

The issue I see is that I, as a rather new user to snaps and snapcraft need to take action with that information.

* The error message states something which I cannot use for possible action.
* Kyle's explanation is much better, at least it goes from plain data to information.

Now, even if the message contained what Kyle said, it still requires some cumbersome research by the user to go to action, Ideally it could be more explanatory and not assume much context, questions that I find useful to craft a decent error output in this case are:

* What is the prime directory?
* Why is it looking there?
* How was this expecting the binary to end up there?
* Can I get more debug output?

The issue ended up being the "-" in front of - bin/caddy in the last line, I am being completely naive here but I presume that dash is removing the binary from the build? that is a chance for the app to be extra user friendly and connect the dots for me assuming I am a clueless person cargo-culting a block (which I am).

Since snapcraft presents us with a declarative form of expressing a package (super cool btw) I would expect that when that process fails you treat me like someone that knows nothing about what happens inside the process, just know the declaration language.

Changed in snapcraft:
milestone: 2.20 → 2.21
Changed in snapcraft:
milestone: 2.21 → 2.22
Changed in snapcraft:
milestone: 2.22 → 2.23
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Ok, what version of snapcraft were you using?

After getting go1.7 this is what I see:

```
sergiusens@snapcraft:~/caddy$ snapcraft
Skipping pull caddy (already ran)
Preparing to build caddy
Building caddy
go install ./github.com/mholt/caddy/...
Staging caddy
Priming caddy
Snapping 'caddy' /
Snapped caddy_0.9.3_amd64.snap
```

Changed in snapcraft:
status: Triaged → Incomplete
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

I am guessing this was because before we weren't setting GOBIN and now we are and you might have had it locally exported in your environment.

Revision history for this message
Horacio Durán (hduran-8) wrote :

So, Snapcraft was 2.20+16.10
Go was either 1.6.2 or 1.7.1 (sadly I am not sure what exactly it used (my env had GOPATH/PATH set for 1.7.1 most likely.
GOBIN was not set, I never set it.

Revision history for this message
Sergio Schvezov (sergiusens) wrote : Re: [Bug 1633613] Re: useless "no such file or directory" message

El 10/11/16 a las 11:56, Horacio Durán escribió:
> So, Snapcraft was 2.20+16.10
> Go was either 1.6.2 or 1.7.1 (sadly I am not sure what exactly it used (my env had GOPATH/PATH set for 1.7.1 most likely.
> GOBIN was not set, I never set it.

Are you implying this cannot be reproduced anymore? What about running
with --debug if it is?

Revision history for this message
Horacio Durán (hduran-8) wrote :

Not directly reproduceable anymore (It did use go 1.7.2 from my current go env)
The error I see is while trying to chown stuff, perhaps it was related to that? (I upgraded the machine since then so snapcraft version most likely changed too)

Setting up part 'caddy' with plugin 'go' and properties {'stage': [], 'go-importpath': 'github.com/mholt/caddy', 'source': 'https://github.com/mholt/caddy', 'source-type': 'git', 'snap': ['bin/caddy']}.
Preparing to pull caddy
Pulling caddy
Cloning into '/tmp/testsnapcraft/parts/caddy/src'...
remote: Counting objects: 9074, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 9074 (delta 0), reused 0 (delta 0), pack-reused 9068
Receiving objects: 100% (9074/9074), 2.24 MiB | 142.00 KiB/s, done.
Resolving deltas: 100% (6000/6000), done.
Checking connectivity... done.
go get -t -d ./github.com/mholt/caddy/...
Preparing to build caddy
Building caddy
go install ./github.com/mholt/caddy/...
Staging caddy
Priming caddy
Getting dependencies for b'/tmp/testsnapcraft/prime/bin/caddy'
No libraries to exclude from this release
Unable to chown /tmp/testsnapcraft/prime/lib/x86_64-linux-gnu: [Errno 1] Operation not permitted: '/tmp/testsnapcraft/prime/lib/x86_64-linux-gnu'
Unable to chown /tmp/testsnapcraft/prime/lib/x86_64-linux-gnu: [Errno 1] Operation not permitted: '/tmp/testsnapcraft/prime/lib/x86_64-linux-gnu'
Unable to chown /tmp/testsnapcraft/prime/lib/x86_64-linux-gnu/libpthread.so.0: [Errno 1] Operation not permitted: '/tmp/testsnapcraft/prime/lib/x86_64-linux-gnu/libpthread.so.0'
Unable to chown /tmp/testsnapcraft/prime/lib/x86_64-linux-gnu: [Errno 1] Operation not permitted: '/tmp/testsnapcraft/prime/lib/x86_64-linux-gnu'
Unable to chown /tmp/testsnapcraft/prime/lib/x86_64-linux-gnu/libc.so.6: [Errno 1] Operation not permitted: '/tmp/testsnapcraft/prime/lib/x86_64-linux-gnu/libc.so.6'
Snapping 'caddy' -
Parallel mksquashfs: Using 4 processors
Creating 4.0 filesystem on caddy_0.9.3_amd64.snap, block size 131072.
[===============================================================/] 137/137 100%

Exportable Squashfs 4.0 filesystem, xz compressed, data block size 131072
 compressed data, compressed metadata, compressed fragments, no xattrs
 duplicates are removed
Filesystem size 4625.56 Kbytes (4.52 Mbytes)
 27.12% of uncompressed filesystem size (17054.05 Kbytes)
Inode table size 514 bytes (0.50 Kbytes)
 59.63% of uncompressed inode table size (862 bytes)
Directory table size 214 bytes (0.21 Kbytes)
 97.72% of uncompressed directory table size (219 bytes)
Number of duplicate files found 0
Number of inodes 10
Number of files 5
Number of fragments 1
Number of symbolic links 0
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 5
Number of ids (unique uids + gids) 1
Number of uids 1
 root (0)
Number of gids 1
 root (0)

Snapped caddy_0.9.3_amd64.snap

Changed in snapcraft:
milestone: 2.23 → none
Changed in snapcraft:
status: Incomplete → Invalid
assignee: Sergio Schvezov (sergiusens) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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