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

docker-compose up dies on initial run #108

Closed
noslouch opened this issue Aug 20, 2016 · 9 comments
Closed

docker-compose up dies on initial run #108

noslouch opened this issue Aug 20, 2016 · 9 comments

Comments

@noslouch
Copy link

I did...

$ git clone git@github.com:code-corps/code-corps-phoenix.git
...
$ cd code-corps-phoenix
$ docker-compose build
...

In the middle of this process, I realized that my hard drive is about to run out of space due to this issue, so I ctrl-c and...

$ rm ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2
$ docker-compose build
...
$ docker-compose up
...
# selected & truncated output. these are the lines from web_1
 Running dependency resolution
 * Getting phoenix (Hex package)
   Checking package (https://repo.hex.pm/tarballs/phoenix-1.2.0.tar)
   Fetched package
 ** (File.Error) could not remove files and directories recursively from "/code-corps-api/deps/phoenix": file already exists
     (elixir) lib/file.ex:919: File.rm_rf!/1
     (hex) lib/hex/scm.ex:111: Hex.SCM.checkout/1
     (mix) lib/mix/dep/fetcher.ex:64: Mix.Dep.Fetcher.do_fetch/3
     (mix) lib/mix/dep/converger.ex:174: Mix.Dep.Converger.all/9
     (mix) lib/mix/dep/converger.ex:114: Mix.Dep.Converger.all/7
     (mix) lib/mix/dep/converger.ex:99: Mix.Dep.Converger.all/4
     (mix) lib/mix/dep/converger.ex:50: Mix.Dep.Converger.converge/4
     (mix) lib/mix/dep/fetcher.ex:16: Mix.Dep.Fetcher.all/3
codecorpsphoenix_web_1 exited with code 1

# these lines from watch_1
 Running dependency resolution
 * Updating phoenix (Hex package)
   Checking package (https://repo.hex.pm/tarballs/phoenix-1.2.0.tar)
   Fetched package
 ** (File.Error) could not remove files and directories recursively from "/code-corps-api/deps/phoenix": file already exists
     (elixir) lib/file.ex:919: File.rm_rf!/1
     (hex) lib/hex/scm.ex:111: Hex.SCM.checkout/1
     (mix) lib/mix/dep/fetcher.ex:61: Mix.Dep.Fetcher.do_fetch/3
     (mix) lib/mix/dep/converger.ex:174: Mix.Dep.Converger.all/9
     (mix) lib/mix/dep/converger.ex:114: Mix.Dep.Converger.all/7
     (mix) lib/mix/dep/converger.ex:99: Mix.Dep.Converger.all/4
     (mix) lib/mix/dep/converger.ex:50: Mix.Dep.Converger.converge/4
     (mix) lib/mix/dep/fetcher.ex:16: Mix.Dep.Fetcher.all/3
codecorpsphoenix_watch_1 exited with code 1

# now test_1
 Running dependency resolution
 * Getting phoenix (Hex package)
   Checking package (https://repo.hex.pm/tarballs/phoenix-1.2.0.tar)
   Fetched package
 ** (File.Error) could not touch "/code-corps-api/deps/phoenix/lib/phoenix/transports/#websocket_serializer.ex#": not a directory
     (elixir) lib/file.ex:395: File.touch!/2
     (elixir) lib/enum.ex:651: Enum."-each/2-lists^foreach/1-0-"/2
     (elixir) lib/enum.ex:651: Enum.each/2
     (hex) lib/hex/tar.ex:107: Hex.Tar.extract_contents/3
     (hex) lib/hex/scm.ex:112: Hex.SCM.checkout/1
     (mix) lib/mix/dep/fetcher.ex:64: Mix.Dep.Fetcher.do_fetch/3
     (mix) lib/mix/dep/converger.ex:174: Mix.Dep.Converger.all/9
     (mix) lib/mix/dep/converger.ex:114: Mix.Dep.Converger.all/7
codecorpsphoenix_test_1 exited with code 1

On my second run, the dependency resolution got further, but failed at postgrex for watch, and test, both with the same error:

 ** (File.Error) could not remove files and directories recursively from "/code-corps-api/deps/postgrex": file already exists

web failed at dependency compilation:

web_1            | ==> postgrex
web_1            | could not compile dependency :postgrex, "mix compile" failed. You can recompile this dependency with "mix deps.compile postgrex", update it with "mix deps.update postgrex" or clean it with "mix deps.clean postgrex"
web_1            | ==> code_corps
web_1            | ** (Mix) Could not find a Mix.Project, please ensure a mix.exs file is available

A third docker-compose up failed again at postgrex. Will try to recompile independently and report back.

Host system is OSX 10.11.6 El Capitan.

$ docker version
Client:
 Version:      1.12.0
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   8eab29e
 Built:        Thu Jul 28 21:15:28 2016
 OS/Arch:      darwin/amd64

Server:
 Version:      1.12.0
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   8eab29e
 Built:        Thu Jul 28 21:15:28 2016
 OS/Arch:      linux/amd64
$ docker info
Containers: 6
 Running: 3
 Paused: 0
 Stopped: 3
Images: 17
Server Version: 1.12.0
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 62
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: host bridge null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.15-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.954 GiB
Name: moby
ID: TBEC:4BX6:NEHJ:Y3ET:G7SI:VCMC:DK5Y:AJJS:UGDO:DHXL:EDII:TBGK
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 41
 Goroutines: 72
 System Time: 2016-08-20T22:40:11.75592979Z
 EventsListeners: 2
No Proxy: *.local, 169.254/16
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8
@joshsmith
Copy link
Contributor

And you are using Docker for Mac, right?

@noslouch
Copy link
Author

Yup! output from the whaley menu bar icon:

Version 1.12.0-a (build: 11213)
ad6ab836187e4111082447b7c0a6a74d01929a5c

@noslouch
Copy link
Author

Not sure what changed, but now when I booted I got git conflict errors from the test container and web container installing their dependencies at the same time.

* Updating arc (https://github.com/stavro/arc.git)
emote: Counting objects: 540, done.
remote: Compressing objects: 100% (67/67), done.        67)
Receiving objects: 100% (543/543), 127.70 KiB | 62.00 KiB/s, done.30.00 KiB/s
remote: Total 540 (delta 23), reused 0 (delta 0), pack-reused 470
Receiving objects: 100% (540/540), 127.47 KiB | 97.00 KiB/s, done.86.00 KiB/s
Resolving deltas: 100% (241/241), done.0% (0/241)
Resolving deltas: 100% (239/239), done.0% (0/239)
 From https://github.com/stavro/arc
  * [new branch]      ex_aws_beta -> origin/ex_aws_beta
  * [new branch]      fix-local-storage -> origin/fix-local-storage
  * [new branch]      master     -> origin/master
  * [new branch]      remote-files -> origin/remote-files
  * [new branch]      write-binary -> origin/write-binary
  * [new tag]         v0.4.1     -> v0.4.1
 fatal: Unable to create '/code-corps-api/deps/arc/.git/index.lock': File exists.

 If no other git process is currently running, this probably means a
 git process crashed in this repository earlier. Make sure no other git
 process is running and remove the file manually to continue.
 ** (Mix) Command "git --git-dir=.git checkout --quiet 354d4d2e1b86bcd6285db3528118fe3f5db36cf5" failed

and then the test container goes on to install its deps. when that finishes if I kill docker and do docker-compose up again, it boots just fine. I wonder if making test depend on web would fix this?

@joshsmith
Copy link
Contributor

@noslouch I think this was working for you recently. Is this still an issue?

@optikfluffel
Copy link

@joshsmith I'm having the same issue, also on a Mac.
I saw another error appearing when running docker-compose build, at 'Step 7' when trying to install rebar:

Step 7 : RUN mix local.rebar --force
 ---> Running in 4de3affe64bf
* creating root/.mix/rebar
* creating root/.mix/rebar3

21:39:04.349 [error] Failed updating session: 
   ProfileName: :httpc_mix
   SessionId:   {{'repo.hex.pm', 443}, #PID<0.123.0>}
   Pos:         9
   Value:       true
when
   Session (db) info: :undefined
   Session (db):      {:session, {{'repo.hex.pm', 443}, #PID<0.123.0>}, false, :https,
 {:sslsocket, {:gen_tcp, #Port<0.4588>, :tls_connection, :undefined},
  #PID<0.124.0>}, {:essl, []}, 1, :keep_alive, false}
   Session (record):  {:EXIT,
 {:badarg,
  [{:ets, :lookup,
    [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.123.0>}], []},
   {:httpc_manager, :lookup_session, 2, [file: 'httpc_manager.erl', line: 189]},
   {:httpc_handler, :update_session, 4,
    [file: 'httpc_handler.erl', line: 1909]},
   {:httpc_handler, :maybe_make_session_available, 2,
    [file: 'httpc_handler.erl', line: 1516]},
   {:httpc_handler, :answer_request, 3,
    [file: 'httpc_handler.erl', line: 1507]},
   {:httpc_handler, :handle_response, 1,
    [file: 'httpc_handler.erl', line: 1251]},
   {:httpc_handler, :handle_info, 2, [file: 'httpc_handler.erl', line: 471]},
   {:gen_server, :try_dispatch, 4, [file: 'gen_server.erl', line: 601]}]}}
   T: :error
   E: :badarg

21:39:04.351 [error] Failed updating session: 
   ProfileName: :httpc_mix
   SessionId:   {{'repo.hex.pm', 443}, #PID<0.123.0>}
   Pos:         9
   Value:       true
when
   Session (db) info: :undefined
   Session (db):      {:session, {{'repo.hex.pm', 443}, #PID<0.123.0>}, false, :https,
 {:sslsocket, {:gen_tcp, #Port<0.4588>, :tls_connection, :undefined},
  #PID<0.124.0>}, {:essl, []}, 1, :keep_alive, false}
   Session (record):  {:EXIT,
 {:badarg,
  [{:ets, :lookup,
    [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.123.0>}], []},
   {:httpc_manager, :lookup_session, 2, [file: 'httpc_manager.erl', line: 189]},
   {:httpc_handler, :update_session, 4,
    [file: 'httpc_handler.erl', line: 1909]},
   {:httpc_handler, :maybe_make_session_available, 2,
    [file: 'httpc_handler.erl', line: 1516]},
   {:httpc_handler, :answer_request, 3,
    [file: 'httpc_handler.erl', line: 1507]},
   {:httpc_handler, :terminate, 2, [file: 'httpc_handler.erl', line: 759]},
   {:gen_server, :try_terminate, 3, [file: 'gen_server.erl', line: 629]},
   {:gen_server, :terminate, 7, [file: 'gen_server.erl', line: 795]}]}}
   T: :error
   E: :badarg

21:39:04.387 [error] GenServer #PID<0.123.0> terminating
** (stop) {:failed_updating_session, [profile: :httpc_mix, session_id: {{'repo.hex.pm', 443}, #PID<0.123.0>}, pos: 9, value: true, etype: :error, error: :badarg, stacktrace: [{:ets, :update_element, [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.123.0>}, {9, true}], []}, {:httpc_manager, :update_session, 4, [file: 'httpc_manager.erl', line: 210]}, {:httpc_handler, :update_session, 4, [file: 'httpc_handler.erl', line: 1887]}, {:httpc_handler, :maybe_make_session_available, 2, [file: 'httpc_handler.erl', line: 1516]}, {:httpc_handler, :answer_request, 3, [file: 'httpc_handler.erl', line: 1507]}, {:httpc_handler, :terminate, 2, [file: 'httpc_handler.erl', line: 759]}, {:gen_server, :try_terminate, 3, [file: 'gen_server.erl', line: 629]}, {:gen_server, :terminate, 7, [file: 'gen_server.erl', line: 795]}]]}
    (inets) httpc_handler.erl:1911: :httpc_handler.update_session/4
    (inets) httpc_handler.erl:1516: :httpc_handler.maybe_make_session_available/2
    (inets) httpc_handler.erl:1507: :httpc_handler.answer_request/3
    (inets) httpc_handler.erl:759: :httpc_handler.terminate/2
    (stdlib) gen_server.erl:629: :gen_server.try_terminate/3
    (stdlib) gen_server.erl:795: :gen_server.terminate/7
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: {:ssl, {:sslsocket, {:gen_tcp, #Port<0.4588>, :tls_connection, :undefined}, #PID<0.124.0>}, <<53, 194, 198, 82, 163, 195, 160, 188, 60, 245, 74, 163, 86, 48, 167, 133, 199, 222, 127, 62, 245, 90, 225, 189, 198, 251, 204, 154, 117, 86, 16, 210, 249, 186, 195, 246, 235, 193, 146, 13, 191, 245, 133, 119, 133, 123, 31, 192, ...>>}
State: {:state, {:request, #Reference<0.0.2.227>, #PID<0.71.0>, 0, :https, {'repo.hex.pm', 443}, '/installs/1.0.0/rebar3-3.2.0', [], :get, {:http_request_h, :undefined, 'keep-alive', :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, 'repo.hex.pm', :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, [], 'Mix/1.3.2', :undefined, :undefined, :undefined, '0', :undefined, :undefined, :undefined, :undefined, :undefined, ...}, {[], []}, {:http_options, 'HTTP/1.1', :infinity, true, {:essl, []}, :undefined, true, :infinity, false}, 'https://repo.hex.pm/installs/1.0.0/rebar3-3.2.0', [], :none, [], 1474321143920, :undefined, :undefined, false}, {:session, {{'repo.hex.pm', 443}, #PID<0.123.0>}, false, :https, {:sslsocket, {:gen_tcp, #Port<0.4588>, :tls_connection, :undefined}, #PID<0.124.0>}, {:essl, []}, 1, :keep_alive, false}, {'HTTP/1.1', 200, 'OK'}, {:http_response_h, 'public, max-age=604800', 'keep-alive', 'Mon, 19 Sep 2016 21:39:03 GMT', :undefined, :undefined, :undefined, :undefined, '1.1 varnish', :undefined, 'bytes', '25078', '"d7ccc62e70a4f624e104a94277a3d19f"', :undefined, :undefined, :undefined, 'AmazonS3', :undefined, :undefined, :undefined, :undefined, :undefined, '733570', :undefined, :undefined, :undefined, 'binary/octet-stream', :undefined, 'Wed, 29 Jun 2016 00:00:24 GMT', [{'x-amz-id-2', 'IMYbjC4W+V3+G1a1+ND0MptMYdCsmvcku/I2Vr7OCr5zsnxle4PWu38+ysQKNErKYcgfNE8INdE='}, {'x-amz-request-id', 'BB0E5687DED6E3DA'}, {'x-amz-replication-status', 'COMPLETED'}, {'x-amz-meta-surrogate-key', 'installs'}, {'x-amz-version-id', 'IzrI8uvI1f1XQ..EdtBL1Ag4qzDvXewA'}, {'fastly-debug-digest', 'fc222ec28415824bb0fc56babefe45bed321fcd0769d9f58ff2cbaccab21b33e'}, {'x-served-by', 'cache-iad2121-IAD, cache-fra1229-FRA'}, {'x-cache', 'HIT, HIT'}, {'x-cache-hits', '1, 1'}, {'x-timer', 'S1474321143.179910,VS0,VE1'}]}, :undefined, {:httpc_response, :whole_body, [<<35, 33, 47, 117, 115, 114, 47, 98, 105, 110, 47, 101, 110, 118, 32, 101, 115, 99, 114, 105, 112, 116, 10, 37, 37, 32, 10, 37, 37, 33, 32, 43, 115, 98, 116, 117, 32, 43, 65, 48, ...>>, 733570]}, {[], []}, {[], []}, :new, [], :nolimit, :nolimit, {:options, {:undefined, []}, {:undefined, []}, 0, 2, 5, 120000, 2, :disabled, false, :inet, :default, :default, []}, {:timers, [], :undefined}, :httpc_mix, :inactive}
 ---> a95c5e782b2d
Removing intermediate container 4de3affe64bf

@joshsmith
Copy link
Contributor

@optikfluffel this looks relevant. Can you confirm? https://bugs.erlang.org/browse/ERL-253

@optikfluffel
Copy link

@joshsmith yes, looks like what happened to me

@joshsmith
Copy link
Contributor

@noslouch @optikfluffel can you retry and confirm if this is working for you now?

@joshsmith
Copy link
Contributor

@noslouch @optikfluffel bump on this.

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

No branches or pull requests

3 participants