Updated linux and weewx, nwo won't run. Help, please.

239 views
Skip to first unread message

loonsailor

unread,
Oct 14, 2024, 7:06:24 PM10/14/24
to weewx-user
I've been running weewx 4.8.0 under unbuntu linux 20.04 (I think).  I upgraded today to ubunbtu 24.04.1 LTS, and the process also moved me to weewx 5.0.1.  Now it won't run.  First question is, why does "sudo apt update; sudo apt install weewx" not get me to 5.1?  But the much more important question is, why won't it run at all?  Here is the syslog.  Note that the socket that it's trying to open is to the WifiLogger2 board in my Vantage Pro 2.  Any ideas?

Oct 14 14:32:29 ubu-mini-weather systemd[1]: Stopped Discard unused blocks once a week.
Oct 14 14:33:18 ubu-mini-weather systemd[1]: Started Discard unused blocks once a week.
Oct 14 14:33:19 ubu-mini-weather weewxd[833]: INFO __main__: Initializing weewxd version 5.0.1
Oct 14 14:33:19 ubu-mini-weather weewxd[833]: INFO __main__: Command line: /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: INFO __main__: Using Python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0]
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: INFO __main__: Located at /usr/bin/python3
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: INFO __main__: Platform Linux-5.15.0-122-generic-x86_64-with-glibc2.35
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: INFO __main__: Locale: 'en_US.UTF-8'
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: INFO __main__: Entry path: /usr/share/weewx/weewxd.py
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: INFO __main__: WEEWX_ROOT: /etc/weewx
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: INFO __main__: Configuration file: /etc/weewx/weewx.conf
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: INFO __main__: User module: /etc/weewx/bin/user
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: INFO __main__: Debug: 0
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: INFO weewx.engine: Loading station type Vantage (weewx.drivers.vantage)
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: ERROR weewx.drivers.vantage: Socket error while opening port 22222 to ethernet host 192.168.198.91.
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: ERROR weewx.engine: Import of driver failed: [Errno 101] Network is unreachable (<class 'weewx.WeeWxIOError'>)
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****  Traceback (most recent call last):
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 354, in openPort
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****      self.socket.connect((self.host, self.port))
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****  OSError: [Errno 101] Network is unreachable
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****  
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****  During handling of the above exception, another exception occurred:
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****  
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****  Traceback (most recent call last):
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/engine.py", line 115, in setupStation
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****      self.console = loader_function(config_dict, self)
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 32, in loader
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****      return VantageService(engine, config_dict)
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 2046, in __init__
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****      Vantage.__init__(self, **config_dict[DRIVER_NAME])
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 536, in __init__
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****      self.port.openPort()
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 359, in openPort
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****      raise weewx.WeeWxIOError(ex)
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL weewx.engine:     ****  weewx.WeeWxIOError: [Errno 101] Network is unreachable
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL __main__: Unable to load driver: [Errno 101] Network is unreachable
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL __main__:     ****  Exiting...
Oct 14 14:33:20 ubu-mini-weather systemd[1]: weewx.service: Main process exited, code=exited, status=4/NOPERMISSION
Oct 14 14:33:20 ubu-mini-weather systemd[1]: weewx.service: Failed with result 'exit-code'.

Tom Keffer

unread,
Oct 14, 2024, 7:13:46 PM10/14/24
to weewx...@googlegroups.com
(In passing, it's a good idea to set debug=1 when you're trying to obtain a log.)

I would guess that the upgrade of Ubuntu somehow changed a firewall or iptables setting, or something similar, rendering the address 192.168.198.91 unreachable from whatever computer WeeWX is running on. To double check this, you could try using telnet to see if you at least have connectivity.

Without connectivity, WeeWX won't get far.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/fb743fe8-0af4-41ee-ba4a-869e1c1abc8bn%40googlegroups.com.
Message has been deleted
Message has been deleted
Message has been deleted

loonsailor

