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

Running wee_reports takes forever when there is not enough weather data #47

Closed
Supergamerx3000 opened this issue Aug 7, 2022 · 15 comments
Labels
bug Something isn't working support
Milestone

Comments

@Supergamerx3000
Copy link

Hello, everyone,

when I want to install the weewx-wdc skin I get the following error message:


root@weewx:/home/pi# wee_extension --install= /home/pi/weewx-wdc-v2.0.1.zip
Traceback (most recent call last):
  File "/usr/share/weewx/wee_extension", line 92, in <module>
    main()
  File "/usr/share/weewx/wee_extension", line 65, in main
    config_path, config_dict = weecfg.read_config(options.config, _args)
  File "/usr/share/weewx/weecfg/__init__.py", line 143, in read_config
    config_dict = configobj.ConfigObj(config_path,
  File "/usr/lib/python3/dist-packages/configobj.py", line 1229, in __init__
    self._load(infile, configspec)
  File "/usr/lib/python3/dist-packages/configobj.py", line 1287, in _load
    content = self._handle_bom(content)
  File "/usr/lib/python3/dist-packages/configobj.py", line 1437, in _handle_bom
    return self._decode(infile, self.encoding)
  File "/usr/lib/python3/dist-packages/configobj.py", line 1517, in _decode
    infile[i] = line.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb8 in position 11: invalid start byte

I tried the zip from the installation guide and the zip from the release tab.

Any idea why this isn't working?

Kind regards
Pascal

@Supergamerx3000 Supergamerx3000 changed the title Error Install Skin Weewx 4.8.0 invalid start byte Error Install Skin on Weewx 4.8.0 invalid start byte Aug 7, 2022
@Daveiano Daveiano added documentation Improvements or additions to documentation support labels Aug 7, 2022
@Daveiano
Copy link
Owner

Daveiano commented Aug 7, 2022

@Supergamerx3000 Did you unzip the release.zip and point wee_extensioon to that folder? From your command, it looks like you are trying to directly install from .zip? This is not supported yet.

I have updated the Installation section of the readme with some commands for better understanding, please have a look at https://github.com/Daveiano/weewx-wdc#installation

@Supergamerx3000
Copy link
Author

@Daveiano Thanks for the quick help, the new installation guide is really better.

I installed the skin and activated it in weewx.conf but unfortunately the website looks like this:

grafik

I open my weewx via http://SERVER_IP/weewx.index.html

I read in the google forum that this could be a problem how can I fix the error?

@Daveiano
Copy link
Owner

Daveiano commented Aug 7, 2022

@Supergamerx3000 I assume you mean http://SERVER_IP/weewx/index.html instead of http://SERVER_IP/weewx.index.html (dot vs slash)?

If that's the case, this issue should be resolved in version 2.0.1. Are you sure, you installed the latest version?

@Supergamerx3000
Copy link
Author

Supergamerx3000 commented Aug 7, 2022

@Daveiano Of course that was a typo 😀

Yes, I ran the exact commands from the new installation guide and i run version 2.0.1

How can I fix the problem manually?

@Daveiano
Copy link
Owner

Daveiano commented Aug 7, 2022

Ok, that's strange, it should work.

Perhaps you could help me find the bug? It would be great if you could right-click on the page and select "View page source". Then, save this (STRG+S) and attach the file to the issue. I could investigate this.

@Supergamerx3000
Copy link
Author

I'm very happy to help you.
Here is the file from the website
index.zip

in the zip file is an html file (firefox saved it) that only works correctly with firefox or chrome, with notepad++ it is displayed somewhat strangely.

@Daveiano
Copy link
Owner

Daveiano commented Aug 7, 2022

@Supergamerx3000 This looks good and should work. The cause for the empty page in the screenshot you send would be that the stylesheet could not be loaded. The path from your index.html to the stylesheet is http://192.168.107.12/weewx/dist/main.css. Can you verify that this file is present in your web directory at weewx/dist/main.css?

Did you try to remove all content from the web directory and run wee_reports again (or wait for the next report run)?

@Supergamerx3000
Copy link
Author

@Daveiano
i have complete delete the weewx folder from /var/www/html/ and wait for the next report run.
the new folder does not contain a dist folder with the main.css file. (the old one also not)

I have try to make a manuel sync by wee_reports.

root@weewx:~# wee_reports
Using configuration file /etc/weewx/weewx.conf
Generating for all time
^CTraceback (most recent call last):
  File "/usr/share/weewx/wee_reports", line 102, in <module>
    main()
  File "/usr/share/weewx/wee_reports", line 96, in main
    t.run()
  File "/usr/share/weewx/weewx/reportengine.py", line 197, in run
    obj.start()
  File "/usr/share/weewx/weewx/reportengine.py", line 385, in start
    self.run()
  File "/usr/share/weewx/weewx/cheetahgenerator.py", line 169, in run
    ngen = self.generate(gen_dict[section_name], section_name, self.gen_ts)
  File "/usr/share/weewx/weewx/cheetahgenerator.py", line 229, in generate
    ngen += self.generate(section[subsection], subsection, gen_ts)
  File "/usr/share/weewx/weewx/cheetahgenerator.py", line 229, in generate
    ngen += self.generate(section[subsection], subsection, gen_ts)
  File "/usr/share/weewx/weewx/cheetahgenerator.py", line 348, in generate
    unicode_string = compiled_template.respond()
  File "_etc_weewx_skins_weewx_wdc_statistics_html_tmpl.py", line 200, in respond
  File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
    self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
  File "_etc_weewx_skins_weewx_wdc_includes_body_alternative_inc.py", line 310, in respond
  File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
    self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
  File "_etc_weewx_skins_weewx_wdc_includes_combined_diagram_tile_inc.py", line 288, in respond
  File "_etc_weewx_skins_weewx_wdc_includes_combined_diagram_tile_inc.py", line 106, in __errorCatcher6
  File "<string>", line 1, in <module>
  File "/usr/share/weewx/weewx/tags.py", line 395, in series
    start_vt, stop_vt, data_vt = weewx.xtypes.get_series(
  File "/usr/share/weewx/weewx/xtypes.py", line 100, in get_series
    return xtype.get_series(obs_type, timespan, db_manager, aggregate_type,
  File "/usr/share/weewx/weewx/xtypes.py", line 167, in get_series
    agg_vt = get_aggregate(obs_type, stamp, do_aggregate, db_manager)
  File "/usr/share/weewx/weewx/xtypes.py", line 127, in get_aggregate
    return xtype.get_aggregate(obs_type, timespan, aggregate_type, db_manager,
  File "/usr/share/weewx/weewx/xtypes.py", line 939, in get_aggregate
    @staticmethod


in the new weewx folder are only seven files

root@weewx:/var/www/html/weewx# ls
index.html  month-2022-08.html  month.html  NOAA  week.html  year-2022.html  year.html
root@weewx:/var/www/html/weewx#

Maybe the files wasn't correctly generated?

@Daveiano
Copy link
Owner

Daveiano commented Aug 7, 2022

@Supergamerx3000 Something is wrong, but I don't know what.

Did you cancel the wee_reports call by hitting Ctrl+C?

root@weewx:~# wee_reports
Using configuration file /etc/weewx/weewx.conf
Generating for all time
^CTraceback (most recent call last):

There is a ^C before the error thrown by wee_reports!? Anyway, could you paste the whole output of the log from one report run, so I could have a look at the errors?

Another thing to check: please go to the folder where the skin is installed (Skins and templates directory, usually /etc/weewx/skins/ or /home/weewx/skins/). Is there a folder dist with the file main.css?

@Supergamerx3000
Copy link
Author

@Daveiano
Yes, I canceled the command because it ran for 3 minutes without any feedback. I let it run again and wait longer this time.

I checked the /etc/weewx/skins/ folder and there is no dist folder.

this can only be found in the skin folder weewx-wdc there is also a main.css and main.js

@Supergamerx3000
Copy link
Author

Supergamerx3000 commented Aug 8, 2022

@Daveiano
I've run wee_reports for over 5 minutes now, there's no output except:

Using configuration file /etc/weewx/weewx.conf
Generating for all time

When I press cancel this comes up:

root@weewx://var/www/html# wee_reports
Using configuration file /etc/weewx/weewx.conf
Generating for all time

^CTraceback (most recent call last):
  File "/usr/share/weewx/wee_reports", line 102, in <module>
    Main()
  File "/usr/share/weewx/wee_reports", line 96, in main
    t.run()
  File "/usr/share/weewx/weewx/reportengine.py", line 197, in run
    obj.start()
  File "/usr/share/weewx/weewx/reportengine.py", line 385, in start
    self.run()
  File "/usr/share/weewx/weewx/cheetahgenerator.py", line 169, in run
    ngen = self.generate(gen_dict[section_name], section_name, self.gen_ts)
  File "/usr/share/weewx/weewx/cheetahgenerator.py", line 229, in generate
    ngen += self.generate(section[subsection], subsection, gen_ts)
  File "/usr/share/weewx/weewx/cheetahgenerator.py", line 229, in generate
    ngen += self.generate(section[subsection], subsection, gen_ts)
  File "/usr/share/weewx/weewx/cheetahgenerator.py", line 348, in generate
    unicode_string = compiled_template.respond()
  File "_etc_weewx_skins_weewx_wdc_statistics_html_tmpl.py", line 200, in respond
  File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
    self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
  File "_etc_weewx_skins_weewx_wdc_includes_body_alternative_inc.py", line 310, in respond
  File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
    self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
  File "_etc_weewx_skins_weewx_wdc_includes_combined_diagram_tile_inc.py", line 288, in respond
  File "_etc_weewx_skins_weewx_wdc_includes_combined_diagram_tile_inc.py", line 106, in __errorCatcher6
  File "<string>", line 1, in <module>
  File "/usr/share/weewx/weewx/tags.py", line 395, in series
    start_vt, stop_vt, data_vt = weewx.xtypes.get_series(
  File "/usr/share/weewx/weewx/xtypes.py", line 100, in get_series
    return xtype.get_series(obs_type, timespan, db_manager, aggregate_type,
  File "/usr/share/weewx/weewx/xtypes.py", line 165, in get_series
    for stamp in weeutil.weeutil.intervalgen(startstamp, stopstamp, aggregate_interval):
  File "/usr/share/weewx/weeutil/weeutil.py", line 370, at intervals
    stamp1 = int(time.mktime(dt1.timetuple()))
keyboard interrupt

@Daveiano
Copy link
Owner

Daveiano commented Aug 8, 2022

@Supergamerx3000

I checked the /etc/weewx/skins/ folder and there is no dist folder.

this can only be found in the skin folder weewx-wdc there is also a main.css and main.js

This is correct, sorry for my confusing writing. The dist folder is located in the weewx-wdc skin folder and includes the main.css and main.js files. Since these files are present in the skin folder, they should be copied on a report run into the HTML folder along with the other generated files.

Yes, I canceled the command because it ran for 3 minutes without any feedback

Please don't do this. When cancelling the process, it's almost guaranteed that there are files missing.

I've run wee_reports for over 5 minutes now, there's no output except:

Using configuration file /etc/weewx/weewx.conf
Generating for all time

That's correct, when running, there is no log printed to the console. To get the actual log please have a look at the weewx wiki.

Does running the command and waiting for it to finish, solve the problem? Are all files present in the HTML directory and does the skin render as expected?

While writing this, I remembered another user, who had the identical issues as you. He was executing all commands as root user, like you. He solved this by reinstalling the skin as root and also with the sudo command:

sudo wee_extension --uninstall=wdc
sudo wee_extension --install=path/to/wdc-folder
sudo wee_report

Could you give this a try?

@Supergamerx3000
Copy link
Author

Supergamerx3000 commented Aug 8, 2022

@Daveiano
unfortunately not either I let wee_report run for 1 hour now, even while doing so, the page keeps reloading from time to time it remains broken if you feel like it, I can open a tmate session, then you can connect to my console and take a look directly. Of course, if you want, also for a fee.

I have send you the tmate link via paypal donation
Simply connect to the ssh session you will come directly to my console

The reinstall also make no changes

we can also talk on discord or matrix etc,

@Supergamerx3000 Supergamerx3000 changed the title Error Install Skin on Weewx 4.8.0 invalid start byte Installing the skin is only possible as soon as there is enough weather data Aug 8, 2022
@Supergamerx3000 Supergamerx3000 changed the title Installing the skin is only possible as soon as there is enough weather data Installing the skin is only possible when there is enough weather data Aug 8, 2022
@Daveiano Daveiano changed the title Installing the skin is only possible when there is enough weather data Running wee_reports takes forever when there is not enough weather data Aug 8, 2022
@Daveiano Daveiano added this to the 2.1.0 milestone Aug 8, 2022
@Daveiano Daveiano added bug Something isn't working and removed documentation Improvements or additions to documentation labels Aug 8, 2022
Daveiano added a commit that referenced this issue Aug 9, 2022
@Daveiano
Copy link
Owner

Daveiano commented Aug 9, 2022

@Supergamerx3000 I released v2.1.0 which should resolve this issue!

@Daveiano Daveiano closed this as completed Aug 9, 2022
@Supergamerx3000
Copy link
Author

Thank You now the statistics page works perfect 👍

@Daveiano Daveiano pinned this issue Aug 9, 2022
@Daveiano Daveiano unpinned this issue Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working support
Projects
None yet
Development

No branches or pull requests

2 participants