Stuck with an error importing CSV to Database!

This error often shows if the file upload fails - the most common reason for this is permissions. Have you checked that the folder exists on the web server and the web service account (often www-data on Linux ) has write permission for the folder?

Hey Ben, that makes sense. Didn’t think of it!

I’m running this currently on Docker locally though. Would you be aware on where can I find these permission settings?

I’m checking too…

Found a setting in the projects for user upload folder. Have updated that to “/import”(was earlier empty) but no luck.

Still getting 500

“message”:“export.csv: path is required.”,“stack”:“Error: export.csv: path is required.\n at App.parseRequired (/opt/node_app/lib/core/app.js:293:19)\n at App.csv (/opt/node_app/lib/modules/import.js:111:25)\n at App._exec (/opt/node_app/lib/core/app.js:255:57)\n at App._exec (/opt/node_app/lib/core/app.js:234:28)\n at async App.exec (/opt/node_app/lib/core/app.js:205:9)\n at async App.define (/opt/node_app/lib/core/app.js:188:9)”}

I haven’t used docker yet but you could check that the folder exists in the file viewer. What you need is the folder on the remote target. If it’s not there, create it locally and click publish to sync all files/folders

The folder exists in my local machine and can be seen in the file viewer too. But the target location show this:

Local shows this but there’s no publish option. And upload does nothing at all.

The publish button is at the bottom, just to the right of where you select your project and targets.

I believe it’s different with Docker as this is what I see with Deploy working like publish…

@Teodor @patrick is this a bug? Or am I doing something wrong here?

Getting some hints from this thread User Assets in docker container - Changes in production env

but unable to figure out how this can be tested locally with Docker…Looks like I’m missing some more settings or commands

This error is just what it tells you, the path options is not set. I see in your post that you set it with upload1/path, this somehow is not set or null. This is possible when no file was uploaded or something went wrong during the upload. In the upload step set the option to throw errors, then you will see if there goes anything wrong there.

Hi Patrick, I do have the “throw errors” option turned on. But I’m getting the same 500 message: export.csv: path is required

What kind of upload do you have on your page, is it possible that it is a multi upload? Please test the upload by enabling its output option and disable all steps after the upload, then check the response from the server after you upload a file.

Hi Patrick, it’s a single file upload. Disabled the other steps apart from the file upload. Response status is 200 but upload1 seems empty. What could be the issue?

I’m using docker on localhost.

At least we now know that it is indeed the upload step that isn’t working. Please check the Headers tab and look what is posted to the server, is the file input named input1 and is the form posted correctly.

Yes, input1 is getting passed.

Here’s what the form looks like:

It wasn’t in Docker, but I got this message when the folder I was trying to upload to either didn’t exist or the permission wasn’t there for the web account. Might not help but hoped it would…

Yep yep got it!

I added it again in case @patrick hadn’t seen the earlier post :face_with_monocle:

You do not post your form, change the Method to post instead of get to make the upload work.

3 Likes

Thank you Patrick for teaching me how to debug this step by step. Files are getting uploaded now.

I had an impression it was more complicated than that. Feeling so stupid after wasting your time guys on such a trivial mistake @patrick @bpj

2 Likes