Import CSV file of any kind says "Whoops, looks like something went wrong."

When I try to import a CSV for any category of data, I get the “Whoops, looks like something went wrong.” screen. Any ideas?

Are you using invoiceninja.com or are you self hosting the app?

Self hosting.

Can you check storage/logs/laravel-error.log for details about the error.

Also are you using our latest version (v3.2), it has some improvements/fixes to the import feature.

My bad. I should’ve checked the Laravel logs located at /var/www/ninja/storage/logs/laravel-error.log first.

The log said:

Unable to write in the “/var/www/ninja/storage/import” directory in /var/www/ninja/vendor/symfony/http-foundation/File/File.php:113

Not 100% sure, but it look like this import directory had different permissions than all of its neighbors because import functionality was added since I originally installed Invoice Ninja. Regardless, the following commands fixed it:

chown www-data:www-data /var/www/ninja/storage/import
chmod 755 /var/www/ninja/storage/import

Thanks Hillel.

Thanks for sharing the fix!

In v3.2 we’ve changed how the import feature works (to prevent possible timeouts), I’ll make sure to note this change in the update guide.