Sooooo - it happened. Nightmare of all the developers on this planet. Entire production database of prismo.news has been accidentally wiped out and it was fully my fault. In this article, i'm gonna try to analyze what happened, how i got here and what can i do to prevent such stuff from happening ever again. This post is gonna be totally technical so if you don’t care or don’t have time to read that, long story short is - make damn sure your backups are properly configured!
As a side note - i'm definitely not a writer nor a native speaker so please be polite. That's probably the longest thing i wrote since high school :)
Server setup
Back in the days (about a year ago) when Primo was just a dozen of days old, I decided to go for hosting it on DigitalOcean droplet. I was using DO for everything hosting-related so far so that was a natural choice.
I’ve set up a VPS, provisioned first Primo deployment, bought an account on wasabi for blob storage and, last but not least, configured DO’s automatic daily backups. Everything was working perfectly well for month or two, there was a shiny new backup waiting to be restored in cause of any failure every morning.
Then, out of nowhere, completely unnecessary change occurred - I just discovered a hosting company called UpCloud (btw. pretty popular in the fediverse afaik). Pricing tier and VPS params were pretty much the same but they had this super intriguing custom SSD solution for fast IO I wanted to test badly. And I did that - I decided to move primo.news to UpCloud. There was nothing really bad about that decision apart from the fact i fu*ked up the operation by forgetting to take the crucial step. I moved the files, I cloned the database, I migrated the secrets but…I forgot to setup daily backups for my new VPS in UpCloud panel. How is that possible? How could i forgot such thing? That question will remain unanswered as I have absolutely no idea.
Git workflows
After several months of prismo.news working totally fine, another milestone has been reached. Till that day, primo development was based on a simplest workflow possible. There was a master
branch with the most current version of codebase and merge requests with all the features being implemented.
Such workflow is fine when there is one developer working on a repo and if there is no much traction in the project + you don't need to think a lot about versioning and hotfixing.
After short discussion, we decided it would be a good idea to move our workflow to a thing called Git flow. I'm not gonna elaborate on that as there are a lot of better sources of knowledge about that on the internet but, in short, instead of having one single main (master
) branch, repo has two main branches
master
for current stable codebasedev
for semi-stable more up-to-date version of the codebase.
Additionally, merge requests are being merged into dev
while merges from dev
to master
are reserved for version releases.
When we switched to git flow, Prismo 0.4.0 has been already released and i was working on a 0.5.x feature called Design system. At this point, i already knew it will take me a lot of time to complete it so there was no sense in changing the branch from which prismo.news instance was being deployed from. 0.4.0 was on master
, prismo.news was deployed from master
and i was standing in front of a potentially month-or-so-long feature so i did not bother to switch production instance to dev
.
Docker setup
Prismo's officially supported way of hosting and deploying is using a provided docker-compose.yml
config file. For simplicity's sake.
Every technical dependency of Prismo is handled by that file - which is Redis and Postgresql at the time of writing this. In order to make the data of such dependency persistent between deploys and restarts, user needs to mount the data volume of such container into the host filesystem. That's an optional commented-out line in the docker-compose.yml
file both for redis and postgresql services (it's commented out as each person would probably want to mount it in his own path of choice).
Sadly, the default value for Prismo docker-compose config file is ./postgres
for the PostgreSQL (PostgreSQL holds entire data of everything posted on Prismo) which resolves to the directory this file is in - which is a root of the application.
As prismo.news is being deployed from the git master
(instead of prebuilt docker images), entire application directory on production environment is controlled by git. Including the ./postgres
directory. Well, at least that's how it was back when i was provisioning Prismo on a DigitalOcean for the very first time. Back then, i saw ./postgres
directory is not listed in .gitignore
file so git is listing it as untracked directory - i hotfixed it directly on the server, added the missing line and, it seems so, i forgot to commit that change to the main repo. So the .gitignore
change was living only on production server.
0.5.0.rc1 💥
After a month of struggle with the new custom frontend framework feature - i finally merged it into dev
just like the new git workflow told us to do. I marked this release as 0.5.0.rc1
and wanted to deploy it to production as fast as possible so users could test it and report any bugs.
I ssh-ed into the server, checked what's going on in there and found out that, just like i wrote earlier, prismo.news is still using master
branch. Without any second thoughts (i had backups configured through the hosting company UI right? what can go wrong?), i triggered git pull
and git checkout dev
and...that's precisely when all hard work done by prismo.news users through a year has been wiped. In a blink of an eye.
I don't fully understand why that happened (will investigate it more, i promise) but, as i wrote, ./postgres
directory containing entire data of prismo.news has been added to .gitignore
locally on master
branch so it was properly ignored since i did that fix. However, after running git checkout dev
, codebase has been changed to the version pulled from the repo and there were no .gitignore
entry about the ./postgres
directory locally anymore. That's the part i don't fully get but it seems the checkout removed the directory for some reason and running docker-compose up
after that recreated the directory from scratch. If there is anyone reading this who understands what happened or what might happened, i would be more than happy to read what you have to say regarding that incident.
I was sure this situation can be fixed by restoring a morning backup but...it turned out i forgot to migrate the backup settings from DigitalOcean to UpCloud months ago while being totally sure they are working fine.
Summary
What i screwed up:
- I forgot to configure backups on UpCloud
- I did not made a manual backup of database directory before the deploy/branch switch
- I forgot to commit
./postgres
to.gitignore
- I kept the database directory mounted along all the git-controlled application files
Upcoming difficulties
There are two main difficulties on our way right now. First one is a problem of duplicated ids of prismo.news posts and comments. They were just a plain incremented integers propagated to entire fediverse. Starting from scratch means the ids are starting from 0 again which creates a duplication across the fediverse and might cause data desynchronization on the entire network. Simplest solution would be to bump the database indexes to not start from 0 but from the last known ID but that does not solve the core of this issue. Such incident can happen to anyone in the future, people are forgetting things, databases are being deleted by accident - Prismo needs to be prepared for that. That's why we're gonna move from integer IDs to GUIDs which are a unique sequence of 32 chars (read more here). This way, even after starting from scratch, no duplication could happen.
Second difficulty, much heavier than the first, is a loss of your trust and loss of valuable content posted prismo.news through this year. I deeply regret of what happened and i hope we can work together and rebuild this cool place without looking back. I'm so sorry this happened.
PS. Proper backup solution is gonna be the first thing i will configure on the new setup. PS2. prismo.news is not gonna be revived until this ID/GUID issue is resolved.
Comments
November 4, 2022 12:16
Mmm.. amazing to be here in your article or post, whatever, I figure I ought to also secure for my own specific site like I see some phenomenal and stimulated working in your site. 강남란제리
November 2, 2022 07:03
Introduction to karaoke where you can eat whiskey in Suwon, Korea. 수원룸싸롱
October 29, 2022 14:50
This is in like way an OK post which I extremely invigorating examining. It isn’t each day that I have the likelihood to see something like this.. 먹튀폴리스
November 19, 2022 13:06
I at long last discovered awesome post here.I will get back here. I just added your blog to my bookmark locales. thanks.Quality presents is the essential on welcome the guests to visit the site page, that is the thing that this website page is giving. 카지노사이트
November 20, 2022 10:43
Incredible post I should state and much obliged for the data. Instruction is unquestionably a sticky subject. Be that as it may, is still among the main themes of our opportunity. I value your post and anticipate more. iecetech.org
November 26, 2022 04:53
Gangaur Realtech is a professionally overseen association work in land administrations where incorporated administrations are given by experts to its customers looking for expanded an incentive by owning, possessing or putting resources into land. 꽁머니 사이트
November 27, 2022 08:58
Its most exceedingly awful piece was that the item just worked intermittently and the data was not exact. You plainly canot go up against anyone about what you have found if the information isn’t right. jamaica
November 20, 2022 15:00
I am overpowered by your post with such a decent theme. Typically I visit your web journals and get refreshed through the data you incorporate yet the present blog would be the most obvious. Well done! Meet People Online
November 26, 2022 07:14
I am truly getting a charge out of perusing your elegantly composed articles. It would seem that you spend a considerable measure of exertion and time on your blog. I have bookmarked it and I am anticipating perusing new articles. Keep doing awesome. 인터넷카지노
November 28, 2022 16:26
Premium Quality at an affordable price. Don’t overpay for custom neon signs. Create your own personalized neon sign now! name neon signs
November 22, 2022 04:21
Mmm.. great to be here in your article or post, whatever, I figure I ought to likewise buckle down for my own site like I see some great and refreshed working in your site. winslot
November 22, 2022 05:15
You should for the most part prevalent together with well-performing material, which implies that see it: mesin slot
November 22, 2022 05:26
Mmm.. admirable to be here in your report or tell, whatever, I notoriety I ought to besides process solid for my have site need I play some salubrious further refreshed occupied in your area. betslot
November 27, 2022 07:15
Such an exceptionally valuable article. Extremely intriguing to peruse this article.I might want to thank you for the endeavors you had made for composing this amazing article. jamaica all inclusive resorts
November 22, 2022 06:22
Strikingly you compose, I will address you’ll discover energizing and fascinating things on comparative themes. hokiplay
November 15, 2022 07:17
The essayist is searing about acquiring wooden furniture on the web and his examination about best wooden furniture has comprehended the plan of this article. 안전놀이터
December 11, 2022 06:17
Sushi Restaurant, Asian Food Restaurant, Best Restaurant Baden Baden. romantische restaurant
November 15, 2022 11:14
Recorded here you’ll learn it is imperative, them offers the connection in an accommodating page: 스포츠토토사이트
November 22, 2022 06:59
I incline toward simply phenomenal assets - you will see these individuals in: mauslot88
November 22, 2022 06:59
I incline toward simply phenomenal assets - you will see these individuals in: mauslot88
November 24, 2022 15:14
Trying to say thanks won’t simply be adequate, for the fantasti c clarity in your written work. I will quickly get your rss channel to remain educated of any updates. prijs luchthavenvervoer zaventem
November 22, 2022 08:56
Composing with style and getting great compliments on the article is very hard, to be honest.But you’ve done it so serenely and with so cool feeling and you’ve nailed the activity. This article is had with style and I am giving great compliment. Best! neon signs
November 22, 2022 09:29
I ought to declare scarcely that its astonishing! The blog is instructive additionally dependably manufacture astonishing entitys. sgtoto
November 22, 2022 09:34
Gangaur Realtech is a professionally administered affiliation work in arrive organizations where consolidated organizations are given by specialists to its clients searching for extended a motivator by owning, having or placing assets into arrive. eratogel
November 25, 2022 04:35
It ought to be noticed that while requesting papers available to be purchased at paper composing administration, you can get unkind state of mind. In the event that you feel that the authority is endeavoring to cheat you, don’t purchase research project from it. 우리카지노
November 18, 2022 05:19
Larger dealers could have reputable collections. Ask friends, family and colleagues for references if you’re seeking high-end rugs. Compare prices after you have narrowed down your selection. Visit several dealers and search the internet to acquire a feel of aspects when you commit to purchasing a rug. You’ll know you have selected the proper piece as soon as you lay it down in your room. If you decide on a local dealer, they will be more than happy to create the rug to your house to help you lay the rug down in your room and know you have the perfect rug. Rugs
November 18, 2022 14:12
Composing with style and getting great compliments on the article is very hard, to be honest.But you’ve done it so serenely and with so cool feeling and you’ve nailed the activity. This article is had with style and I am giving great compliment. Best! ไฮโลออนไลน์
November 28, 2022 05:57
I inquisitive more enthusiasm for some of them trust you will give more data on this subjects in your next articles. cfa course material
November 28, 2022 10:07
In the wake of examining your article I was shocked. I understand that you clear up it extraordinarily well. In addition, I assume that diverse perusers will in like manner experience how I feel in the wake of scrutinizing your article. ฝาก10 รับ 100 ล่าสุด 2022 wallet เลท
November 28, 2022 10:07
In the wake of examining your article I was shocked. I understand that you clear up it extraordinarily well. In addition, I assume that diverse perusers will in like manner experience how I feel in the wake of scrutinizing your article. ฝาก10 รับ 100 ล่าสุด 2022 wallet เลท
November 28, 2022 16:26
Premium Quality at an affordable price. Don’t overpay for custom neon signs. Create your own personalized neon sign now! name neon signs
December 13, 2022 09:52
It’s extremely educational and you are clearly exceptionally proficient around there. You have opened my eyes to differing sees on this point with fascinating and strong substance. เกมสล็อต888
November 30, 2022 06:14
I am another client of this site so here I saw different articles and posts posted by this site,I inquisitive more enthusiasm for some of them trust you will give more data on this points in your next articles. jamaica 5 star all inclusive resorts
November 30, 2022 07:16
I am another client of this site so here I saw different articles and posts posted by this site,I inquisitive more enthusiasm for some of them trust you will give more data on this points in your next articles. dominican republic for vacation
December 1, 2022 15:30
Exceptionally useful post ! There is a considerable measure of data here that can enable any business to begin with a fruitful long range informal communication campaign ! anal warts treatment
December 3, 2022 14:37
Trying to say thanks won’t simply be adequate, for the fantasti c clarity in your written work. I will immediately snatch your rss channel to remain educated of any updates. https://tools.seohelp.me/
December 5, 2022 15:46
부산 해운대고구려 정찰제 룸싸롱 1위 추천 해운대룸싸롱
December 5, 2022 16:01
If you should be considering expanding your organization to online ordering it is simple to create a web page with your menu, prices and an order form to process credit and debit card purchases with restaurant POS software. online ordering system
December 5, 2022 19:03
I inquisitive more enthusiasm for some of them trust you will give more data on this subjects in your next articles. 윈조이머니상
December 7, 2022 12:57
Composing with style and getting great compliments on the article is very hard, to be honest.But you’ve done it so serenely and with so cool feeling and you’ve nailed the activity. This article is had with style and I am giving great compliment. Best! เกมยิงปลาออนไลน์ได้เงินจริง
December 24, 2022 14:01
Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting. And I found this one pretty fascinating and it should go into my collection. Very good work! bridal boutique Houston
December 31, 2022 15:58
I have a comparable intrigue this is my page read everything deliberately and let me comprehend what you think. เว็บสล็อตเปิดใหม่2022
January 1, 2023 19:05
There you can download for nothing, see the first of these information. Slot Roma
January 2, 2023 18:53
I should state just that its magnificent! The blog is instructive and dependably create astonishing things. รวมค่ายสล็อต
January 4, 2023 19:18
I am another client of this site so here I saw different articles and posts posted by this site,I inquisitive more enthusiasm for some of them trust you will give more data on this points in your next articles. matka
January 12, 2023 12:14
I inquisitive more enthusiasm for some of them trust you will give more data on this subjects in your next articles. เว็บพนันเว็บตรง
April 3, 2023 14:42
Situs judi JDB slot indonesia game terpercaya paling gacor 100%. Daftar segera di link bo jdb gaming terbaik deposit pulsa. JDB slot terpercaya
March 18, 2023 16:44
I inquisitive more enthusiasm for some of them trust you will give more data on this subjects in your next articles. เว็บสล็อตแตกง่ายที่สุด
January 31, 2023 18:54
Goodness! Such an astounding and supportive post this is. I outrageously cherish it. It’s so great thus amazing. I am simply flabbergasted. I trust that you keep on doing your work like this later on moreover. PG Slot
March 20, 2023 18:09
I for one utilize them solely astounding components : you will see these people amid: Pokdeng online
March 21, 2023 08:16
Benefit basically prime quality things - you can comprehend them all inside: สล็อตเว็บใหญ่
February 22, 2023 05:58
Goodness! Such an astounding and supportive post this is. I outrageously cherish it. It’s so great thus amazing. I am simply flabbergasted. I trust that you keep on doing your work like this later on moreover. https://toto40.com
February 24, 2023 10:24
I obviously esteeming each and every piece of it and I have you bookmarked to look at new stuff you post. ufabet เว็บตรง
February 28, 2023 06:52
Link daftar situs slot server indonesia resmi dan gacor no 1 mudah menang maxwin 2023 dari provider pay4d. slot server indonesia resmi 2023
February 28, 2023 15:15
I am overpowered by your post with such a decent theme. Typically I visit your web journals and get refreshed through the data you incorporate yet the present blog would be the most obvious. Well done! cfa level 1 formula sheet
March 2, 2023 14:39
It’s extremely educational and you are clearly exceptionally proficient around there. You have opened my eyes to differing sees on this point with fascinating and strong substance. 카지노사이트
March 5, 2023 05:27
Link situs slot 1000 server luar negeri kamboja, thailand, amerika, singapore, malaysia, vietnam, filipina tergacor dan terpercaya no 1 mudah menang maxwin petir x500 rtp winrate tertinggi. situs slot 1000
March 6, 2023 12:50
I am overpowered by your post with such a decent theme. Typically I visit your web journals and get refreshed through the data you incorporate yet the present blog would be the most obvious. Well done! migliori stampanti 3d professionali
March 8, 2023 14:43
I am overpowered by your post with such a decent theme. Typically I visit your web journals and get refreshed through the data you incorporate yet the present blog would be the most obvious. Well done! Kansas City website design
March 13, 2023 15:00
Goodness! Such an astounding and supportive post this is. I outrageously cherish it. It’s so great thus amazing. I am simply flabbergasted. I trust that you keep on doing your work like this later on moreover. สล็อตเว็บใหญ่
May 14, 2023 03:35
These are just a few examples of popular online game sites. However, it’s important to always research and verify the reputation and safety of any online game site before using it. 토토사이트 추천
April 10, 2023 09:07
I am overpowered by your post with such a decent theme. Typically I visit your web journals and get refreshed through the data you incorporate yet the present blog would be the most obvious. Well done! เว็บพนันเว็บตรง
June 20, 2023 11:38
검증된 파워볼사이트 를 찾으신다면 eos파워볼사이트 가 있는 파워볼사이트추천 에서 파워볼 을 즐기시길 바랍니다. 5년 이상 운영된 메이저업체 이며 지금까지 많은분들께 사랑받은 안전한파워볼사이트 입니다. 파워볼사이트
July 4, 2023 07:03
KIBO Lotto - a popular online betting platform for Toto and other lottery games in Japan. สล็อตรวมทุกค่าย
April 9, 2019 14:54
Oi! Thanks for the transparency! Thanks also for the work on the project!
April 22, 2019 19:05
@mxb wow this is a bummer. I was trying to post something to Prismo.news and just found out what happened...
May 10, 2023 03:12
UPC codes are used to identify and track products in retail stores and are scanned at the checkout to retrieve product information and prices. get barcode
October 3, 2022 12:22
This is a marvelous article, Given such an unprecedented measure of information in it, These kind of articles keeps the clients energy for the site, and continue sharing more … positive conditions. 홀덤
September 22, 2022 05:15
Sceneca Residence by MCC Land. Hotline 61004343. Get Discounts, Direct Developer Price, Floor Plan, Price List, Brochure & More.sceneca residence condo
September 22, 2022 16:20
Freehold condo at draycott park. Hotline 61004343. Get Discounts, Direct Developer Price, Floor Plan, Price List, Brochure & More.one draycott condo
September 26, 2022 06:10
I am checking for and I have to post a remark that “The substance of your post is excellent” Great work! tactical hunting vest
October 9, 2022 06:55
Amazing learning and I get a kick out of the opportunity to give this kind of information to my sidekicks and desire they like it they why I do 마사지커뮤니티
October 9, 2022 10:38
I am checking for and I have to post a remark that “The substance of your post is excellent” Great work꽁머니 토토
September 27, 2022 07:19
英国、澳大利亚、美国、加拿大,新西兰等国广大留学生致以最为优质的论文代写、代考、作业代写、网课代修以及其他学术辅导工作。Excellent Due的团队写手由于合作形式多样化;功底扎实且经验丰富;研究思路新颖奇特;所以写手阵容空前强大,可根据各国地方文化、语言特色、写作方式与习惯的不同,制定对口论文级作业代写。网课代修可保成绩,任何作业保证100%原创,100%通过。提交给您之前初稿Turnitin UK或Turnitin国际版最新反抄袭系统检测,完美达到作业要求。美国论文代写
October 5, 2022 10:25
Grateful to you for your post, I search for such article along time, today I discover it at last. this post give me heaps of incite it is to an awesome degree steady for me. 바둑이
September 29, 2022 13:07
I would support my profile is critical to me, I welcome you to take a gander at this subject… 토토커뮤니티
October 5, 2022 14:45
It ought to be seen that while requesting papers available to be gained at paper making association, you can get unkind point of view. On the off chance that you feel that the pro is endeavoring to cheat you, don’t purchase ask about assignment from it. 15 degree wire collated coil nails
October 8, 2022 06:42
stunning, glorious, I was thinking about how to cure skin disturbance routinely. likewise, discovered your site by google, took in a ton, now i’m to some degree clear. I’ve bookmark your site and also join rss. keep us resuscitated. 토토사이트
October 6, 2022 08:54
Three are normally modest Ralph Lauren accessible available to be purchased every last time you wish to purchase. 꽁머니 사이트
October 6, 2022 10:51
stunning, glorious, I was thinking about how to cure skin disturbance routinely. likewise, discovered your site by google, took in a ton, now i’m to some degree clear. I’ve bookmark your site and also join rss. keep us resuscitated. 바둑이
October 15, 2022 06:35
A commitment of gratefulness is all together for the educational and satisfying post, obviously in your blog everything is unprecedented.. 먹튀사이트
October 6, 2022 15:39
It ought to be seen that while requesting papers available to be gained at paper making association, you can get unkind point of view. On the off chance that you feel that the pro is endeavoring to cheat you, don’t purchase ask about assignment from it. 토토사이트
October 19, 2022 09:58
About Whiskey Shirt Karaoke in Gangnam, South Korea. 셔츠룸
October 10, 2022 14:04
Composing with style and getting great compliments on the article is very hard, to be honest.But you’ve done it so serenely and with so cool feeling and you’ve nailed the activity. This article is had with style and I am giving great compliment. Best! ฝากถอนไม่มีขั้นต่ํา
October 10, 2022 17:56
It is ideal time to make a few arrangements for the future and the time has come to be upbeat. I’ve perused this post and on the off chance that I would I be able to want to recommend you few fascinating things or tips. Maybe you could compose next articles alluding to this article. I need to peruse more things about it! เกมสล็อต888
October 11, 2022 06:10
I am awed by the information that you have on this blog. It exhibits how well you appreciate this subject. 먹튀사이트
October 11, 2022 06:41
Much obliged to you for your post, I search for such article along time, today I discover it at long last. this post give me heaps of prompt it is extremely helpful for me. 토토
October 15, 2022 15:27
This is a marvelous article, Given such an unprecedented measure of information in it, These kind of articles keeps the clients energy for the site, and continue sharing more … positive conditions. 토토
October 15, 2022 09:53
I am truly grateful to the holder of this site page who has shared this awe inspiring segment at this place 토토추천
October 11, 2022 12:08
Stunning learning and I get a kick out of the chance to give this sort of data to my sidekicks and want they like it they why I do 꽁머니 5000
October 12, 2022 08:38
This is in like way an OK post which I extremely invigorating examining. It isn’t each day that I have the likelihood to see something like this.. USA
October 12, 2022 18:39
I am checking for and I have to post a remark that “The substance of your post is excellent” Great work! ดูหนังออนไลน์ฟรี
October 30, 2022 06:22
Finnish marketing site Supermarkkinointi.com. Hakukoneoptimointi SEO
November 28, 2022 16:16
Premium quality at an affordable price. The UK’s most affordable supplier of custom neon signs. custom neon signs
November 6, 2022 07:54
I expect you to thank for your time of this phenomenal read!!! I definately welcome each and every piece of it and I have you bookmarked to look at new stuff of your blog a specific essential read blog! 온라인바카라
November 4, 2022 11:13
This is in like way an OK post which I extremely invigorating examining. It isn’t each day that I have the likelihood to see something like this.. 온라인바카라
November 5, 2022 18:08
Beaver says I additionally have such intrigue, you can read my profile here: puerto morelos mex
January 27, 2023 19:42
I’m eager to reveal this page. I have to thank you for ones time for this especially awesome read!! I unquestionably extremely enjoyed all aspects of it and I likewise have you spared to fav to take a gander at new data in your site. 168bet