kevinpapst / ImportBundle

A Kimai plugin to import data from the Web UI
https://www.kimai.org/store/keleo-importer-bundle.html
Other
4 stars 1 forks source link

Import of CSV files not working #6

Closed SaturnusDJ closed 4 months ago

SaturnusDJ commented 1 year ago

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 commented 1 year ago

Works for me. Provide more infos

SaturnusDJ commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 9 months ago

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

SaturnusDJ commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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

kevinpapst commented 8 months ago

Here is another case: https://github.com/kevinpapst/ImportBundle/issues/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 commented 8 months ago

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 commented 4 months ago

Haven't heard anything since then, so closing.