unread,
Oct 14, 2024, 7:44:41 PM10/14/24
to weewx-user
I've confirmed that the computer can reach the station by doing so from the browser.  WifiLogger has an html interface, and I can see it and interact with it from the same computer that's running weewx.

Tom Keffer

unread,
Oct 14, 2024, 7:58:52 PM10/14/24
to weewx...@googlegroups.com
Being able to browse to the logger doesn't really prove much. Port 80 is a very common port to leave open. Port 22222, not so common.

Try telnet to port 22222 as the same user that's running weewxd. I don't know what user that is (debug=1 would tell you), but if you upgraded to v5.0.1, it's likely to be user 'weewx'.

Which makes me realize we didn't address your other problem: not upgrading to v5.1.0. I have not seen that before. Can you try apt update and upgrade again?

-tk


On Mon, Oct 14, 2024 at 4:44 PM 'loonsailor' via weewx-user <weewx...@googlegroups.com> wrote:
I've confirmed that the computer can reach the station by doing so from the browser.  WifiLogger has an html interface, and I can see it and interact with it from the same computer that's running weewx.

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

vince

unread,
Oct 14, 2024, 9:38:35 PM10/14/24
to weewx-user

To check which user weewx is running as, try  "ps aux | grep weewx | grep -v grep" and look at the output. It should say something like:
weewx 4977 7.8 0.7 117336 30056 ? Ssl 18:28 0:00 python3 /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf

Your numbers in the middle of your output will vary but the first column should say 'weewx' and the command starting with 'python3' above should look the same in your output.

These lines got me wondering...
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL __main__: Unable to load driver: [Errno 101] Network is unreachable
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL __main__:     ****  Exiting...
Oct 14 14:33:20 ubu-mini-weather systemd[1]: weewx.service: Main process exited, code=exited, status=4/NOPERMISSION  <======

Agree with Tom about trying to telnet to 22222 as a first test but please do so as an unprivileged user, not as root.   I did a quick test here on a ubuntu 24.04.1LTS system and I 'could' access an unprivileged port from a dpkg installation of weewx 5.1.0 just fine.  In my test I accessed a similar unprivileged port 45000 which is the ecowitt gateway port, and the weewx user was not in any special groups or anything. FWIW - you might try adding user 'weewx' to group 'netdev' just in case, but that shouldn't be necessary.  Try Tom's telnet test first.
Message has been deleted
Message has been deleted

loonsailor

unread,
Oct 14, 2024, 11:00:03 PM10/14/24
to weewx-user
'm now on Linux 24.04.1 LTS, which is, I think, jammy.  Should I have a different repository list?

Re the port problem, I've changed the wifilogger port to 2222 (instead of 22222), and set debug to 1 and port 2222 in weewx.conf.  Still no joy.  Here's the log with debug.

