question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when uploading CSV file

See original GitHub issue

A clear and concise description of what the bug is.

Expected results

CSV file uploaded into database

Actual results

Got error when uploading CSV file

Screenshots

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/security/decorators.py", line 109, in wraps
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/views.py", line 94, in this_form_post
    response = self.form_post(form)
  File "/app/superset/views/database/views.py", line 141, in form_post
    delete=False,
  File "/usr/local/lib/python3.6/tempfile.py", line 551, in NamedTemporaryFile
    (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "/usr/local/lib/python3.6/tempfile.py", line 262, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: '/app/superset/app/static/uploads/tmpgzxvi893.csv'

How to reproduce the bug

  1. Enable CSV upload
  2. Upload CSV file

Environment

(please complete the following information):

  • First installation using Docker
  • superset version: master
  • python version: based on master branch
  • node.js version: based on master branch
  • npm version: based on master branch

Checklist

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven’t found one similar.

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rayzor65commented, Nov 4, 2020

I managed to get past this issue by creating a new folder in my dockerfile (RUN mkdir /csvs) then updating superset_config.py

# superset_config.py
UPLOAD_FOLDER = "/csvs/"
1reaction
reenarosidcommented, Jul 20, 2020

Cause: Insufficient privilege, which doesn’t allow a file creation in the Docker container environment.

Fix: giving it a root privilege

Please add user: root:root in your docker-compose.yml to fix the issue.

superset: env_file: docker/.env build: *superset-build container_name: superset_app command: [“flask”, “run”, “-p”, “8088”, “–with-threads”, “–reload”, “–debugger”, “–host=0.0.0.0”] restart: unless-stopped ports: - 8088:8088 user: root:root # add this change
depends_on: *superset-depends-on volumes: *superset-volumes

Read more comments on GitHub >

github_iconTop Results From Across the Web

6 Common CSV Import Errors and How to Fix Them - Flatfile
One of the most common CSV import errors is that the file is simply too large. That can be caused by too many...
Read more >
Why am I getting an error message when uploading my CSV ...
Each import into Nimble must contain either a company name and/or contact name. Email addresses cannot be imported alone. · The file has...
Read more >
Articles How do I resolve the errors "Invalid CSV file" or "the ...
Verify that the CSV file is formatted the same way as our sample CSV file. · Eliminate any typos, namely incorrectly spelled column...
Read more >
Dealing with the common problems with CSV files - CSV Loader
This means that the header line in your file is either missing or improperly formatted. The latter is the more common. Things like...
Read more >
Format of the CSV file isn't correct error - Office 365
To resolve this issue, follow these steps: ... On the Edit menu, select Replace. In the Find what box, type ", leave the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found