TandoorRecipes / recipes

Application for managing recipes, planning meals, building shopping lists and much much more!
https://docs.tandoor.dev
Other
5.37k stars 571 forks source link

Can't import Tandoor export zip file #2433

Closed alexbonazzi closed 1 year ago

alexbonazzi commented 1 year ago

Tandoor Version

1.4.7_11.0.34 on TrueNAS scale

Setup

Kubernetes

Reverse Proxy

No reverse proxy

Other

No response

Bug description

I reinstalled tandoor on TrueNAS-SCALE-22.12.2. Whn I try to import the default export from my PC I got this error "There was an error creating a resource!" and no details

Relevant logs

No response

vabene1111 commented 1 year ago

have you exported in the same version you are trying to import into?

alexbonazzi commented 1 year ago

No Ihad to export alle recipes and reinstall cause Truechart don't upgrade anymore apps without reinstallation

vabene1111 commented 1 year ago

so you exported from an older version and imported into a newer one ?

which version did you export from ?

alexbonazzi commented 1 year ago

I didn't wrote the version I think the precedent

vabene1111 commented 1 year ago

ok, interesting. If you dont mind send me the data to info@tandoor.dev and i can take a look why its failing, maybe its related to the version as importing accross versions is not supported but maybe i can also fix this so you can load your data

vabene1111 commented 1 year ago

generally import/export is not meant as a way to backup your data. You will loose quite a bit of stuff if you do it this way. If your installation does not give you another option i recommend dumping the database and loading it after upgrading. The migrations will be applied automatically (at least if you use docker)

alexbonazzi commented 1 year ago

I sent you data. The database is MySQL ? How can I connect to database ?
Loading data is really great help cause I can see all recipes and complete them.

alexbonazzi commented 1 year ago

I checked some things. MY version was the same cause TrueNAs said that there is no need for update. I exctraced one recipe and tried to import. I got the same error but also this detail "no zip file"

vabene1111 commented 1 year ago

need to look at that, generally i cannot support mysql or truenas installations since i dont know much about that, i can see if there is an actual bug in the importer, if so I can fix it.

alexbonazzi commented 1 year ago

Ok it seems that when I specify the backup zip it is not uploaded by the app.

alexbonazzi commented 1 year ago

I can only select a local file and I can't write a filename

vabene1111 commented 1 year ago

so i just tried importing your file, everything works fine. I am getting 74 recipes and all that i looked at seem to be imported correctly. This must be an issue with your installation i guess.

i tested in the just released 1.4.9 version

alexbonazzi commented 1 year ago

The last version released by Truecharts is 1.4. The backup zip is located my PC, May be that is not loaded by the app. Can you suggest how can I check it ? Thanks

vabene1111 commented 1 year ago

The system page can tell you the latest version. If it's 1.4. 0 it's quite old, might be that there was a bug back then

alexbonazzi commented 1 year ago

Version: is 1.4.7 Ref: [82d1a75d803631493d78e80d3db161787d78b921]

vabene1111 commented 1 year ago

i am sorry but I dont know what else to do. Your export works perfectly fine for me and between 1.4.7. and the current version not much has changed in that regard that I would remember.

alexbonazzi commented 1 year ago

Np maybe that thezip file is not loaded

alexbonazzi commented 1 year ago

How check ?

vabene1111 commented 1 year ago

The application loads it directly into memory. You can set debug to 1 in the environment file, maybe that will show logs in the console

alexbonazzi commented 1 year ago

ok "debug" lower case ? thanks

vabene1111 commented 1 year ago

No upper case, it's in the environment template

alexbonazzi commented 1 year ago

This is log line 023-04-28 16:25:52.266398+00:002023-04-28 16:25:52.266 GMT [28723] LOG: could not receive data from client: Connection reset by peer

alexbonazzi commented 1 year ago

I tried with Chrome and Opera

vabene1111 commented 1 year ago

No idea,sorry.have never used your setup method, there could be a million things wrong there.

alexbonazzi commented 1 year ago

For the next time how can I backup database ? where is it ?

vabene1111 commented 1 year ago

usually its a postgres container, backup there is pretty easy but i dont know what you did with true nas so no idea how to do that. If its individual containers it would probably be easiest to just update the application and leave the database container untouched

alexbonazzi commented 1 year ago

I found also this in log

2023-04-30 16:29:25.079491+00:002023/04/30 16:29:25 [error] 29#29: *596 client intended to send too large body: 19700684 bytes, client: 192.168.2.7, server: _, request: "POST /api/import/ HTTP/1.1", host: "192.168.2.5:10029", referrer: "http://192.168.2.5:10029/data/import/url"

where can I increase maximum upload limit I can't find it in environnement variabiles ?

smilerz commented 1 year ago

It’s in the nginx config. You might be better off splitting the import in two though.

alexbonazzi commented 1 year ago

I splitted in five pieces and I upload all recipes, thanks. My TrueNAS app installation don't have anything about nginx reverse proxy, where can i find it ?

vabene1111 commented 1 year ago

something needs to serve the application on your true nas and there needs to be an option to set the upload size there

thinking about solutions to handle this error in the application better but i think it wont be possible since the request wont be seen by the application 🤔

alexbonazzi commented 1 year ago

If can suggest you it will be nice if it will be possible to backup and restore recipes in a directory, as separate files. It will also nice to backup and restore all data.

alexbonazzi commented 1 year ago

If can suggest you it will be nice if it will be possible to backup and restore recipes in a directory, as separate files. It will also be nice to backup and restore all data.

vabene1111 commented 1 year ago

yes, this has been on the wishlist for quite some time but given that tandoor still regularely develops and changes its quite a bit work to maintain this troguh all versions so for now its database backups only