2024-10-14T18:25:40.108787-07:00 ubu-mini-weather weewxd[941]: INFO __main__: Initializing weewxd version 5.0.1
2024-10-14T18:25:40.110003-07:00 ubu-mini-weather weewxd[941]: INFO __main__: Command line: /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
2024-10-14T18:25:40.121078-07:00 ubu-mini-weather weewxd[941]: INFO __main__: Using Python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0]
2024-10-14T18:25:40.121308-07:00 ubu-mini-weather weewxd[941]: INFO __main__: Located at /usr/bin/python3
2024-10-14T18:25:40.122800-07:00 ubu-mini-weather weewxd[941]: INFO __main__: Platform Linux-5.15.0-122-generic-x86_64-with-glibc2.39
2024-10-14T18:25:40.123611-07:00 ubu-mini-weather weewxd[941]: INFO __main__: Locale: 'en_US.UTF-8'
2024-10-14T18:25:40.124478-07:00 ubu-mini-weather weewxd[941]: INFO __main__: Entry path: /usr/share/weewx/weewxd.py
2024-10-14T18:25:40.125329-07:00 ubu-mini-weather weewxd[941]: INFO __main__: WEEWX_ROOT: /etc/weewx
2024-10-14T18:25:40.126199-07:00 ubu-mini-weather weewxd[941]: INFO __main__: Configuration file: /etc/weewx/weewx.conf
2024-10-14T18:25:40.127036-07:00 ubu-mini-weather weewxd[941]: INFO __main__: User module: /etc/weewx/bin/user
2024-10-14T18:25:40.127989-07:00 ubu-mini-weather weewxd[941]: INFO __main__: Debug: 1
2024-10-14T18:25:40.128951-07:00 ubu-mini-weather weewxd[941]: DEBUG __main__: Initializing engine
2024-10-14T18:25:40.136337-07:00 ubu-mini-weather weewxd[941]: INFO weewx.engine: Loading station type Vantage (weewx.drivers.vantage)
2024-10-14T18:25:40.291519-07:00 ubu-mini-weather weewxd[941]: DEBUG weewx.drivers.vantage: Driver version is 3.6.2
2024-10-14T18:25:40.300207-07:00 ubu-mini-weather weewxd[941]: DEBUG weewx.drivers.vantage: Option loop_request=2
2024-10-14T18:25:40.301295-07:00 ubu-mini-weather weewxd[941]: ERROR weewx.drivers.vantage: Socket error while opening port 2222 to ethernet host 192.168.198.91.
2024-10-14T18:25:40.302074-07:00 ubu-mini-weather weewxd[941]: ERROR weewx.engine: Import of driver failed: [Errno 101] Network is unreachable (<class 'weewx.WeeWxIOError'>)
2024-10-14T18:25:40.309610-07:00 ubu-mini-weather weewxd[941]: CRITICAL weewx.engine:     ****  Traceback (most recent call last):
2024-10-14T18:25:40.310587-07:00 ubu-mini-weather weewxd[941]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 354, in openPort
2024-10-14T18:25:40.311404-07:00 ubu-mini-weather weewxd[941]: CRITICAL weewx.engine:     ****      self.socket.connect((self.host, self.port))
2024-10-14T18:25:40.312183-07:00 ubu-mini-weather weewxd[941]: CRITICAL weewx.engine:     ****  OSError: [Errno 101] Network is unreachable
2024-10-14T18:25:40.312794-07:00 ubu-mini-weather weewxd[941]: CRITICAL weewx.engine:     ****  
2024-10-14T18:25:40.313291-07:00 ubu-mini-weather weewxd[941]: CRITICAL weewx.engine:     ****  During handling of the above exception, another exception occurred:
2024-10-14T18:25:40.313738-07:00 ubu-mini-weather weewxd[941]: CRITICAL weewx.engine:     ****  
2024-10-14T18:25:40.314173-07:00 ubu-mini-weather weewxd[941]: CRITICAL weewx.engine:     ****  Traceback (most recent call last):
2024-10-14T18:25:40.314724-07:00 ubu-mini-weather weewxd[941]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/engine.py", line 115, in setupStation
2024-10-14T18:25:40.316118-07:00 ubu-mini-weather weewxd[941]: CRITICAL weewx.engine:     ****      self.console = loader_function(config_dict, self)

I tried to telnet to the new port, and get the following:
$ telnet 192.168.198.91 2222
Trying 192.168.198.91...
telnet: Unable to connect to remote host: Connection refused

I tried the following, which worked, much to my surprise:

$ telnet 192.168.198.91 22222
Trying 192.168.198.91...
Connected to 192.168.198.91.
Escape character is '^]'.

This worked even though I'd changed wifilogger's TCP port to 2222 (instead of 22222).   22222 is it's default, so maybe it always stays open?  Or maybe telnet uses a UDP port instead of TCP?

And if this works, why didn't weewx work before I changed the config file?

This worked fine before updating OS and weewx, so I'm mystified.



vince

