mealie-recipes / mealie

Mealie is a self hosted recipe manager and meal planner with a RestAPI backend and a reactive frontend application built in Vue for a pleasant user experience for the whole family. Easily add recipes into your database by providing the url and mealie will automatically import the relevant data or add a family recipe with the UI editor
https://docs.mealie.io
GNU Affero General Public License v3.0
6.78k stars 698 forks source link

Error thrown when creating a backup #644

Closed greerchristo closed 2 years ago

greerchristo commented 3 years ago

Describe the bug

Error when creating backup

Log:

ERROR: 01-Aug-21 15:00:56 [Errno 2] No such file or directory

Steps To Reproduce

  1. Go to Dashboard, backups
  2. Click on 'create'

Expected behavior Backup file created

Actual Behavior Error thrown when attempting to create a backup:

""Error creating backup see log file""

Device Information (please complete the following information):

greerchristo commented 3 years ago

I did a wipe of my postgres install and replaced it with sqlLite and was able to run a backup without issue. I deleted that backup with the intent of just letting the autobackup run and I am now getting this same error if I attempt to run a backup manually again.. I opened the browser console and I get the following:

xhr.js:177 POST http://192.168.1.4:9920/api/backups/export/database 500 (Internal Server Error) (anonymous) @ xhr.js:177 t.exports @ xhr.js:13 t.exports @ dispatchRequest.js:52 Promise.then (async) c.request @ Axios.js:61 i.forEach.c. @ Axios.js:87 (anonymous) @ bind.js:9 (anonymous) @ api-utils.js:41 l @ runtime.js:63 (anonymous) @ runtime.js:293 (anonymous) @ runtime.js:118 i @ asyncToGenerator.js:3 s @ asyncToGenerator.js:25 (anonymous) @ asyncToGenerator.js:32 (anonymous) @ asyncToGenerator.js:21 t @ api-utils.js:40 (anonymous) @ api-utils.js:80 l @ runtime.js:63 (anonymous) @ runtime.js:293 (anonymous) @ runtime.js:118 i @ asyncToGenerator.js:3 s @ asyncToGenerator.js:25 (anonymous) @ asyncToGenerator.js:32 (anonymous) @ asyncToGenerator.js:21 t @ api-utils.js:79 (anonymous) @ backup.js:44 l @ runtime.js:63 (anonymous) @ runtime.js:293 (anonymous) @ runtime.js:118 i @ asyncToGenerator.js:3 s @ asyncToGenerator.js:25 (anonymous) @ asyncToGenerator.js:32 (anonymous) @ asyncToGenerator.js:21 create @ backup.js:43 (anonymous) @ BackupViewer.vue:148 l @ runtime.js:63 (anonymous) @ runtime.js:293 (anonymous) @ runtime.js:118 i @ asyncToGenerator.js:3 s @ asyncToGenerator.js:25 (anonymous) @ asyncToGenerator.js:32 (anonymous) @ asyncToGenerator.js:21 createBackup @ BackupViewer.vue:139 ie @ vue.runtime.esm.js:1863 n @ vue.runtime.esm.js:2188 ie @ vue.runtime.esm.js:1863 t.$emit @ vue.runtime.esm.js:3903 click @ VBtn.ts:163 ie @ vue.runtime.esm.js:1863 n @ vue.runtime.esm.js:2188 Qr.o._wrapper @ vue.runtime.esm.js:6961

greerchristo commented 3 years ago

So yesterday I was able to find the Aug 5 auto backup in the /mealie/data/.temp directory so I copied it to /mealie/data/backups to see what would happen overnight. It appears the autobackup ran, deleted that file and failed to place the Aug 6 backup in the /data/backups dir. I did find it in /.temp just like the Aug 5 file so I'm just not sure why it doesn't put the file in the backup directory?

hay-kot commented 3 years ago

I was able to replicate this, but it quickly went away without me doing anything. I'm still tracking it and will roll an update out once I figure it out. Any more information others would be helpful. Especially if you can replicate with some specific steps

greerchristo commented 3 years ago

Makes sense, I think I am probably unable to help at this point because it was working fine for me and I"m not entirely sure what happened that caused it to occur and perpetually continue to happen. From my perspective all I did was press the green create button in the backup interface

