Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make run-docker is buggy on linux #414

Closed
gouthamve opened this issue Dec 11, 2016 · 6 comments · Fixed by #471
Closed

make run-docker is buggy on linux #414

gouthamve opened this issue Dec 11, 2016 · 6 comments · Fixed by #471
Assignees
Labels
Milestone

Comments

@gouthamve
Copy link
Contributor

Running make run-docker twice on a linux box gives me this:

set -ex
docker run --rm -v /home/goutham/gocode/src/github.com/iron-io/functions:/go/src/github.com/iron-io/functions -w /go/src/github.com/iron-io/functions iron/go:dev go build -o functions-alpine
docker build -t iron/functions:latest .
Error checking context: 'no permission to read from '/home/goutham/gocode/src/github.com/iron-io/functions/data/bolt.db''.
make: *** [Makefile:14: build-docker] Error

I have to delete the data folder every time. Works well on the Mac though.

@seiflotfy
Copy link
Contributor

Will test it on Linux in a bit. Thanks for the catch :D

@seiflotfy seiflotfy self-assigned this Dec 11, 2016
@ucirello ucirello added this to the Alpha 2 milestone Dec 11, 2016
@ucirello ucirello added the bug label Dec 11, 2016
@treeder treeder assigned rdallman and unassigned seiflotfy Dec 28, 2016
@ucirello ucirello assigned ucirello and rdallman and unassigned rdallman and ucirello Dec 28, 2016
@rdallman
Copy link
Contributor

Hi @gouthamve thanks for filing, I'm having trouble reproducing this issue (specifically as it pertains to being a bug in running in a linux environment) as outlined. It seems to be a simple permissions issue but it could be something sneaky with docker filesystem drivers or such. It seems like at a minimum whichever user you are running the command as (and maybe the docker user / group) needs to own the directory /home/goutham/gocode/src/github.com/iron-io/functions and its children, ala $ chown -R $user:$group .. I think we need more info, perhaps if I post my info something will stick out as different from yours and will help you debug your system. If you could post some additional information about your directory you linked /home/goutham/gocode/src/github.com/iron-io/functions and your docker version we may be able to help further debug here. Here is my system info:

functions(master) ✗: uname -a
Linux debian 4.8.0-2-amd64 #1 SMP Debian 4.8.11-1 (2016-12-02) x86_64 GNU/Linux
functions(master) ✗: groups reed
reed : reed cdrom floppy sudo audio dip video plugdev netdev bluetooth docker
functions(master) ✗: ls -alh
total 37M
drwxr-xr-x 12 reed reed 4.0K Dec 28 18:36 .
drwxr-xr-x 20 reed reed 4.0K Dec  4 22:02 ..
drwxr-xr-x  7 reed reed 4.0K Dec 28 18:34 api
-rw-r--r--  1 reed reed  626 Dec 28 18:34 build.ps1
-rw-r--r--  1 reed reed 1.3K Dec 28 18:34 circle.yml
drwxr-xr-x  2 reed reed 4.0K Dec 28 18:34 clients
-rw-r--r--  1 reed reed 1.3K Dec 28 18:34 CONTRIBUTING.md
drwxr-xr-x  2 reed reed 4.0K Oct 20 12:12 data
-rw-r--r--  1 reed reed  811 Dec 28 18:34 doc.go
-rw-r--r--  1 reed reed   87 Dec 28 18:34 Dockerfile
drwxr-xr-x  9 reed reed 4.0K Dec 28 18:34 docs
drwxr-xr-x 16 reed reed 4.0K Dec 28 18:34 examples
drwxr-xr-x  3 reed reed 4.0K Dec 28 18:34 fn
drwxr-xr-x  5 reed reed 4.0K Dec 28 18:34 fnctl
-rwxr-xr-x  1 reed reed  17M Sep 30 12:01 functions
-rwxr-xr-x  1 root root  20M Dec 28 18:36 functions-alpine
drwxr-xr-x  8 reed reed 4.0K Dec 28 18:47 .git
-rw-r--r--  1 reed reed  209 Oct 18 09:50 .gitignore
-rw-r--r--  1 reed reed 8.9K Dec 28 18:34 glide.lock
-rw-r--r--  1 reed reed  972 Dec 28 18:34 glide.yaml
-rw-r--r--  1 reed reed  12K Dec 28 18:34 LICENSE
-rw-r--r--  1 reed reed 2.6K Dec 28 18:34 main.go
-rw-r--r--  1 reed reed 1.1K Dec 28 18:34 Makefile
-rw-r--r--  1 reed reed 9.7K Dec 28 18:34 README.md
-rwxr-xr-x  1 reed reed  846 Dec 28 18:34 release.sh
-rw-r--r--  1 reed reed  270 Dec 28 18:34 THIRD_PARTY
drwxr-xr-x  3 reed reed 4.0K Dec 28 18:34 triggers
drwxr-xr-x  5 reed reed 4.0K Dec 28 18:35 vendor
functions(master) ✗: docker info
Containers: 1
 Running: 0
 Paused: 0
 Stopped: 1
