Part-DB / Part-DB-legacy

[LEGACY Version] Open Source Electronic Parts Database using PHP and MySQL
GNU General Public License v2.0
158 stars 35 forks source link

Import CSV issue #77

Closed ObligedTester closed 4 years ago

ObligedTester commented 4 years ago

After uploading the file and checking that the data is OK, clicking "Apply data and check" results in it just returning to "Import", and nothing gets imported. Also no error message.

jbtronics commented 4 years ago

How do your CSV file look like?

What happens if you try to upload the example files: https://github.com/Part-DB/Part-DB/tree/master/documentation/examples/import_parts

ObligedTester commented 4 years ago

Actually, importing the example, results in a green message with a green checkmark, and the text "Invalid data". So that is pretty strange?

jbtronics commented 4 years ago

What Part-DB version do you use?

ObligedTester commented 4 years ago

0.5.8

jbtronics commented 4 years ago

Okay, I have just released a new version, where import should work as intended: https://github.com/Part-DB/Part-DB/releases/tag/v0.5.9

ObligedTester commented 4 years ago

Just tested it right now, and the example file works. A blue button appears after pressing "apply data and check", however the problem with my file is still the same. After pressing "Apply data and check" it disappears and returns to the "import" without any messages.

The strange thing is that it shows up OK after "upload"

jbtronics commented 4 years ago

You can send me your file via mail: jan.h.boehmer@gmx.de

And i will look into it if I have time

jbtronics commented 4 years ago

Okay, I found the problem. The issue is related to a limit of PHP, that only some amount of variables can be passed via request. Every field you see in the table will be transfered as form field, so the default limit is reached early.

To change that: Go to your php.ini file, search for max_input_vars and change it to max_input_vars = 3000. Then restart your webserver and the import should work.

In the new version I am working on, I hope to find a better solution, so that even big imports will not cause problems...

ObligedTester commented 4 years ago

Did you try that solution on your end? Because i must have done something wrong. It is still the same. Also tried to just cut the file in two parts instead. Same thing

jbtronics commented 4 years ago

What is shown in System->Config page in the server panel for the value of "Max. input vars" ? When the value there is less than 3000 your change to ini settings was not applied.

Splitting the file in half is not enough (it is still too long then), maybe try to use just the first 5 rows or so...

ObligedTester commented 4 years ago

Youre absolutely right. It just says 1000.

I did check that /etc/php/7.3/cli/php.ini is the loaded config file. Did the edit and restarted apache. So there is something not playing along

jbtronics commented 4 years ago

The cli folder is wrong (this one is used when you run PHP from command line). You need to edit the file under /etc/php/7.3/apache or /etc/php7.3/apache (or similar) to edit the one used by apache...

ObligedTester commented 4 years ago

Yes! That did it! Thank you very much

mrWheel commented 3 years ago

Hi, Having the same issue with the docker-stable image, Version: 0.5.8 (stable), Git: stable-v0.5/ "NextGen". But there is no file "php.ini" .... Is there a solution for the docker image?