Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import of CSV files not working #6

Closed
SaturnusDJ opened this issue Mar 9, 2023 · 15 comments
Closed

Import of CSV files not working #6

SaturnusDJ opened this issue Mar 9, 2023 · 15 comments

Comments

@SaturnusDJ
Copy link

Kimai 2.0.0
CSV Importer 2.0.1

Download the CSV example files from the importer page. Try to upload them. It does not work:
Unsupported file given

JSON does work.

@kevinpapst
Copy link
Owner

Works for me. Provide more infos

@SaturnusDJ
Copy link
Author

SaturnusDJ commented Mar 9, 2023

It did work in MS Edge now. So suspicion goes to Firefox. It did not work on two quite different Windows 10 computers.
Firefox version is 110.1.
Tried in private window: does not work.
Tried without uBlock Origin: does not work.
Tried on Ubuntu: works.

Out of ideas now hmm.

@kevinpapst
Copy link
Owner

Super weird. I tried with Firefox, Brave, Safari and Chrome and all worked => all on Mac.

I can't fix something that I cannot see.
Let's keep the issue open, maybe someone finds this issue and wants to help support with debugging and fixing.

@SaturnusDJ
Copy link
Author

Not sure if useful but I made this performance dump for you: https://share.firefox.dev/3T38R46
Despite the dump saying Firefox 109, the local browser says 110.0.1. This is back on the initial computer, where I now verified that Google Chrome also works correctly.

This problem with Firefox also occurs on the demo setup at https://demo-empty.kimai.org

@kevinpapst
Copy link
Owner

Maybe you have a over-active security/privacy plugin active?
Did you try with all deactivated plugins?
Bildschirm­foto 2023-03-10 um 11 00 37

@SaturnusDJ
Copy link
Author

SaturnusDJ commented Mar 10, 2023

Same in Troubleshoot Mode (= all plugins, extensions, etc. disabled).
The two setups, both for testing before production, do not have certificates installed and thus do not run via HTTPS. Could that be something? No, because also the issue in demo, which has HTTPS.

@kevinpapst
Copy link
Owner

I added some debug logs in the latest version. You could try that and report back.

@SaturnusDJ
Copy link
Author

SaturnusDJ commented Dec 4, 2023

After initial setup, we do not use the ImportBundle.

I made a test setup. After installing the plugin, to not get server error 500 I had to rm -rf /opt/kimai/var/cache/*

Performed as in topic start. This is the error given: Unsupported file given, invalid mimetype (text/plain). Try to use another browser.

@kevinpapst
Copy link
Owner

Thanks for the feedback.
If another browser and/or device does not help, your system might lack a proper libmimetype.
Not sure how that should happen. The file cannot be detected as CSV.
Did you change the filename to timesheet.csv.txt ? I know Windows does (or at least did in the past) the weirdest things to filenames.

@SaturnusDJ
Copy link
Author

This happens in a somewhat restricted work environment and on an unrestricted self-built high-end pc at home. Both use Firefox though. Something is going on with Firefox. I downloaded the example file and immediately uploaded it again.

@kevinpapst
Copy link
Owner

There is something fishy. I cannot explain what.
The code is trying to verify if that is a CSV or JSON file by detecting its mimetype.
I will not open and throw arbitrary files at the import logic, only becuase it is called .csv.

I understand it is frustrating, but it is working for everyone else 🤷
Even here with Firefox (on Mac) and server on multiple Linux and Mac machines.

@SaturnusDJ
Copy link
Author

Yeah it is strange, but it is okay. After initial setup (months ago now), we do not need Importer. 👌🏼

@kevinpapst
Copy link
Owner

Here is another case: #6

Unfortunately, you cannot carry out CSV imports via Firefox.
I see the following error on the Kimai Import Page: Unsupported file given, invalid mimetype (text/plain / application/vnd.ms-excel). Try to use another browser.
With edge it is working.

kimai_import

@kevinpapst
Copy link
Owner

kevinpapst commented Jan 14, 2024

It is working in Brave, Chrome, Safari. Edge.
It is not working in Firefox on Windows (but Firefox on Mac works).
Not sure if I want to add a workaround for a broken browser in one OS.

@kevinpapst
Copy link
Owner

Haven't heard anything since then, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants