# Upgrade to Ubuntu 22.04 couch service error after couchdb restoration

**URL:** <https://forum.dimagi.com/t/upgrade-to-ubuntu-22-04-couch-service-error-after-couchdb-restoration/9880>\
**Category:** Developers\
**Created:** [June 9, 2023, 8:07am UTC](https://forum.dimagi.com/t/upgrade-to-ubuntu-22-04-couch-service-error-after-couchdb-restoration/9880 "2023-06-09T08:07:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![fchiyenda](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fchiyenda](https://forum.dimagi.com/u/fchiyenda)\
**Post date:** [June 9, 2023, 8:07am UTC](https://forum.dimagi.com/t/upgrade-to-ubuntu-22-04-couch-service-error-after-couchdb-restoration/9880/1 "2023-06-09T08:07:06Z")

</div>

Hello good people,

After following the upgrade I happen to have run into some problems which I think someone can assist me with:

1. Postgres restoration following [plain (pg\_basebackup) without S3](https://commcare-cloud.readthedocs.io/en/latest/backups_dr/2-backups-guide.html?highlight=backup#plain-pg-basebackup-without-s3)  
When following the exact step I get permission errors so used root user to do the process and restored the access privilege's and ownerships just wanted to know if I am missing something.

2. Couchdb Restoration following [Restoring CouchDB backups (on a single node cluster)](https://commcare-cloud.readthedocs.io/en/latest/backups_dr/2-backups-guide.html?highlight=backup#restoring-couchdb-backups-on-a-single-node-cluster) this runs sucessfully using elevated privilege's because it seems that couchdb does not have privileges to access /opt/data/backups and after restoring successfully

---

<div class="post-metadata">

**Author:** ![Sravan\_Reddy](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@Sravan\_Reddy](https://forum.dimagi.com/u/Sravan_Reddy)\
**Post date:** [June 20, 2023, 3:42pm UTC](https://forum.dimagi.com/t/upgrade-to-ubuntu-22-04-couch-service-error-after-couchdb-restoration/9880/2 "2023-06-20T15:42:05Z")

</div>

Hello Fredrick,

For 1, if you were able to restore the data correctly and the Postgres is running fine, then that should be fine.

For 2, the next thing you can check to see what's wrong with the CouchDB is to examine the couchdb service status and its logs to see why exactly it's erroring. The couchdb log directory should be at `/usr/local/couchdb2/couchdb/var/log/` if you are on Ubuntu 18.04 else at `/opt/couchdb/var/log/`.

Please let us know if you need further assistance.

Thanks  
Sravan

---

<div class="post-metadata">

**Author:** ![fchiyenda](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fchiyenda](https://forum.dimagi.com/u/fchiyenda)\
**Post date:** [June 21, 2023, 3:53pm UTC](https://forum.dimagi.com/t/upgrade-to-ubuntu-22-04-couch-service-error-after-couchdb-restoration/9880/3 "2023-06-21T15:53:05Z")

</div>

> [@Sravan\_Reddy](#):
>
> usr/local/couchdb2/couchdb/var/log/

Hello Sravan,

Thank you for the reply checking my couchdb logs it seems the service is not able to find some dbs please refer to the attached screenshot.

Looking forward to your advice.

Thanks Fredrick

 ![Couchdb Error.PNG](https://dimagi.b-cdn.net/uploads/default/original/2X/6/6891d20647265005cb1630f04ccb6a3fd472d529.jpeg)

---

<div class="post-metadata">

**Author:** ![Sravan\_Reddy](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@Sravan\_Reddy](https://forum.dimagi.com/u/Sravan_Reddy)\
**Post date:** [June 26, 2023, 7:47am UTC](https://forum.dimagi.com/t/upgrade-to-ubuntu-22-04-couch-service-error-after-couchdb-restoration/9880/4 "2023-06-26T07:47:45Z")

</div>

Hello Fredrick,

The error message (`not_found, no_db_file`) indicates that the couchdb may not have been restored correctly from the backup. Have you made sure that the CouchDB is restored correctly. Here are the relevant docs [Backup and Restore — CommCareHQ Deployment documentation](https://commcare-cloud.readthedocs.io/en/latest/backups_dr/2-backups-guide.html#restoring-couchdb-backups-on-a-single-node-cluster)

---

<div class="post-metadata">

**Author:** ![fchiyenda](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fchiyenda](https://forum.dimagi.com/u/fchiyenda)\
**Post date:** [June 27, 2023, 5:31pm UTC](https://forum.dimagi.com/t/upgrade-to-ubuntu-22-04-couch-service-error-after-couchdb-restoration/9880/5 "2023-06-27T17:31:55Z")

</div>

Thank you very much Sravan. I have when through the process again for several times. When I try to access the couchdb database using the curl command it's giving the the error:

{"error":"internal\_server\_error","reason":"No DB shards could be opened.","ref":3096826546}.

I might still be missing something in the process but I have followed it to the letter.

Kindly advise.  
Fredrick

---

<div class="post-metadata">

**Author:** ![fchiyenda](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fchiyenda](https://forum.dimagi.com/u/fchiyenda)\
**Post date:** [July 6, 2023, 11:48am UTC](https://forum.dimagi.com/t/upgrade-to-ubuntu-22-04-couch-service-error-after-couchdb-restoration/9880/6 "2023-07-06T11:48:40Z")

</div>

Hello Sravan,

Got my problem sorted out. I was not able to use the restore instructions in the documentation it still were ending me up in the same situation. I managed to sort it out by using couchdb-dump to backup and restore into the new instance it worked like a charm. Thank you very much for your support really appreciate.

Fredrick

---

<div class="post-metadata">

**Author:** ![erobinson](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/erobinson/32/2652_2.png) [@erobinson](https://forum.dimagi.com/u/erobinson)\
**Post date:** [October 25, 2023, 7:34pm UTC](https://forum.dimagi.com/t/upgrade-to-ubuntu-22-04-couch-service-error-after-couchdb-restoration/9880/7 "2023-10-25T19:34:26Z")

</div>

@fchiyenda which couchdb-dump did you use? I see there are a few online.  
I have found this: [GitHub - danielebailo/couchdb-dump: Bash command line scripts to dump &restore a couchdb database](https://github.com/danielebailo/couchdb-dump)  
There's also: [GitHub - aphexcreations/couchdbdump: CouchDB Dump](https://github.com/stockr-labs/couchdbdump)  
and [GitHub - zebooka/couchdb-dump: Ultimate Dump and Restore php scripts tools for CouchDB](https://github.com/zebooka/couchdb-dump)

Thanks!

---

<div class="post-metadata">

**Author:** ![fchiyenda](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fchiyenda](https://forum.dimagi.com/u/fchiyenda)\
**Post date:** [January 25, 2024, 9:48am UTC](https://forum.dimagi.com/t/upgrade-to-ubuntu-22-04-couch-service-error-after-couchdb-restoration/9880/8 "2024-01-25T09:48:40Z")

</div>

Hello Ed,

Sorry for the late reply.

We used the first link [GitHub - danielebailo/couchdb-dump: Bash command line scripts to dump &restore a couchdb database](https://github.com/danielebailo/couchdb-dump)

Fredrick
