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

Importing non-German CSV fails #39

Open
DanStasiak opened this issue May 22, 2023 · 2 comments
Open

Importing non-German CSV fails #39

DanStasiak opened this issue May 22, 2023 · 2 comments
Assignees

Comments

@DanStasiak
Copy link

DanStasiak commented May 22, 2023

after I follow all instructions and run the command "docker run -it --rm --env-file .env --mount type=bind,source="$PWD/csv",target=/data,readonly --network=solectrus_default ghcr.io/solectrus/senec-importer"
the command ends with a error:

_SENEC CSV importer for SOLECTRUS, Version 0.2.2, built at 2023-05-04T10:30:25.466Z
https://github.com/solectrus/senec-importer
Copyright (c) 2020-2023 Georg Ledermann, released under the MIT License

Using Ruby 3.2.2 on platform aarch64-linux-musl
Pushing to InfluxDB at http://influxdb:8086, bucket my-solectrus-bucket

Importing data from /data ...
Importing /data/S27525591196576782540161857-week-1-2023.csv... bundler: failed to load command: src/main.rb (src/main.rb)
/usr/local/lib/ruby/3.2.0/time.rb:196:in `make_time': no time information in " CET" (ArgumentError)

    raise ArgumentError, "no time information in #{date.inspect}"
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    from /usr/local/lib/ruby/3.2.0/time.rb:383:in `parse'
    from /senec-importer/src/solectrus_record.rb:109:in `parse_time'
    from /senec-importer/src/solectrus_record.rb:17:in `time'
    from /senec-importer/src/solectrus_record.rb:11:in `to_h'
    from /senec-importer/src/import.rb:39:in `block in process'
    from /usr/local/lib/ruby/3.2.0/csv/table.rb:938:in `each'
    from /usr/local/lib/ruby/3.2.0/csv/table.rb:938:in `each'
    from /senec-importer/src/import.rb:36:in `map'
    from /senec-importer/src/import.rb:36:in `process'
    from /senec-importer/src/import.rb:14:in `block in run'
    from /senec-importer/src/import.rb:13:in `each'
    from /senec-importer/src/import.rb:13:in `run'
    from src/main.rb:23:in `<top (required)>'
    from /usr/local/bundle/gems/bundler-2.4.12/lib/bundler/cli/exec.rb:58:in `load'
    from /usr/local/bundle/gems/bundler-2.4.12/lib/bundler/cli/exec.rb:58:in `kernel_load'
    from /usr/local/bundle/gems/bundler-2.4.12/lib/bundler/cli/exec.rb:23:in `run'
    from /usr/local/bundle/gems/bundler-2.4.12/lib/bundler/cli.rb:492:in `exec'
    from /usr/local/bundle/gems/bundler-2.4.12/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /usr/local/bundle/gems/bundler-2.4.12/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /usr/local/bundle/gems/bundler-2.4.12/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /usr/local/bundle/gems/bundler-2.4.12/lib/bundler/cli.rb:34:in `dispatch'
    from /usr/local/bundle/gems/bundler-2.4.12/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /usr/local/bundle/gems/bundler-2.4.12/lib/bundler/cli.rb:28:in `start'
    from /usr/local/bundle/gems/bundler-2.4.12/exe/bundle:45:in `block in <top (required)>'
    from /usr/local/bundle/gems/bundler-2.4.12/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
    from /usr/local/bundle/gems/bundler-2.4.12/exe/bundle:33:in `<top (required)>'
    from /usr/local/bundle/bin/bundle:25:in `load'
    from /usr/local/bundle/bin/bundle:25:in `<main>'_

Here is my csv file.

S27525591196576782540161857-week-1-2023.csv

@DanStasiak DanStasiak changed the title Error during inport of csv file Error during import of csv file May 22, 2023
@ledermann
Copy link
Member

Thank you for this precise report. Looking at your CSV file, I see that the column headings are in English, while the importer expects German headings. This causes the import to fail.

Upon further investigation, I have found that the selected language of the user profile in mein-senec.de determines the column headings. Currently, the available languages are English, German, and Italian.

So, the quick fix for your problem is to change the language to German, then download all the CSV files again and restart the importer.

The long-term solution to this issue must be a change of the importer to handle all three languages. I will tackle this in the near future.

@ledermann ledermann changed the title Error during import of csv file Importing non-German CSV fails May 23, 2023
@ledermann ledermann self-assigned this May 23, 2023
@DanStasiak
Copy link
Author

Thank you very much for the quick and concise response. I've changed the language to German and the import (124 csv files :-) ) worked perfectly. 🥇

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