unread,
Oct 14, 2024, 11:59:57 PM10/14/24
to weewx-user
Which user did you use when telnetting to 2222 ?

Did you run that ps command I asked you to run ?

loonsailor

unread,
Oct 15, 2024, 12:33:57 AM10/15/24
to weewx-user
I tried telnet both as myself (non-priveleged) and as weewx.  Both worked:

$ telnet 192.168.198.91 22222
Trying 192.168.198.91...
Connected to 192.168.198.91.
Escape character is '^]'.
^]
telnet>
Connection closed.
$ telnet -l weewx 192.168.198.91 22222

Trying 192.168.198.91...
Connected to 192.168.198.91.
Escape character is '^]'.
^]
telnet>
Connection closed.

Re the versioning issue, I still can't get to 5.1.  "sudo apt update; sudo apt upgrade; sudo apt install weewx" just leaves me at 5.0.1.  Seems to be a repository issue.  /etc/apt/sources.list.d/weewx.list was empty except for a commented out line:

# deb [arch=all] http://weewx.com/apt/python3 buster main # disabled on upgrade to jammy

jammy is 22.04, and I'm on 24.04.1 LTS.  I ran the command shown in the manual, and now that file contains:

deb [arch=all] https://weewx.com/apt/python3 buster main

But, I still stay on 5.0.1.  Seems to be a repository issue?

The ps command returns squat, because weewx aborts when the driver fails, so there's no weewx stuff running.

BTW, I'm still running the same weewx.conf that I was under 4.8.  Do I need to change it out?

loonsailor

unread,
Oct 15, 2024, 8:01:46 AM10/15/24
to weewx-user
I've confirmed that the computer can reach the station by doing so from the browser.  WifiLogger has an html interface, and I can see it and interact with it from the same computer that's running weewx.

It's been some years since I moved to weewx and configured this, and I don't remember why socket 22222 is used.  Does anybody know, or is that something that I chose arbitrarily?  I used to access a vantage through a ethernet-serial converter, and maybe it was the socket used in that?

loonsailor

unread,
Oct 15, 2024, 8:01:47 AM10/15/24
to weewx-user
re the version of weewx, I did "sudo apt update; sudo apt upgrade; sudo apt install weewx" and I get the response that 5.0.1 is the current version.  I looked in /etc/apt/sources.d, and the file weewx.list contains only one commented out line:

# deb [arch=all] http://weewx.com/apt/python3 buster main # disabled on upgrade to jammy

I'm now on Linux 24.04.1 LTS, which is, I think, jammy.  Should I have a different repository list?
$ telnet 192.168.198.91:2222
Server lookup failure:  192.168.198.91:2222:telnet, Name or service not known

I think that is a message from the logger, but I'm not certain.

BTW, I'm using my old conf file, which still says it's version 4.8.  Doesn't seem like that should be thr problem, but...

loonsailor

unread,
Oct 15, 2024, 8:01:47 AM10/15/24
to weewx-user
$ telnet 192.168.198.91 2222

Trying 192.168.198.91...
telnet: Unable to connect to remote host: Connection refused

This worked fine before updating OS and weewx, so I'm mystified.

BTW, I'm using my old conf file, which still says it's version 4.8.  Doesn't seem like that should be thr problem, but...
On Monday, October 14, 2024 at 4:58:52 PM UTC-7 Tom Keffer wrote:

loonsailor

unread,
Oct 15, 2024, 8:01:47 AM10/15/24
to weewx-user
I've confirmed that the computer can reach the station, at least from a browser.  Entering the IP address into the browser's address bar does get me to the station.  I can tell because the wifilogger has a simple html interface that I can see and interact with just fine.

loonsailor

unread,
Oct 15, 2024, 8:01:47 AM10/15/24
to weewx-user
I've confirmed that the computer can reach the station by opening it from a browser.  The Wifilogger has an html interface, and when I enter its IP address into the browser's bar, I can see and interact with the station.