davidfrankks commented 3 years ago

Same error

From mealie.log when I click create backup in the web interface.
ERROR: 16-Aug-21 13:15:59 [Errno 2] No such file or directory

Using docker image

docker compose contents, same as the example other than paths.

version: "3.1" services: mealie: container_name: mealie image: hkotel/mealie:latest restart: always ports:

hedwig34 commented 3 years ago

I also had the errno 2 when attempting a backup. I am running the docker image using docker-compose. In one of the previous messages someone mentioned permissions. I checked the volume under recipes and the recent ones I'd added had user root:root and the older ones had user 911:911. I shut the down the stack and restarted it. I saw that all of the recipes now have owner 911:911. The back up now works for me. I did pull in an update to docker-ce via apt a couple of days ago and did not restart my containers. I can't confirm but wonder if this could have been a symptom of the docker update and simply stopping and starting the container made it right.

And by the way I am loving this app. Thanks!

greerchristo commented 3 years ago

I also had the errno 2 when attempting a backup. I am running the docker image using docker-compose. In one of the previous messages someone mentioned permissions. I checked the volume under recipes and the recent ones I'd added had user root:root and the older ones had user 911:911. I shut the down the stack and restarted it. I saw that all of the recipes now have owner 911:911. The back up now works for me. I did pull in an update to docker-ce via apt a couple of days ago and did not restart my containers. I can't confirm but wonder if this could have been a symptom of the docker update and simply stopping and starting the container made it right.

And by the way I am loving this app. Thanks!

thanks for this insight.

I went ahead and ran a chmod -R 777 on my /mealie/data/recipes directory, rebooted and it got fixed. With that said a number of the recipes had 755 permission which I can only assume prevented the backup from running

eric72777 commented 3 years ago

I also had the same issue of errno 2 during a backup. I noticed that older recipes had user 911:911 but newer recipes had user root:911. As suggested by hedwig34, I performed docker-compose down then docker-compose up -d. Like hedwig34, all recipes now have 911:911 and the backup works without issue. The new backup has user root:911 but older backups have 911:911.

I'm using version v0.5.2

charles-997 commented 2 years ago

Chiming in a few months later here to note I am having the same error when trying to perform a backup via the Dashboard page of the webgui.

OS: Unraid via Portainer & CLI (not the traditional Unraid Apps & Docker GUI method) Here is my docker compose file (using sqlite)

version: "3.1"
services:
  mealie:
    container_name: mealie
    image: hkotel/mealie:latest
    restart: always
    ports:
      - 9100:80
    environment:
      db_type: sqlite
      TZ: America/New_York
    volumes:
      - /mnt/remotes/TRUENAS.CHARLES.HOME_docker/mealie/:/app/data

Currently on v0.5.2 (I am behind the latest 0.5.4, so naturally I went to run a backup before upgrading to the latest image and thus discovered this!)

Logs:

192.168.180.16:0 - "GET /api/users/1/image HTTP/1.1" 404
192.168.180.16:0 - "GET /api/users/1/image HTTP/1.1" 404
192.168.180.16:0 - "GET /api/users/1/image HTTP/1.1" 404
192.168.180.16:0 - "GET /api/users/1/image HTTP/1.1" 404
192.168.180.16:0 - "GET /api/backups/available HTTP/1.1" 200
192.168.180.16:0 - "GET /api/debug/statistics HTTP/1.1" 200
192.168.180.16:0 - "GET /api/backups/available HTTP/1.1" 200
192.168.180.16:0 - "GET /api/backups/available HTTP/1.1" 200
192.168.180.16:0 - "GET /api/debug/statistics HTTP/1.1" 200
192.168.180.16:0 - "GET /api/backups/available HTTP/1.1" 200
192.168.180.16:0 - "GET /api/about/events HTTP/1.1" 200
192.168.180.16:0 - "GET /api/about/events HTTP/1.1" 200
ERROR: 18-Dec-21 18:26:27   [Errno 2] No such file or directory
192.168.180.16:0 - "POST /api/backups/export/database HTTP/1.1" 500

Please let me know if any other info is useful.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.