nickatomlin / DKAN

Building a transparency portal for Rhode Island municipalities.
GNU General Public License v2.0
0 stars 0 forks source link

Error uploading 2MB+ CSV file #6

Closed nickatomlin closed 8 years ago

nickatomlin commented 8 years ago

I tried to add the 2014 Actuarial Source Data for ERSRI Retirees to the DKAN site as a CSV, but the upload failed at around 50%.

dkan-error

Re-clicking upload consistently results in the same error, as does trying to upload the data to another dataset. Not sure if the error here lies in the data, or in the ability to upload large-ish CSV files, but the CSV was correctly hosted on treasury.ri.gov's CKAN site.

nickatomlin commented 8 years ago

Duplicated the error with a 3.9MB CSV file taken from SpatialKey's Sample CSV Data. dkan-error2

nickatomlin commented 8 years ago

I suspect this is related to file-size, because a 119KB file uploaded correctly, as shown here: dkan-noerror File can be found here. Data from this sample set also displays correctly on a map, which is a nice feature. dkan-map

nickatomlin commented 8 years ago

According to this post on the NuCivic DKAN Github page, the issue may be related to memory limits. Upping memory_limit to 4096MB.

nickatomlin commented 8 years ago

Added a phpinfo.php file in 1b4439afb5d6b746ca22814cba18c8c60c173d01 to determine that the loaded PHP configuration file is at /etc/php5/fpm/php.ini.

php-config

$ vagrant ssh
$ sudo nano /etc/php5/fpm/php.ini

Changed memory_limit=128M; to memory_limit=2048M (the max allowed by Vagrantfile) and restarted PHP:

$ sudo service php5-fpm restart

memory_limit

However, the upload process seems exactly the same as before -- CSVs over 2MB simply aren't being uploaded to the site.

note: visit http://dkan-test.local.com/phpinfo.php to see phpinfo()

nickatomlin commented 8 years ago

Duplicated the error with an Excel file uploadxls

nickatomlin commented 8 years ago

Per many online solutions, I tried increasing the values of upload_max_filesize and post_max_size. This is the most common solution for large file uploading issues on PHP. The former was set to 2MB, so I thought perhaps it was the cause of the 2MB cutoff. Again, both of these were in /etc/php5/fpm/php.ini.

Setting these values as high as 2048MB did no change, so I left them at 64MB and gave up with that approach. Setting post_max_size above upload_max_filesize didn't work either.

nickatomlin commented 8 years ago

Adding max_allowed_packet = 64M to the php.ini file was similarly unhelpful. Currently

memory_limit = 2048M
upload_max_filesize = 64M
post_max_size = 128M
nickatomlin commented 8 years ago

Not an issue on the Acquia Devcloud version of the site. Still can't preview the 2MB+ CSV files, but at least we can store them. novis Check again once we have a new development version of the site.

nickatomlin commented 8 years ago

The error still exists on new Vagrant build of the site.