TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Tell HN: Docker just ate 19GB of production data

75 pointsby fhackenbergeralmost 6 years ago
Be <i>very</i> careful with the live-restore feature of docker. Running &#x27;docker volume prune&#x27; just removed <i>all</i> my named volumes, which were used by running containers.<p>See <a href="https:&#x2F;&#x2F;github.com&#x2F;moby&#x2F;moby&#x2F;issues&#x2F;38883" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;moby&#x2F;moby&#x2F;issues&#x2F;38883</a>

13 comments

gervualmost 6 years ago
Automation of any sort will sometimes accidentally your data, whether due to periodic hiccups, system instabilities and bugs, operator misunderstandings or errors, or random cosmic ray strikes.<p>The exact reason it blows up isn&#x27;t even necessarily all that important, other than in its effect on what you should be doing to reduce the probability of downtime. Well-engineered systems are routinely developed from less than completely reliable parts. Stuff fails, we design for it.<p>It&#x27;s certainly not reason not to <i>use</i> it, if it&#x27;s resulting in a net positive gain in your ability to get things done and maintain control and transparency over your deployed systems.<p>But it&#x27;s certainly a good reason (among a long list of good reasons) to make sure you have a good backup routine in place, including regular testing of both their integrity and your ability to restore a working prod system from them quickly.
评论 #20501023 未加载
评论 #20501846 未加载
jtchangalmost 6 years ago
This definitely sounds like a bug.<p>docker volume prune says:<p>&quot;Remove all unused local volumes. Unused local volumes are those which are not referenced by any containers&quot;<p>If it removed a local volume that was being used by a container that is kinda bad.
orfalmost 6 years ago
1. Why are you running docker volume prune in production?<p>2. Why are you running docker on ad-hoc machines you need to prune?<p>3. Why do you even need root access on production machines to fiddle around with docker commands?<p>While this is obviously a bad bug (and there are many with Docker), it seems more of an operational procedures failure than anything else. You could be saying:<p>“Beware of rm -rf &#x2F;, it just deleted 20gb of production data”<p>Ok. Sure. But why are you tools and procedures putting yourself in a position to make that mistake?
评论 #20501611 未加载
评论 #20502476 未加载
评论 #20502697 未加载
sz4kertoalmost 6 years ago
I really-really hope you are not relying on Docker only when protecting 19G of data. Docker volume operations are the equivalent of playing with sudo rm -rf, shit&#x27;s going to happen once in a while.
评论 #20500958 未加载
praseodymalmost 6 years ago
In the Moby issue you mention that you are using live restore (<a href="https:&#x2F;&#x2F;docs.docker.com&#x2F;config&#x2F;containers&#x2F;live-restore&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.docker.com&#x2F;config&#x2F;containers&#x2F;live-restore&#x2F;</a>) which is most likely where the problem is. Docker daemon restarts, existing containers are kept alive, but the restarted Docker daemon doesn’t know about those existing containers yet and thus thinks their volumes are unused.
RocketSyntaxalmost 6 years ago
Not sure what kind of company you work at, but I&#x27;d export a copy of your logs so you don&#x27;t get canned
stcredzeroalmost 6 years ago
This makes it sound like it&#x27;s quite common to use docker containers operating in a heavily stateful fashion. Is that indeed common nowadays? (Though, the state in this case is only counted on to persist in the named volumes.)
评论 #20500679 未加载
评论 #20500901 未加载
wiredfoolalmost 6 years ago
You just won the “I dropped the production db” achievement.<p>It’s surprisingly easy with docker, especially when dealing with .... legacy systems.
acid303almost 6 years ago
My browser ate 16GB of ram while I&#x27;ve been reading this. The system crashed but the tabs were here there after a reboot. I&#x27;m not even mad anymore.
LiamPaalmost 6 years ago
&gt; please assign this bug to an engineer.<p>The joys of open source users..
评论 #20501675 未加载
DannyB2almost 6 years ago
Computers are wonderful. They can do the same work that would require a thousand people to accomplish in the same amount of time.<p>Flip side . . .<p>Computers are terrible. They can screw things up so bad it would require a thousand people to accomplish in the same amount of time.
frenchman99almost 6 years ago
`docker volume prune` is specifically there to remove volumes, so backing up before using it seems to be mandatory, just in case. But yeah, if this is a bug, it&#x27;s a nasty one.
clintaalmost 6 years ago
This bug specifically says it affects anonymous volumes. If you had it delete a named volume that sounds like a new issue.