Images: 280
Server Version: 1.12.5
Storage Driver: devicemapper
 Pool Name: docker-8:1-662746-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: ext4
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 8.153 GB
 Data Space Total: 107.4 GB
 Data Space Available: 2.631 GB
 Metadata Space Used: 13.48 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.134 GB
 Thin Pool Minimum Free Space: 10.74 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.137 (2016-11-30)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: host bridge overlay null
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.8.0-2-amd64
Operating System: Debian GNU/Linux stretch/sid
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.957 GiB
Name: debian
ID: 3XYF:K5X3:NOD2:25IM:3WYV:QKFS:DLQ4:5LLC:36E5:ZNPJ:3J4P:EWPB
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: rdallman
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
 127.0.0.0/8

@gouthamve
Copy link
Contributor Author

gouthamve commented Dec 29, 2016

Yep, I am still able to reproduce after a fresh clone.

Here is my system info:

➜  functions git:(master) uname -a
Linux beast 4.8.13-1-ARCH #1 SMP PREEMPT Fri Dec 9 07:24:34 CET 2016 x86_64 GNU/Linux
➜  functions git:(master) groups goutham
wheel docker goutham
➜  functions git:(master) ls -alh
total 20M
drwxr-xr-x 11 goutham goutham 4.0K Dec 29 09:52 .
drwxr-xr-x  3 goutham goutham 4.0K Dec 29 09:49 ..
drwxr-xr-x  7 goutham goutham 4.0K Dec 29 09:50 api
-rw-r--r--  1 goutham goutham  626 Dec 29 09:50 build.ps1
-rw-r--r--  1 goutham goutham 1.3K Dec 29 09:50 circle.yml
drwxr-xr-x  2 goutham goutham 4.0K Dec 29 09:50 clients
-rw-r--r--  1 goutham goutham 1.3K Dec 29 09:50 CONTRIBUTING.md
drwxr-xr-x  2 root    root    4.0K Dec 29 09:52 data
-rw-r--r--  1 goutham goutham  811 Dec 29 09:50 doc.go
-rw-r--r--  1 goutham goutham   87 Dec 29 09:50 Dockerfile
drwxr-xr-x  9 goutham goutham 4.0K Dec 29 09:50 docs
drwxr-xr-x 16 goutham goutham 4.0K Dec 29 09:50 examples
drwxr-xr-x  3 goutham goutham 4.0K Dec 29 09:50 fn
-rwxr-xr-x  1 root    root     20M Dec 29 09:52 functions-alpine
drwxr-xr-x  8 goutham goutham 4.0K Dec 29 09:54 .git
-rw-r--r--  1 goutham goutham  209 Dec 29 09:50 .gitignore
-rw-r--r--  1 goutham goutham 8.9K Dec 29 09:50 glide.lock
-rw-r--r--  1 goutham goutham  972 Dec 29 09:50 glide.yaml
-rw-r--r--  1 goutham goutham  12K Dec 29 09:50 LICENSE
-rw-r--r--  1 goutham goutham 2.6K Dec 29 09:50 main.go
-rw-r--r--  1 goutham goutham 1.1K Dec 29 09:50 Makefile
-rw-r--r--  1 goutham goutham 9.7K Dec 29 09:50 README.md
-rwxr-xr-x  1 goutham goutham  846 Dec 29 09:50 release.sh
-rw-r--r--  1 goutham goutham  270 Dec 29 09:50 THIRD_PARTY
drwxr-xr-x  3 goutham goutham 4.0K Dec 29 09:50 triggers
drwxr-xr-x  5 goutham goutham 4.0K Dec 29 09:51 vendor
➜  functions git:(master) docker info
Containers: 5
 Running: 3
 Paused: 0
 Stopped: 2
Images: 13
Server Version: 1.12.3
Storage Driver: overlay2
 Backing Filesystem: extfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null bridge host overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.8.13-1-ARCH
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 23.31 GiB
Name: beast
ID: 6OCP:VJ5C:L2T4:AGMZ:N7KP:75TF:7FUM:JTN7:EIKR:J4KV:6RHA:VMTW
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8

I see that the folder data (created by make run-docker) is owned by root in my case while its owned by your user in your case. No clue why its happening.

@rdallman
Copy link
Contributor

Hi @gouthamve I have good news, I'm able to reproduce this with a fresh copy (and ☕️ ). Since I was unable to reproduce it with a prior version of the functions docker image (d'oh) it seems like this is just a simple regression then. Going to look over the code, I expect it's something in initialization that has since changed.

@treeder
Copy link
Contributor

treeder commented Dec 31, 2016

I believe this is because files made inside docker have the wrong permissions, we probably have to run a chmod on the bolt file that is created. I had to do this for everything created inside docker in another project as you can see here: https://github.com/treeder/dj/search?utf8=%E2%9C%93&q=chmod

@rdallman
Copy link
Contributor

rdallman commented Jan 3, 2017

hmm, thanks for the link. it's a little strange that it worked with an older version of the docker image. think it's fixed now, some details in #471

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants