weewx.service: Failed with result 'exit-code'

251 views
Skip to first unread message

Marco Citossi

unread,
Apr 29, 2024, 4:48:47 PM4/29/24
to weewx-user

Hi! I've installed weewx in Oracle Linux 8.9 following the guide for RedHat.

The installation has completed without errors. It has been installed in default folders,  in /var/www/html/weewx (weewx:weewx), /usr/share/weewx (root:root) and /etc/weewx (weewx:weewx) for bin and weewx.conf

Only weewx.conf is root:weewx.

Device driver is VantagePro2 , ethernet port.

Old installation (3.8.0a1) in old web server is working.

 

When I try to start weewx, it starts for a while then I get this error:


● weewx.service - WeeWX

   Loaded: loaded (/usr/lib/systemd/system/weewx.service; enabled; vendor preset: disabled)

   Active: failed (Result: exit-code) since Mon 2024-04-29 18:23:46 CEST; 14s ago

     Docs: https://weewx.com/docs

  Process: 11571 ExecStart=/usr/bin/weewxd /etc/weewx/weewx.conf (code=exited, status=4)

 Main PID: 11571 (code=exited, status=4)


apr 29 18:23:46 web4.xxx weewxd[11571]: CRITICAL weewx.engine:     ****      Vantage.__init__(self, **config_d>

apr 29 18:23:46 web4.xxx weewxd[11571]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/driver>

apr 29 18:23:46 web4.xxx weewxd[11571]: CRITICAL weewx.engine:     ****      self.port.openPort()

apr 29 18:23:46 web4.xxx weewxd[11571]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/driver>

apr 29 18:23:46 web4.xxx weewxd[11571]: CRITICAL weewx.engine:     ****      raise weewx.WeeWxIOError(ex)

apr 29 18:23:46 web4.xxx weewxd[11571]: CRITICAL weewx.engine:     ****  weewx.WeeWxIOError: timed out

apr 29 18:23:46 web4.xxx weewxd[11571]: CRITICAL __main__: Unable to load driver: timed out

apr 29 18:23:46 web4.xxx weewxd[11571]: CRITICAL __main__:     ****  Exiting...

apr 29 18:23:46 web4.xxx systemd[1]: weewx.service: Main process exited, code=exited, status=4/NOPERMISSION

apr 29 18:23:46 web4.xxx systemd[1]: weewx.service: Failed with result 'exit-code'.


If I do a restart for a while I get: 


weewx.service - WeeWX

   Loaded: loaded (/usr/lib/systemd/system/weewx.service; enabled; vendor preset: disabled)

   Active: active (running) since Mon 2024-04-29 18:32:53 CEST; 3s ago

     Docs: https://weewx.com/docs

 Main PID: 11671 (python3)

    Tasks: 1 (limit: 48736)

   Memory: 11.3M

   CGroup: /system.slice/weewx.service

           └─11671 python3 /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf


apr 29 18:32:53 web4.xxx weewxd[11671]: INFO __main__: Locale: 'en_US.UTF-8'

apr 29 18:32:53 web4.xxx weewxd[11671]: INFO __main__: Entry path: /usr/share/weewx/weewxd.py

apr 29 18:32:53 web4.xxx weewxd[11671]: INFO __main__: WEEWX_ROOT: /etc/weewx

apr 29 18:32:53 web4.xxx weewxd[11671]: INFO __main__: Configuration file: /etc/weewx/weewx.conf

apr 29 18:32:53 web4.xxx weewxd[11671]: INFO __main__: User module: /etc/weewx/bin/user

apr 29 18:32:53 web4.xxx weewxd[11671]: INFO __main__: Debug: 1

apr 29 18:32:53 web4.xxx weewxd[11671]: DEBUG __main__: Initializing engine

apr 29 18:32:53 web4.xxx weewxd[11671]: INFO weewx.engine: Loading station type Vantage (weewx.drivers.vantage)

apr 29 18:32:53 web4.xxx weewxd[11671]: DEBUG weewx.drivers.vantage: Driver version is 3.6.2

apr 29 18:32:53 web4.xxx weewxd[11671]: DEBUG weewx.drivers.vantage: Option loop_request=1

Tom Keffer

unread,
Apr 29, 2024, 4:52:45 PM4/29/24
to weewx...@googlegroups.com
Looks like a permissions issue accessing the port. See the wiki article How to fix device permissions and see if that helps.

--
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/68ba097e-fc7d-4812-bd1c-64e0b2266f68n%40googlegroups.com.

Marco Citossi

unread,
Apr 29, 2024, 5:04:58 PM4/29/24
to weewx-user

Hi! 

I've checked the article you suggested and looking the permissions in /etc/udev/rules.d/60-weewx.rules I see in the file:


# davis vantage via usb-serial

SUBSYSTEM=="tty",ATTRS{idVendor}=="10c4",ATTRS{idProduct}=="ea60",MODE="0664",GROUP="weewx",SYMLINK+="vantage"

SUBSYSTEM=="tty",ATTRS{idVendor}=="10c4",ATTR{idProduct}=="ea61",MODE="0664",GROUP="weewx",SYMLINK+="vantage"


It seems already ok.


If I try with ls -l /dev/ttyS0 I get:


crw-rw---- 1 root dialout 4, 64 28 apr 23.12 /dev/ttyS0


and it seems ok.

Tom Keffer

unread,
Apr 29, 2024, 6:14:20 PM4/29/24
to weewx...@googlegroups.com
It seems that your device is not being recognized by the udev rule, perhaps because it is has an ethernet port. 

Check the vendor and product ID of your logger with the command "lsusb". It will output something like

Bus 001 Device 003: ID 18e8:6238 Qcom
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP2102/CP2109 UART Bridge Controller [CP210x family]
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

In this case, 10c4 is the vendor ID and ea60 is the product id. Substitute whatever values you get for the "idVendor" and "idProduct" fields, respectively, in the rules file. Then unplug the logger and plug it back in again.

See what you get for ownership after that.

-tk


Marco Citossi

unread,
Apr 30, 2024, 7:57:26 AM4/30/24
to weewx-user
The device has an ethernet port. Now it is working in another webserver.
I've also tried to stop the service in the other web server but the result is the same.
If I do lsusb I don't get anything.

Marco Citossi

unread,
Apr 30, 2024, 11:28:15 AM4/30/24
to weewx-user
the problem is that if I stop the service and I restart it works for just a glimpse. I try again status and I get the error.

weewx.service - WeeWX

   Loaded: loaded (/usr/lib/systemd/system/weewx.service; enabled; vendor preset: disabled)

   Active: active (running) since Tue 2024-04-30 12:00:53 CEST; 4s ago

     Docs: https://weewx.com/docs

 Main PID: 19495 (python3)

    Tasks: 1 (limit: 48736)

   Memory: 9.1M

   CGroup: /system.slice/weewx.service

           └─19495 python3 /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf





Tom Keffer

unread,
Apr 30, 2024, 2:54:54 PM4/30/24
to weewx...@googlegroups.com
Apologies. You have an ethernet device, right? So, it's going to connect to a network port, not a USB port. 

Could you please post the full log? The systemctl status reports are very brief and don't give line numbers.

Set debug=1, then try restarting weewx. Post the log.

Thanks.

Marco Citossi

unread,
Apr 30, 2024, 4:21:52 PM4/30/24
to weewx-user

Yes it's ethernet.

Here it is the log:


apr 30 18:07:10 web4.xxx systemd[1]: Started WeeWX.

apr 30 18:07:10 web4.xxx weewxd[22596]: INFO __main__: Initializing weewxd version 5.0.2

apr 30 18:07:10 web4.xxx weewxd[22596]: INFO __main__: Command line: /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf

apr 30 18:07:10 web4.xxx weewxd[22596]: INFO __main__: Using Python 3.6.8 (default, Jan 16 2024, 02:08:59) 

                                                 [GCC 8.5.0 20210514 (Red Hat 8.5.0-20.0.1)]

apr 30 18:07:10 web4.xxx weewxd[22596]: INFO __main__: Located at /usr/bin/python3

apr 30 18:07:10 web4.xxx weewxd[22596]: INFO __main__: Platform Linux-5.4.17-2136.330.7.1.el8uek.x86_64-x86_64-with-oracle-8.9

apr 30 18:07:10 web4.xxx weewxd[22596]: INFO __main__: Locale: 'en_US.UTF-8'

apr 30 18:07:10 web4.xxx weewxd[22596]: INFO __main__: Entry path: /usr/share/weewx/weewxd.py

apr 30 18:07:10 web4.xxx weewxd[22596]: INFO __main__: WEEWX_ROOT: /etc/weewx

apr 30 18:07:10 web4.xxx weewxd[22596]: INFO __main__: Configuration file: /etc/weewx/weewx.conf

apr 30 18:07:10 web4.xxx weewxd[22596]: INFO __main__: User module: /etc/weewx/bin/user

apr 30 18:07:10 web4.xxx weewxd[22596]: INFO __main__: Debug: 1

apr 30 18:07:10 web4.xxx weewxd[22596]: DEBUG __main__: Initializing engine

apr 30 18:07:10 web4.xxx weewxd[22596]: INFO weewx.engine: Loading station type Vantage (weewx.drivers.vantage)

apr 30 18:07:10 web4.xxx weewxd[22596]: DEBUG weewx.drivers.vantage: Driver version is 3.6.2

apr 30 18:07:10 web4.xxx weewxd[22596]: DEBUG weewx.drivers.vantage: Option loop_request=1

apr 30 18:07:14 web4.xxx weewxd[22596]: ERROR weewx.drivers.vantage: Socket error while opening port 22222 to ethernet host 140.105.>

apr 30 18:07:14 web4.xxx weewxd[22596]: ERROR weewx.engine: Import of driver failed: timed out (<class 'weewx.WeeWxIOError'>)

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****  Traceback (most recent call last):

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 35>

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****      self.socket.connect((self.host, self.port))

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****  socket.timeout: timed out

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****  During handling of the above exception, another exception o>

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****  Traceback (most recent call last):

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/engine.py", line 115, in set>

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****      self.console = loader_function(config_dict, self)

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 32>

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****      return VantageService(engine, config_dict)

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 20>

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****      Vantage.__init__(self, **config_dict[DRIVER_NAME])

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 53>

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****      self.port.openPort()

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 35>

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****      raise weewx.WeeWxIOError(ex)

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL weewx.engine:     ****  weewx.WeeWxIOError: timed out

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL __main__: Unable to load driver: timed out

apr 30 18:07:14 web4.xxx weewxd[22596]: CRITICAL __main__:     ****  Exiting...

apr 30 18:07:14 web4.xxx systemd[1]: weewx.service: Main process exited, code=exited, status=4/NOPERMISSION

apr 30 18:07:14 web4.xxx systemd[1]: weewx.service: Failed with result 'exit-code'.

Tom Keffer

unread,
Apr 30, 2024, 5:03:43 PM4/30/24
to weewx...@googlegroups.com
I am wondering whether the network is up and running by the time weewxd tries to access it. Try editing your weewx systemd service file (normally located in /lib/systemd/system/weewx.service) so it looks something like the following:

[Unit]
Description=WeeWX
Documentation=https://weewx.com/docs
Requires=time-sync.target
After=time-sync.target
After=network-online.target
Requires=network-online.target

Then

sudo systemctl daemon-reload
sudo systemctl restart weewx

If that doesn't work, we can try putting a sleep command in the startup.

Also, can you telnet to the logger and perform the logger TEST function? The IP address of your logger got cut off in the log, but it would look something like this (replace 140.105.xxx.yyy with the IP address):

telnet 140.105.xxx.yyy 22222
press <enter> a few times.
Then type "TEST", all caps. It will not echo.
then <enter>
The logger should respond with "TEST".




Marco Citossi

unread,
Apr 30, 2024, 5:44:34 PM4/30/24
to weewx-user
I've tried to change weewx.service but without results.
Telent doesn't echo anything.
The network should work because the old weewx (3.8.xxx) on the other webserver is working.

Tom Keffer

unread,
Apr 30, 2024, 6:39:51 PM4/30/24
to weewx...@googlegroups.com
I am not that familiar with the IP logger, but I assume you would obey the same echo TEST as a regular logger. If it doesn't, then it sounds like there is a connectivity problem.

Yes, it worked under WeeWX V3.8, but you have also changed servers since then.

Double check any firewalls. For example, do you use iptables? Does your router prevent indiscriminate traffic between ports? 



vince

unread,
Apr 30, 2024, 11:57:29 PM4/30/24
to weewx-user
Marco are you running with selinux in enforcing mode ? Can you check for selinux errors in your logs or perhaps temporarily run with selinux disabled to see if that helps ? 

Sorry but I’m away from a computer so I can’t give you the precise commands, but selinux can rather quietly stop things from working in some configurations. It would be helpful to eliminate that possibility.

Other possibility is that your weewx user isn’t in a group with network access. What does ‘groups weewx’ return ?

Tom Keffer

unread,
May 1, 2024, 12:12:37 AM5/1/24
to weewx...@googlegroups.com
Vince, Redhat doesn't necessarily allow socket access for ports over 1024?

vince

unread,
May 1, 2024, 5:58:27 AM5/1/24
to weewx-user
It should certainly permit ports over 1024 but if selinux blocks stuff due to an executable not being labelled correctly you can get quiet failures unless you notice it in the logs. It’s not always self-evident when he victim program logs what it thinks happened. I just can’t remember the file it logs into (away from computer for a few days).

Quick test would to ‘temporarily’ run setenforce 0 to disable enforcement, try it again, and see if magic happens. Then of course reenable selinux via setenforce 1 and work the actual issue.  Basically test to be sure you can eliminate selinux as a possible cause.  But if selinux is blocking something it will log that someplace in /var/log

Marco Citossi

unread,
May 1, 2024, 7:45:42 AM5/1/24
to weewx-user
Hi vince! sestatus gives disabled...
Message has been deleted

vince

unread,
May 2, 2024, 11:15:14 PM5/2/24
to weewx-user
Marco - Would you provide more information to help us understand your system ?  See the new Problem Reporting Questionnaire (link) for the kind of information we need in order to try to help much better.  Thank you.
Reply all
Reply to author
Forward
0 new messages