I'd been some years since I moved to weewx and configured this.  I don't remember why socket 22222 is there in the config file.  Is there a historical reason for it?  
On Monday, October 14, 2024 at 4:13:46 PM UTC-7 Tom Keffer wrote:

matthew wall

unread,
Oct 15, 2024, 8:42:35 AM10/15/24
to weewx-user
On Tuesday, October 15, 2024 at 8:01:47 AM UTC-4 loonsailor wrote:
re the version of weewx, I did "sudo apt update; sudo apt upgrade; sudo apt install weewx" and I get the response that 5.0.1 is the current version.  I looked in /etc/apt/sources.d, and the file weewx.list contains only one commented out line:

# deb [arch=all] http://weewx.com/apt/python3 buster main # disabled on upgrade to jammy

I'm now on Linux 24.04.1 LTS, which is, I think, jammy.  Should I have a different repository list?

please uncomment that line, then do 'sudo apt update'.  at that point you should see 5.1.0 as the latest available weewx.  something like 'apt-cache show weewx' i think?

there is only one weewx repository for python3 on debian systems.  the 'buster' indicates the oldest compatible debian release; that repository will work with buster and anything later.


 

matthew wall

unread,
Oct 15, 2024, 8:48:30 AM10/15/24
to weewx-user
On Monday, October 14, 2024 at 7:06:24 PM UTC-4 loonsailor wrote:
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL __main__: Unable to load driver: [Errno 101] Network is unreachable
Oct 14 14:33:20 ubu-mini-weather weewxd[833]: CRITICAL __main__:     ****  Exiting...

this smells like weewx starting before the networking has started.  can you 'sudo systemctl start weewx' once the system is up and running?
 
Oct 14 14:33:20 ubu-mini-weather systemd[1]: weewx.service: Main process exited, code=exited, status=4/NOPERMISSION
Oct 14 14:33:20 ubu-mini-weather systemd[1]: weewx.service: Failed with result 'exit-code'.

but this indicates something more insidious, such as a firewall, or selinux/apparmor, or some kind of systemd jail.  can you get more information from systemd about why it is reporting NOPERMISSION for your weewxd process?

loonsailor

unread,
Oct 15, 2024, 10:36:28 AM10/15/24
to weewx-user
Thanks, Matthew, I think you're right.  I started weewx using systemctl and it works.  So, probably a startup ordering problem.  I won't be able to work on that until this afternoon (PDT) to confirm.

As for the version issue, I hadn't noticed that I was getting this error.  Should I override somehow, or is it an issue with the repository?

Err:1 https://weewx.com/apt/python3 buster InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E788768B9CB16E10
Reading package lists... Done
W: GPG error: https://weewx.com/apt/python3 buster InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E788768B9CB16E10
E: The repository 'https://weewx.com/apt/python3 buster InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

vince

unread,
Oct 15, 2024, 4:25:24 PM10/15/24
to weewx-user
Run the 'configure apt' section at the beginning of https://www.weewx.com/docs/5.1/quickstarts/debian/ please.  On a clean ubuntu 24.04.1LTS system the quickstart instructions worked perfectly and I got 5.1.0 
Message has been deleted

loonsailor

unread,
Oct 16, 2024, 12:33:04 AM10/16/24
to weewx-user
Not sure how I missed the configure part, but I guess I did.  Ran that, and now I'm on 5.1.  And, miraculously, 5.1 works just fine, and I see why.  Weewx is now started by a systemd service, which specifies that it requires the network before startup.  5.0.1 was started with the old rc5.d system, and it made no such specification, so it started too early.  It was, indeed, a bug in 5.0.1 that has now been fixed.

One last question.  What's best practice with weewx.conf?  I kept my old (4.8) config file and it works.  I see a file called weewx.conf-4.8.0-5.1.0.  Is that a merged config file?  Should I just use that, or stick with my old config, or merge by hand?

Thanks for all the help!
Reply all
Reply to author
Forward
0 new messages