Skip to content

Fix volumes on recreate - #711

Merged
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate
Jan 15, 2015
Merged

Fix volumes on recreate#711
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate

Conversation

@dnephin

Copy link
Copy Markdown

Resolves: #447 (and probably some other related issues)

Instead of using volumes_from on the intermediate container, inspect the volumes, and copy them over the to intermediate container and from the intermediate to the final container.

@bfirsh

Copy link
Copy Markdown

This is a great idea. Needs a rebase though. :(

@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from acd1449 to 456e3e6CompareDecember 9, 2014 19:16
@dnephin

Copy link
Copy Markdown
Author

I need to stop adding tests at the bottom of the file so I don't have to rebase everytime.

Rebased

@bfirsh

Copy link
Copy Markdown

cc @aanand

@dnephin

Copy link
Copy Markdown
Author

I suppose this could use some integration tests showing that it solves the issue.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch 3 times, most recently from b2efda5 to d273947CompareJanuary 14, 2015 20:53
@dnephin

Copy link
Copy Markdown
Author

Ok, this is rebased, and I've added an integration test (which fails on master).

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from d273947 to 7eb476eCompareJanuary 14, 2015 21:22
@dnephin

Copy link
Copy Markdown
Author

Oh right, I have to actually start the container in older versions of docker. This test was passing for docker 1.4.1. Pushed another update to get the test working for docker 1.2.0

@aanand

Copy link
Copy Markdown

LGTM

aanand added a commit that referenced this pull request Jan 15, 2015
@aanand
aanand merged commit 55095ef into docker:masterJan 15, 2015
@aanand

Copy link
Copy Markdown

spinal-tap-11-1321038225

@aanandaanand added this to the 1.1.0 milestone Jan 15, 2015
@aanand

Copy link
Copy Markdown

Hmm, tests are failing for me against Docker 1.4.1.

@dnephin

Copy link
Copy Markdown
Author

Hmm, I didn't actually test it on 1.4.1 after making the change for 1.2.
Does it work without the start_container line?
On Jan 16, 2015 11:09 AM, "Aanand Prasad" notifications@github.com wrote:

Hmm, tests are failing for me against Docker 1.4.1.


Reply to this email directly or view it on GitHub
#711 (comment).

@cpuguy83

Copy link
Copy Markdown
Contributor

I've not reviewed this code but... there exists a bug in 1.4.1 where on start Docker will always try to re-apply everything in volumes-from. If the volumes-from container no longer exists, it will error out.
Fix is slated for 1.5.0

This may be related.

@dnephin

Copy link
Copy Markdown
Author

@aanand tests on master are working for me with docker 1.4.1

@aanand

Copy link
Copy Markdown

I can reproduce it on master on a fresh Digital Ocean machine with Docker 1.4.1 - here's the relevant bit of script/test output:

+ docker run -v /var/run/docker.sock:/var/run/docker.sock --rm --entrypoint nosetests fig
......stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
....................F...............................F.......................................................................................................................
======================================================================
FAIL: test_project_up_recreates_containers (tests.integration.project_test.ProjectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/project_test.py", line 112, in test_project_up_recreates_containers
self.assertEqual(db_container.get('Volumes./etc'), db_volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6 [truncated]... != u'/var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83 [truncated]...
- /var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6069e9be6f8
+ /var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83a245e08b31
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 441
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_web_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_web_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/json HTTP/1.1" 200 1574
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 1565
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 2013
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
======================================================================
FAIL: test_recreate_containers (tests.integration.service_test.ServiceTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/service_test.py", line 164, in test_recreate_containers
self.assertEqual(new_container.get('Volumes')['/etc'], volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367 [truncated]... != u'/var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1 [truncated]...
- /var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367127fc82c71
+ /var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1fc1856634e
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a/kill HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2045
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 1563
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2008
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
----------------------------------------------------------------------
Ran 180 tests in 216.408s
FAILED (failures=2)

@dnephin

Copy link
Copy Markdown
Author

@aanand I was able to reproduce the error on another host

I believe the issue is related to this TODO I left (service.py#L297)

The intermediate container has the correct volumes, but the final container is being passed the config which creates a new volume first (before the correct volume is applied during start_container()). So when start_container() tries to apply volumes they are ignored instead of overriding.

I'll submit another PR to address the 1.4.1 issue.

dnephin pushed a commit to dnephin/compose that referenced this pull request Jan 20, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
aanand added a commit that referenced this pull request Jan 20, 2015
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Fix volumes on recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…nges
Revert docker#711 from dnephin/fix_volumes_on_recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reload fig.yml to mount the changed volumes

4 participants

@dnephin@bfirsh@aanand@cpuguy83
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Fix volumes on recreate by dnephin · Pull Request #711 · docker/compose · GitHub
Skip to content

Fix volumes on recreate - #711

Merged
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate
Jan 15, 2015
Merged

Fix volumes on recreate#711
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate

Conversation

@dnephin

Copy link
Copy Markdown

Resolves: #447 (and probably some other related issues)

Instead of using volumes_from on the intermediate container, inspect the volumes, and copy them over the to intermediate container and from the intermediate to the final container.

@bfirsh

Copy link
Copy Markdown

This is a great idea. Needs a rebase though. :(

@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from acd1449 to 456e3e6CompareDecember 9, 2014 19:16
@dnephin

Copy link
Copy Markdown
Author

I need to stop adding tests at the bottom of the file so I don't have to rebase everytime.

Rebased

@bfirsh

Copy link
Copy Markdown

cc @aanand

@dnephin

Copy link
Copy Markdown
Author

I suppose this could use some integration tests showing that it solves the issue.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch 3 times, most recently from b2efda5 to d273947CompareJanuary 14, 2015 20:53
@dnephin

Copy link
Copy Markdown
Author

Ok, this is rebased, and I've added an integration test (which fails on master).

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from d273947 to 7eb476eCompareJanuary 14, 2015 21:22
@dnephin

Copy link
Copy Markdown
Author

Oh right, I have to actually start the container in older versions of docker. This test was passing for docker 1.4.1. Pushed another update to get the test working for docker 1.2.0

@aanand

Copy link
Copy Markdown

LGTM

aanand added a commit that referenced this pull request Jan 15, 2015
@aanand
aanand merged commit 55095ef into docker:masterJan 15, 2015
@aanand

Copy link
Copy Markdown

spinal-tap-11-1321038225

@aanandaanand added this to the 1.1.0 milestone Jan 15, 2015
@aanand

Copy link
Copy Markdown

Hmm, tests are failing for me against Docker 1.4.1.

@dnephin

Copy link
Copy Markdown
Author

Hmm, I didn't actually test it on 1.4.1 after making the change for 1.2.
Does it work without the start_container line?
On Jan 16, 2015 11:09 AM, "Aanand Prasad" notifications@github.com wrote:

Hmm, tests are failing for me against Docker 1.4.1.


Reply to this email directly or view it on GitHub
#711 (comment).

@cpuguy83

Copy link
Copy Markdown
Contributor

I've not reviewed this code but... there exists a bug in 1.4.1 where on start Docker will always try to re-apply everything in volumes-from. If the volumes-from container no longer exists, it will error out.
Fix is slated for 1.5.0

This may be related.

@dnephin

Copy link
Copy Markdown
Author

@aanand tests on master are working for me with docker 1.4.1

@aanand

Copy link
Copy Markdown

I can reproduce it on master on a fresh Digital Ocean machine with Docker 1.4.1 - here's the relevant bit of script/test output:

+ docker run -v /var/run/docker.sock:/var/run/docker.sock --rm --entrypoint nosetests fig
......stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
....................F...............................F.......................................................................................................................
======================================================================
FAIL: test_project_up_recreates_containers (tests.integration.project_test.ProjectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/project_test.py", line 112, in test_project_up_recreates_containers
self.assertEqual(db_container.get('Volumes./etc'), db_volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6 [truncated]... != u'/var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83 [truncated]...
- /var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6069e9be6f8
+ /var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83a245e08b31
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 441
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_web_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_web_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/json HTTP/1.1" 200 1574
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 1565
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 2013
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
======================================================================
FAIL: test_recreate_containers (tests.integration.service_test.ServiceTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/service_test.py", line 164, in test_recreate_containers
self.assertEqual(new_container.get('Volumes')['/etc'], volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367 [truncated]... != u'/var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1 [truncated]...
- /var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367127fc82c71
+ /var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1fc1856634e
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a/kill HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2045
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 1563
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2008
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
----------------------------------------------------------------------
Ran 180 tests in 216.408s
FAILED (failures=2)

@dnephin

Copy link
Copy Markdown
Author

@aanand I was able to reproduce the error on another host

I believe the issue is related to this TODO I left (service.py#L297)

The intermediate container has the correct volumes, but the final container is being passed the config which creates a new volume first (before the correct volume is applied during start_container()). So when start_container() tries to apply volumes they are ignored instead of overriding.

I'll submit another PR to address the 1.4.1 issue.

dnephin pushed a commit to dnephin/compose that referenced this pull request Jan 20, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
aanand added a commit that referenced this pull request Jan 20, 2015
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Fix volumes on recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…nges
Revert docker#711 from dnephin/fix_volumes_on_recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reload fig.yml to mount the changed volumes

4 participants

@dnephin@bfirsh@aanand@cpuguy83
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix volumes on recreate by dnephin · Pull Request #711 · docker/compose · GitHub
Skip to content

Fix volumes on recreate - #711

Merged
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate
Jan 15, 2015
Merged

Fix volumes on recreate#711
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate

Conversation

@dnephin

Copy link
Copy Markdown

Resolves: #447 (and probably some other related issues)

Instead of using volumes_from on the intermediate container, inspect the volumes, and copy them over the to intermediate container and from the intermediate to the final container.

@bfirsh

Copy link
Copy Markdown

This is a great idea. Needs a rebase though. :(

@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from acd1449 to 456e3e6CompareDecember 9, 2014 19:16
@dnephin

Copy link
Copy Markdown
Author

I need to stop adding tests at the bottom of the file so I don't have to rebase everytime.

Rebased

@bfirsh

Copy link
Copy Markdown

cc @aanand

@dnephin

Copy link
Copy Markdown
Author

I suppose this could use some integration tests showing that it solves the issue.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch 3 times, most recently from b2efda5 to d273947CompareJanuary 14, 2015 20:53
@dnephin

Copy link
Copy Markdown
Author

Ok, this is rebased, and I've added an integration test (which fails on master).

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from d273947 to 7eb476eCompareJanuary 14, 2015 21:22
@dnephin

Copy link
Copy Markdown
Author

Oh right, I have to actually start the container in older versions of docker. This test was passing for docker 1.4.1. Pushed another update to get the test working for docker 1.2.0

@aanand

Copy link
Copy Markdown

LGTM

aanand added a commit that referenced this pull request Jan 15, 2015
@aanand
aanand merged commit 55095ef into docker:masterJan 15, 2015
@aanand

Copy link
Copy Markdown

spinal-tap-11-1321038225

@aanandaanand added this to the 1.1.0 milestone Jan 15, 2015
@aanand

Copy link
Copy Markdown

Hmm, tests are failing for me against Docker 1.4.1.

@dnephin

Copy link
Copy Markdown
Author

Hmm, I didn't actually test it on 1.4.1 after making the change for 1.2.
Does it work without the start_container line?
On Jan 16, 2015 11:09 AM, "Aanand Prasad" notifications@github.com wrote:

Hmm, tests are failing for me against Docker 1.4.1.


Reply to this email directly or view it on GitHub
#711 (comment).

@cpuguy83

Copy link
Copy Markdown
Contributor

I've not reviewed this code but... there exists a bug in 1.4.1 where on start Docker will always try to re-apply everything in volumes-from. If the volumes-from container no longer exists, it will error out.
Fix is slated for 1.5.0

This may be related.

@dnephin

Copy link
Copy Markdown
Author

@aanand tests on master are working for me with docker 1.4.1

@aanand

Copy link
Copy Markdown

I can reproduce it on master on a fresh Digital Ocean machine with Docker 1.4.1 - here's the relevant bit of script/test output:

+ docker run -v /var/run/docker.sock:/var/run/docker.sock --rm --entrypoint nosetests fig
......stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
....................F...............................F.......................................................................................................................
======================================================================
FAIL: test_project_up_recreates_containers (tests.integration.project_test.ProjectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/project_test.py", line 112, in test_project_up_recreates_containers
self.assertEqual(db_container.get('Volumes./etc'), db_volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6 [truncated]... != u'/var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83 [truncated]...
- /var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6069e9be6f8
+ /var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83a245e08b31
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 441
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_web_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_web_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/json HTTP/1.1" 200 1574
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 1565
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 2013
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
======================================================================
FAIL: test_recreate_containers (tests.integration.service_test.ServiceTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/service_test.py", line 164, in test_recreate_containers
self.assertEqual(new_container.get('Volumes')['/etc'], volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367 [truncated]... != u'/var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1 [truncated]...
- /var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367127fc82c71
+ /var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1fc1856634e
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a/kill HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2045
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 1563
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2008
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
----------------------------------------------------------------------
Ran 180 tests in 216.408s
FAILED (failures=2)

@dnephin

Copy link
Copy Markdown
Author

@aanand I was able to reproduce the error on another host

I believe the issue is related to this TODO I left (service.py#L297)

The intermediate container has the correct volumes, but the final container is being passed the config which creates a new volume first (before the correct volume is applied during start_container()). So when start_container() tries to apply volumes they are ignored instead of overriding.

I'll submit another PR to address the 1.4.1 issue.

dnephin pushed a commit to dnephin/compose that referenced this pull request Jan 20, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
aanand added a commit that referenced this pull request Jan 20, 2015
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Fix volumes on recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…nges
Revert docker#711 from dnephin/fix_volumes_on_recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reload fig.yml to mount the changed volumes

4 participants

@dnephin@bfirsh@aanand@cpuguy83
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix volumes on recreate by dnephin · Pull Request #711 · docker/compose · GitHub
Skip to content

Fix volumes on recreate - #711

Merged
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate
Jan 15, 2015
Merged

Fix volumes on recreate#711
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate

Conversation

@dnephin

Copy link
Copy Markdown

Resolves: #447 (and probably some other related issues)

Instead of using volumes_from on the intermediate container, inspect the volumes, and copy them over the to intermediate container and from the intermediate to the final container.

@bfirsh

Copy link
Copy Markdown

This is a great idea. Needs a rebase though. :(

@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from acd1449 to 456e3e6CompareDecember 9, 2014 19:16
@dnephin

Copy link
Copy Markdown
Author

I need to stop adding tests at the bottom of the file so I don't have to rebase everytime.

Rebased

@bfirsh

Copy link
Copy Markdown

cc @aanand

@dnephin

Copy link
Copy Markdown
Author

I suppose this could use some integration tests showing that it solves the issue.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch 3 times, most recently from b2efda5 to d273947CompareJanuary 14, 2015 20:53
@dnephin

Copy link
Copy Markdown
Author

Ok, this is rebased, and I've added an integration test (which fails on master).

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from d273947 to 7eb476eCompareJanuary 14, 2015 21:22
@dnephin

Copy link
Copy Markdown
Author

Oh right, I have to actually start the container in older versions of docker. This test was passing for docker 1.4.1. Pushed another update to get the test working for docker 1.2.0

@aanand

Copy link
Copy Markdown

LGTM

aanand added a commit that referenced this pull request Jan 15, 2015
@aanand
aanand merged commit 55095ef into docker:masterJan 15, 2015
@aanand

Copy link
Copy Markdown

spinal-tap-11-1321038225

@aanandaanand added this to the 1.1.0 milestone Jan 15, 2015
@aanand

Copy link
Copy Markdown

Hmm, tests are failing for me against Docker 1.4.1.

@dnephin

Copy link
Copy Markdown
Author

Hmm, I didn't actually test it on 1.4.1 after making the change for 1.2.
Does it work without the start_container line?
On Jan 16, 2015 11:09 AM, "Aanand Prasad" notifications@github.com wrote:

Hmm, tests are failing for me against Docker 1.4.1.


Reply to this email directly or view it on GitHub
#711 (comment).

@cpuguy83

Copy link
Copy Markdown
Contributor

I've not reviewed this code but... there exists a bug in 1.4.1 where on start Docker will always try to re-apply everything in volumes-from. If the volumes-from container no longer exists, it will error out.
Fix is slated for 1.5.0

This may be related.

@dnephin

Copy link
Copy Markdown
Author

@aanand tests on master are working for me with docker 1.4.1

@aanand

Copy link
Copy Markdown

I can reproduce it on master on a fresh Digital Ocean machine with Docker 1.4.1 - here's the relevant bit of script/test output:

+ docker run -v /var/run/docker.sock:/var/run/docker.sock --rm --entrypoint nosetests fig
......stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
....................F...............................F.......................................................................................................................
======================================================================
FAIL: test_project_up_recreates_containers (tests.integration.project_test.ProjectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/project_test.py", line 112, in test_project_up_recreates_containers
self.assertEqual(db_container.get('Volumes./etc'), db_volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6 [truncated]... != u'/var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83 [truncated]...
- /var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6069e9be6f8
+ /var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83a245e08b31
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 441
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_web_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_web_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/json HTTP/1.1" 200 1574
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 1565
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 2013
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
======================================================================
FAIL: test_recreate_containers (tests.integration.service_test.ServiceTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/service_test.py", line 164, in test_recreate_containers
self.assertEqual(new_container.get('Volumes')['/etc'], volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367 [truncated]... != u'/var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1 [truncated]...
- /var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367127fc82c71
+ /var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1fc1856634e
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a/kill HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2045
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 1563
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2008
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
----------------------------------------------------------------------
Ran 180 tests in 216.408s
FAILED (failures=2)

@dnephin

Copy link
Copy Markdown
Author

@aanand I was able to reproduce the error on another host

I believe the issue is related to this TODO I left (service.py#L297)

The intermediate container has the correct volumes, but the final container is being passed the config which creates a new volume first (before the correct volume is applied during start_container()). So when start_container() tries to apply volumes they are ignored instead of overriding.

I'll submit another PR to address the 1.4.1 issue.

dnephin pushed a commit to dnephin/compose that referenced this pull request Jan 20, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
aanand added a commit that referenced this pull request Jan 20, 2015
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Fix volumes on recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…nges
Revert docker#711 from dnephin/fix_volumes_on_recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reload fig.yml to mount the changed volumes

4 participants

@dnephin@bfirsh@aanand@cpuguy83
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' Fix volumes on recreate by dnephin · Pull Request #711 · docker/compose · GitHub
Skip to content

Fix volumes on recreate - #711

Merged
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate
Jan 15, 2015
Merged

Fix volumes on recreate#711
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate

Conversation

@dnephin

Copy link
Copy Markdown

Resolves: #447 (and probably some other related issues)

Instead of using volumes_from on the intermediate container, inspect the volumes, and copy them over the to intermediate container and from the intermediate to the final container.

@bfirsh

Copy link
Copy Markdown

This is a great idea. Needs a rebase though. :(

@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from acd1449 to 456e3e6CompareDecember 9, 2014 19:16
@dnephin

Copy link
Copy Markdown
Author

I need to stop adding tests at the bottom of the file so I don't have to rebase everytime.

Rebased

@bfirsh

Copy link
Copy Markdown

cc @aanand

@dnephin

Copy link
Copy Markdown
Author

I suppose this could use some integration tests showing that it solves the issue.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch 3 times, most recently from b2efda5 to d273947CompareJanuary 14, 2015 20:53
@dnephin

Copy link
Copy Markdown
Author

Ok, this is rebased, and I've added an integration test (which fails on master).

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from d273947 to 7eb476eCompareJanuary 14, 2015 21:22
@dnephin

Copy link
Copy Markdown
Author

Oh right, I have to actually start the container in older versions of docker. This test was passing for docker 1.4.1. Pushed another update to get the test working for docker 1.2.0

@aanand

Copy link
Copy Markdown

LGTM

aanand added a commit that referenced this pull request Jan 15, 2015
@aanand
aanand merged commit 55095ef into docker:masterJan 15, 2015
@aanand

Copy link
Copy Markdown

spinal-tap-11-1321038225

@aanandaanand added this to the 1.1.0 milestone Jan 15, 2015
@aanand

Copy link
Copy Markdown

Hmm, tests are failing for me against Docker 1.4.1.

@dnephin

Copy link
Copy Markdown
Author

Hmm, I didn't actually test it on 1.4.1 after making the change for 1.2.
Does it work without the start_container line?
On Jan 16, 2015 11:09 AM, "Aanand Prasad" notifications@github.com wrote:

Hmm, tests are failing for me against Docker 1.4.1.


Reply to this email directly or view it on GitHub
#711 (comment).

@cpuguy83

Copy link
Copy Markdown
Contributor

I've not reviewed this code but... there exists a bug in 1.4.1 where on start Docker will always try to re-apply everything in volumes-from. If the volumes-from container no longer exists, it will error out.
Fix is slated for 1.5.0

This may be related.

@dnephin

Copy link
Copy Markdown
Author

@aanand tests on master are working for me with docker 1.4.1

@aanand

Copy link
Copy Markdown

I can reproduce it on master on a fresh Digital Ocean machine with Docker 1.4.1 - here's the relevant bit of script/test output:

+ docker run -v /var/run/docker.sock:/var/run/docker.sock --rm --entrypoint nosetests fig
......stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
....................F...............................F.......................................................................................................................
======================================================================
FAIL: test_project_up_recreates_containers (tests.integration.project_test.ProjectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/project_test.py", line 112, in test_project_up_recreates_containers
self.assertEqual(db_container.get('Volumes./etc'), db_volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6 [truncated]... != u'/var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83 [truncated]...
- /var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6069e9be6f8
+ /var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83a245e08b31
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 441
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_web_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_web_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/json HTTP/1.1" 200 1574
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 1565
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 2013
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
======================================================================
FAIL: test_recreate_containers (tests.integration.service_test.ServiceTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/service_test.py", line 164, in test_recreate_containers
self.assertEqual(new_container.get('Volumes')['/etc'], volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367 [truncated]... != u'/var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1 [truncated]...
- /var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367127fc82c71
+ /var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1fc1856634e
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a/kill HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2045
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 1563
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2008
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
----------------------------------------------------------------------
Ran 180 tests in 216.408s
FAILED (failures=2)

@dnephin

Copy link
Copy Markdown
Author

@aanand I was able to reproduce the error on another host

I believe the issue is related to this TODO I left (service.py#L297)

The intermediate container has the correct volumes, but the final container is being passed the config which creates a new volume first (before the correct volume is applied during start_container()). So when start_container() tries to apply volumes they are ignored instead of overriding.

I'll submit another PR to address the 1.4.1 issue.

dnephin pushed a commit to dnephin/compose that referenced this pull request Jan 20, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
aanand added a commit that referenced this pull request Jan 20, 2015
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Fix volumes on recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…nges
Revert docker#711 from dnephin/fix_volumes_on_recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reload fig.yml to mount the changed volumes

4 participants

@dnephin@bfirsh@aanand@cpuguy83
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix volumes on recreate by dnephin · Pull Request #711 · docker/compose · GitHub
Skip to content

Fix volumes on recreate - #711

Merged
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate
Jan 15, 2015
Merged

Fix volumes on recreate#711
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate

Conversation

@dnephin

Copy link
Copy Markdown

Resolves: #447 (and probably some other related issues)

Instead of using volumes_from on the intermediate container, inspect the volumes, and copy them over the to intermediate container and from the intermediate to the final container.

@bfirsh

Copy link
Copy Markdown

This is a great idea. Needs a rebase though. :(

@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from acd1449 to 456e3e6CompareDecember 9, 2014 19:16
@dnephin

Copy link
Copy Markdown
Author

I need to stop adding tests at the bottom of the file so I don't have to rebase everytime.

Rebased

@bfirsh

Copy link
Copy Markdown

cc @aanand

@dnephin

Copy link
Copy Markdown
Author

I suppose this could use some integration tests showing that it solves the issue.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch 3 times, most recently from b2efda5 to d273947CompareJanuary 14, 2015 20:53
@dnephin

Copy link
Copy Markdown
Author

Ok, this is rebased, and I've added an integration test (which fails on master).

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from d273947 to 7eb476eCompareJanuary 14, 2015 21:22
@dnephin

Copy link
Copy Markdown
Author

Oh right, I have to actually start the container in older versions of docker. This test was passing for docker 1.4.1. Pushed another update to get the test working for docker 1.2.0

@aanand

Copy link
Copy Markdown

LGTM

aanand added a commit that referenced this pull request Jan 15, 2015
@aanand
aanand merged commit 55095ef into docker:masterJan 15, 2015
@aanand

Copy link
Copy Markdown

spinal-tap-11-1321038225

@aanandaanand added this to the 1.1.0 milestone Jan 15, 2015
@aanand

Copy link
Copy Markdown

Hmm, tests are failing for me against Docker 1.4.1.

@dnephin

Copy link
Copy Markdown
Author

Hmm, I didn't actually test it on 1.4.1 after making the change for 1.2.
Does it work without the start_container line?
On Jan 16, 2015 11:09 AM, "Aanand Prasad" notifications@github.com wrote:

Hmm, tests are failing for me against Docker 1.4.1.


Reply to this email directly or view it on GitHub
#711 (comment).

@cpuguy83

Copy link
Copy Markdown
Contributor

I've not reviewed this code but... there exists a bug in 1.4.1 where on start Docker will always try to re-apply everything in volumes-from. If the volumes-from container no longer exists, it will error out.
Fix is slated for 1.5.0

This may be related.

@dnephin

Copy link
Copy Markdown
Author

@aanand tests on master are working for me with docker 1.4.1

@aanand

Copy link
Copy Markdown

I can reproduce it on master on a fresh Digital Ocean machine with Docker 1.4.1 - here's the relevant bit of script/test output:

+ docker run -v /var/run/docker.sock:/var/run/docker.sock --rm --entrypoint nosetests fig
......stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
....................F...............................F.......................................................................................................................
======================================================================
FAIL: test_project_up_recreates_containers (tests.integration.project_test.ProjectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/project_test.py", line 112, in test_project_up_recreates_containers
self.assertEqual(db_container.get('Volumes./etc'), db_volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6 [truncated]... != u'/var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83 [truncated]...
- /var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6069e9be6f8
+ /var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83a245e08b31
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 441
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_web_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_web_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/json HTTP/1.1" 200 1574
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 1565
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 2013
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
======================================================================
FAIL: test_recreate_containers (tests.integration.service_test.ServiceTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/service_test.py", line 164, in test_recreate_containers
self.assertEqual(new_container.get('Volumes')['/etc'], volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367 [truncated]... != u'/var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1 [truncated]...
- /var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367127fc82c71
+ /var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1fc1856634e
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a/kill HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2045
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 1563
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2008
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
----------------------------------------------------------------------
Ran 180 tests in 216.408s
FAILED (failures=2)

@dnephin

Copy link
Copy Markdown
Author

@aanand I was able to reproduce the error on another host

I believe the issue is related to this TODO I left (service.py#L297)

The intermediate container has the correct volumes, but the final container is being passed the config which creates a new volume first (before the correct volume is applied during start_container()). So when start_container() tries to apply volumes they are ignored instead of overriding.

I'll submit another PR to address the 1.4.1 issue.

dnephin pushed a commit to dnephin/compose that referenced this pull request Jan 20, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
aanand added a commit that referenced this pull request Jan 20, 2015
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Fix volumes on recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…nges
Revert docker#711 from dnephin/fix_volumes_on_recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reload fig.yml to mount the changed volumes

4 participants

@dnephin@bfirsh@aanand@cpuguy83
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix volumes on recreate by dnephin · Pull Request #711 · docker/compose · GitHub
Skip to content

Fix volumes on recreate - #711

Merged
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate
Jan 15, 2015
Merged

Fix volumes on recreate#711
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate

Conversation

@dnephin

Copy link
Copy Markdown

Resolves: #447 (and probably some other related issues)

Instead of using volumes_from on the intermediate container, inspect the volumes, and copy them over the to intermediate container and from the intermediate to the final container.

@bfirsh

Copy link
Copy Markdown

This is a great idea. Needs a rebase though. :(

@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from acd1449 to 456e3e6CompareDecember 9, 2014 19:16
@dnephin

Copy link
Copy Markdown
Author

I need to stop adding tests at the bottom of the file so I don't have to rebase everytime.

Rebased

@bfirsh

Copy link
Copy Markdown

cc @aanand

@dnephin

Copy link
Copy Markdown
Author

I suppose this could use some integration tests showing that it solves the issue.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch 3 times, most recently from b2efda5 to d273947CompareJanuary 14, 2015 20:53
@dnephin

Copy link
Copy Markdown
Author

Ok, this is rebased, and I've added an integration test (which fails on master).

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from d273947 to 7eb476eCompareJanuary 14, 2015 21:22
@dnephin

Copy link
Copy Markdown
Author

Oh right, I have to actually start the container in older versions of docker. This test was passing for docker 1.4.1. Pushed another update to get the test working for docker 1.2.0

@aanand

Copy link
Copy Markdown

LGTM

aanand added a commit that referenced this pull request Jan 15, 2015
@aanand
aanand merged commit 55095ef into docker:masterJan 15, 2015
@aanand

Copy link
Copy Markdown

spinal-tap-11-1321038225

@aanandaanand added this to the 1.1.0 milestone Jan 15, 2015
@aanand

Copy link
Copy Markdown

Hmm, tests are failing for me against Docker 1.4.1.

@dnephin

Copy link
Copy Markdown
Author

Hmm, I didn't actually test it on 1.4.1 after making the change for 1.2.
Does it work without the start_container line?
On Jan 16, 2015 11:09 AM, "Aanand Prasad" notifications@github.com wrote:

Hmm, tests are failing for me against Docker 1.4.1.


Reply to this email directly or view it on GitHub
#711 (comment).

@cpuguy83

Copy link
Copy Markdown
Contributor

I've not reviewed this code but... there exists a bug in 1.4.1 where on start Docker will always try to re-apply everything in volumes-from. If the volumes-from container no longer exists, it will error out.
Fix is slated for 1.5.0

This may be related.

@dnephin

Copy link
Copy Markdown
Author

@aanand tests on master are working for me with docker 1.4.1

@aanand

Copy link
Copy Markdown

I can reproduce it on master on a fresh Digital Ocean machine with Docker 1.4.1 - here's the relevant bit of script/test output:

+ docker run -v /var/run/docker.sock:/var/run/docker.sock --rm --entrypoint nosetests fig
......stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
....................F...............................F.......................................................................................................................
======================================================================
FAIL: test_project_up_recreates_containers (tests.integration.project_test.ProjectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/project_test.py", line 112, in test_project_up_recreates_containers
self.assertEqual(db_container.get('Volumes./etc'), db_volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6 [truncated]... != u'/var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83 [truncated]...
- /var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6069e9be6f8
+ /var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83a245e08b31
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 441
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_web_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_web_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/json HTTP/1.1" 200 1574
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 1565
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 2013
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
======================================================================
FAIL: test_recreate_containers (tests.integration.service_test.ServiceTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/service_test.py", line 164, in test_recreate_containers
self.assertEqual(new_container.get('Volumes')['/etc'], volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367 [truncated]... != u'/var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1 [truncated]...
- /var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367127fc82c71
+ /var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1fc1856634e
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a/kill HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2045
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 1563
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2008
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
----------------------------------------------------------------------
Ran 180 tests in 216.408s
FAILED (failures=2)

@dnephin

Copy link
Copy Markdown
Author

@aanand I was able to reproduce the error on another host

I believe the issue is related to this TODO I left (service.py#L297)

The intermediate container has the correct volumes, but the final container is being passed the config which creates a new volume first (before the correct volume is applied during start_container()). So when start_container() tries to apply volumes they are ignored instead of overriding.

I'll submit another PR to address the 1.4.1 issue.

dnephin pushed a commit to dnephin/compose that referenced this pull request Jan 20, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
aanand added a commit that referenced this pull request Jan 20, 2015
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Fix volumes on recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…nges
Revert docker#711 from dnephin/fix_volumes_on_recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reload fig.yml to mount the changed volumes

4 participants

@dnephin@bfirsh@aanand@cpuguy83
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); Fix volumes on recreate by dnephin · Pull Request #711 · docker/compose · GitHub
Skip to content

Fix volumes on recreate - #711

Merged
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate
Jan 15, 2015
Merged

Fix volumes on recreate#711
aanand merged 2 commits into
docker:masterfrom
dnephin:fix_volumes_on_recreate

Conversation

@dnephin

Copy link
Copy Markdown

Resolves: #447 (and probably some other related issues)

Instead of using volumes_from on the intermediate container, inspect the volumes, and copy them over the to intermediate container and from the intermediate to the final container.

@bfirsh

Copy link
Copy Markdown

This is a great idea. Needs a rebase though. :(

@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from acd1449 to 456e3e6CompareDecember 9, 2014 19:16
@dnephin

Copy link
Copy Markdown
Author

I need to stop adding tests at the bottom of the file so I don't have to rebase everytime.

Rebased

@bfirsh

Copy link
Copy Markdown

cc @aanand

@dnephin

Copy link
Copy Markdown
Author

I suppose this could use some integration tests showing that it solves the issue.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch 3 times, most recently from b2efda5 to d273947CompareJanuary 14, 2015 20:53
@dnephin

Copy link
Copy Markdown
Author

Ok, this is rebased, and I've added an integration test (which fails on master).

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
dnephinforce-pushed the fix_volumes_on_recreate branch from d273947 to 7eb476eCompareJanuary 14, 2015 21:22
@dnephin

Copy link
Copy Markdown
Author

Oh right, I have to actually start the container in older versions of docker. This test was passing for docker 1.4.1. Pushed another update to get the test working for docker 1.2.0

@aanand

Copy link
Copy Markdown

LGTM

aanand added a commit that referenced this pull request Jan 15, 2015
@aanand
aanand merged commit 55095ef into docker:masterJan 15, 2015
@aanand

Copy link
Copy Markdown

spinal-tap-11-1321038225

@aanandaanand added this to the 1.1.0 milestone Jan 15, 2015
@aanand

Copy link
Copy Markdown

Hmm, tests are failing for me against Docker 1.4.1.

@dnephin

Copy link
Copy Markdown
Author

Hmm, I didn't actually test it on 1.4.1 after making the change for 1.2.
Does it work without the start_container line?
On Jan 16, 2015 11:09 AM, "Aanand Prasad" notifications@github.com wrote:

Hmm, tests are failing for me against Docker 1.4.1.


Reply to this email directly or view it on GitHub
#711 (comment).

@cpuguy83

Copy link
Copy Markdown
Contributor

I've not reviewed this code but... there exists a bug in 1.4.1 where on start Docker will always try to re-apply everything in volumes-from. If the volumes-from container no longer exists, it will error out.
Fix is slated for 1.5.0

This may be related.

@dnephin

Copy link
Copy Markdown
Author

@aanand tests on master are working for me with docker 1.4.1

@aanand

Copy link
Copy Markdown

I can reproduce it on master on a fresh Digital Ocean machine with Docker 1.4.1 - here's the relevant bit of script/test output:

+ docker run -v /var/run/docker.sock:/var/run/docker.sock --rm --entrypoint nosetests fig
......stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
.stty: standard input: Inappropriate ioctl for device
....................F...............................F.......................................................................................................................
======================================================================
FAIL: test_project_up_recreates_containers (tests.integration.project_test.ProjectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/project_test.py", line 112, in test_project_up_recreates_containers
self.assertEqual(db_container.get('Volumes./etc'), db_volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6 [truncated]... != u'/var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83 [truncated]...
- /var/lib/docker/vfs/dir/5dbe0ffc9cecbe2b464bbeb38b2a5557d860db46da112d490fbed6069e9be6f8
+ /var/lib/docker/vfs/dir/65e3c1cc2d1ca83f5f63eb375b66a3eb880a4e0b6ab7d0f5871d83a245e08b31
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 441
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 659
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Creating figtest_web_1...
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_web_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/json HTTP/1.1" 200 1574
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/cbfb5988012d160c2aeaa7e8f628ab62e0cdf6496d8510ccefb6248cff6444a0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 1565
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea/json HTTP/1.1" 200 2013
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/d81d3a4699414fbc9c2782de2c1f76bdbf410ac11fff7c14bf122fd03a19a5ea?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 1688
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/0ef6711c1da844a1498f650107355d22250ad11e1f6f026a784212b73f13ef45?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 870
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/f38622b9f3ff995e0de9c065d4bfd80cbe9c1eb4c1c9b0dd408f8d0e8c379649/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
======================================================================
FAIL: test_recreate_containers (tests.integration.service_test.ServiceTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/code/tests/integration/service_test.py", line 164, in test_recreate_containers
self.assertEqual(new_container.get('Volumes')['/etc'], volume_path)
AssertionError: u'/var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367 [truncated]... != u'/var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1 [truncated]...
- /var/lib/docker/vfs/dir/2afba3ba6532907fd4d7db9ec9036ac753f516d24b8f13c80b0367127fc82c71
+ /var/lib/docker/vfs/dir/ea73d18136c20432013ecd7ba247849be929eeac258da7ac21f0e1fc1856634e
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a/kill HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/b0aa75d1037b9acaaef6b327d3580c516bccb6378fd6f33b36d4ee40d6cb0d0a?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2045
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
fig.service: INFO: Recreating figtest_db_1...
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/stop?t=10 HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 1563
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0/json HTTP/1.1" 200 2008
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/wait HTTP/1.1" 200 17
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/aee0f255efc43c339aa6fe40c37dc2bdc1efb0c865462cee5c56c923111eded0?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/create?name=figtest_db_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 1683
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310/json HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/start HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "DELETE /run/docker.sock/v1.14/containers/323ac32cff164d182b13a4202fe38065ddf88ebd6a3aedef3e261d10544a0310?force=False&link=False&v=False HTTP/1.1" 204 0
requests.packages.urllib3.connectionpool: DEBUG: "GET /run/docker.sock/v1.14/containers/e1e8813013ba99b0a7278d8d57047c6861703c59753eba57217a1ddfd24c46e9/json HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------
----------------------------------------------------------------------
Ran 180 tests in 216.408s
FAILED (failures=2)

@dnephin

Copy link
Copy Markdown
Author

@aanand I was able to reproduce the error on another host

I believe the issue is related to this TODO I left (service.py#L297)

The intermediate container has the correct volumes, but the final container is being passed the config which creates a new volume first (before the correct volume is applied during start_container()). So when start_container() tries to apply volumes they are ignored instead of overriding.

I'll submit another PR to address the 1.4.1 issue.

dnephin pushed a commit to dnephin/compose that referenced this pull request Jan 20, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
aanand added a commit that referenced this pull request Jan 20, 2015
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Fix volumes on recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…reate"
This reverts commit 55095ef, reversing
changes made to 72095f5.
Signed-off-by: Daniel Nephin <dnephin@yelp.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
…nges
Revert docker#711 from dnephin/fix_volumes_on_recreate
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reload fig.yml to mount the changed volumes

4 participants

@dnephin@bfirsh@aanand@cpuguy83