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

GMediaRender stopped working after update 6.29.2 #3519

Closed
fnsnyc opened this issue May 9, 2020 · 10 comments
Closed

GMediaRender stopped working after update 6.29.2 #3519

fnsnyc opened this issue May 9, 2020 · 10 comments
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Milestone

Comments

@fnsnyc
Copy link

fnsnyc commented May 9, 2020

Creating a bug report/issue

Required Information

  • DietPi version | 6.29.2
  • Kernel version | Linux DietPi 4.19.
  • SBC model | RPi4

Steps to reproduce

Need to correct the file /etc/systemd/system/gmrender.service

dietpi@DietPi:~$ sudo systemctl status gmrender.service 
  
gmrender.service - GMediaRender (DietPi)
   Loaded: loaded (/etc/systemd/system/gmrender.service; disabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/gmrender.service.d
           └─dietpi-process_tool.conf, dietpi-services_edit.conf
   Active: failed (Result: exit-code) since Sat 2020-05-09 09:37:22 -03; 47s ago
  Process: 615 ExecStartPre=/DietPi/dietpi/func/obtain_network_details (code=exited, status=0/SUCCESS)
  Process: 619 ExecStartPre=/bin/dash -c systemctl set-environment ACTIVE_IP=$(mawk NR==4 /DietPi/dietpi/.network) (code=exited, status=0/SUCCESS)
  Process: 622 ExecStart=/usr/local/bin/gmediarender -u 941892a6-f8c7-42e8-b8eb-b407257a8bf0 -f DietPi --gstout-audiosink=alsasink --gstout-audiodevice=sysdefault --gstout-initial-volume-db
=0 --logfile=stdout -I $ACTIVE_IP (code=exited, status=1/FAILURE)
 Main PID: 622 (code=exited, status=1/FAILURE)

May 09 09:37:21 DietPi systemd[1]: Starting GMediaRender (DietPi)...
May 09 09:37:21 DietPi dash[619]: mawk: cannot open /DietPi/dietpi/.network (No such file or directory)
May 09 09:37:21 DietPi systemd[1]: Started GMediaRender (DietPi).
May 09 09:37:22 DietPi gmediarender[622]: Failed to initialize: Missing argument for -I
May 09 09:37:22 DietPi systemd[1]: gmrender.service: Main process exited, code=exited, status=1/FAILURE
May 09 09:37:22 DietPi systemd[1]: gmrender.service: Failed with result 'exit-code'.
dietpi@DietPi:~$ 

The IP address is not passing to the GMediaRender ExecStart

Here is my /etc/systemd/system/gmrender.service :

[Unit]
Description=GMediaRender (DietPi)
Wants=network-online.target
After=network-online.target dietpi-boot.service

[Service]
User=gmrender
ExecStartPre=+/bin/dash -c 'systemctl set-environment ACTIVE_IP=$(mawk 'NR==4' /run/dietpi/.network)'
ExecStart=/usr/local/bin/gmediarender -u '941892a6-f8c7-42e8-b8eb-b407257a8bf0' -f 'DietPi' --gstout-audiosink=alsasink --gstout-audiodevice=sysdefault --gstout-initial-volume-db=0 --logfi$

[Install]
WantedBy=multi-user.target

My workaround is inserting the Rpi4 IP address into the ExecStart command:

ExecStart=/usr/local/bin/gmediarender -u '941892a6-f8c7-42e8-b8eb-b407257a8bf0' -f 'DietPi' --gstout-audiosink=alsasink --gstout-audiodevice=sysdefault --gstout-initial-volume-db=0 --logfile=stdout -I "192.168.4.107"
@Joulinar
Copy link
Collaborator

Joulinar commented May 9, 2020

Hi,

many thanks for your report. Well /run/dietpi/.network is located on new location on new release 6.29.2. (as expected)

mawk: cannot open /DietPi/dietpi/.network (No such file or directory)

for sure it's not gonna work anymore as file is moved from /DietPi/dietpi/.network to /run/dietpi/.network

@MichaIng
I guess gmrender.service would need to be adjusted

@MichaIng
Copy link
Owner

MichaIng commented May 10, 2020

@fnsnyc @Joulinar
Many thanks for reporting this issue.

Interesting that the gmrender.service contains the correct location already (it is indeed adjusted during update) but the error messages shows it checking the old location. I guess there is simply some systemctl daemon-reload missing. Actually I thought that this is done at the end of every DietPi update, let me see...

@fnsnyc
Just to verify, please run:

systemctl daemon-reload
systemctl restart gmrender
systemctl status gmrender

@fnsnyc
Copy link
Author

fnsnyc commented May 10, 2020

@MichaIng

Same error.

@MichaIng
Copy link
Owner

MichaIng commented May 10, 2020

This is actually indeed done:

@fnsnyc
If the above steps do indeed not solve it, I see that you have edited the service file before, as there is a /etc/systemd/system/gmrender.service.ddietpi-services_edit.conf. Could you please paste the following to show the finally effective service code:

systemctl cat gmrender

@fnsnyc
Copy link
Author

fnsnyc commented May 10, 2020

dietpi@DietPi:~$ sudo systemctl cat gmrender
# /etc/systemd/system/gmrender.service
[Unit]
Description=GMediaRender (DietPi)
Wants=network-online.target
After=network-online.target dietpi-boot.service

[Service]
User=gmrender
ExecStartPre=+/bin/dash -c 'systemctl set-environment ACTIVE_IP=$(mawk 'NR==4' /run/dietpi/.network)'
ExecStart=/usr/local/bin/gmediarender -u '941892a6-f8c7-42e8-b8eb-b407257a8bf0' -f 'DietPi' --gstout-audiosink=alsasink --gstout-audiodevice=sysdefault --gstout-initial-volume-db=0 --log
file=stdout -I "$ACTIVE_IP"
#ExecStart=/usr/local/bin/gmediarender -u '941892a6-f8c7-42e8-b8eb-b407257a8bf0' -f 'DietPi' --gstout-audiosink=alsasink --gstout-audiodevice=sysdefault --gstout-initial-volume-db=0 --lo
gfile=stdout -I "192.168.4.107"


[Install]
WantedBy=multi-user.target

# /etc/systemd/system/gmrender.service.d/dietpi-process_tool.conf
# WARNING: Do not manually edit this file, use "dietpi-services" to adjust values!
[Service]
Nice=-10
IOSchedulingPriority=0

# /etc/systemd/system/gmrender.service.d/dietpi-services_edit.conf
[Unit]
#Description=GMediaRender (DietPi)
#Wants=network-online.target
#After=network-online.target dietpi-boot.service

[Service]
#User=gmrender
#ExecStartPre=+/bin/dash -c 'systemctl set-environment ACTIVE_IP=$(mawk 'NR==4' /DietPi/dietpi/.network)'
#ExecStart=/usr/local/bin/gmediarender -u '941892a6-f8c7-42e8-b8eb-b407257a8bf0' -f 'DietPi' --gstout-audiosink=alsasink --gstout-audiodevice=sysdefault --gstout-initial-volume-db=0 --lo
gfile=stdout -I "$ACTIVE_IP"

ExecStartPre=
ExecStartPre=/DietPi/dietpi/func/obtain_network_details
ExecStartPre=+/bin/dash -c 'systemctl set-environment ACTIVE_IP=$(mawk 'NR==4' /DietPi/dietpi/.network)'


[Install]
#WantedBy=multi-user.target
dietpi@DietPi:~$ 
``

@MichaIng
Copy link
Owner

@fnsnyc
Ah there it is. I remember this being a fix for another issue if network interface bring-up takes very long. Let's keep the fix in place, so do:

sed -Ei 's@/(DietPi|boot)/dietpi/\.network@/run/dietpi/.network@g' /etc/systemd/system/gmrender.service.d/dietpi-services_edit.conf
systemctl daemon-reload
systemctl restart gmrender
systemctl status gmrender

@fnsnyc
Copy link
Author

fnsnyc commented May 10, 2020

voilà! now it's working!! Thanks so much!

@Joulinar Joulinar added Solution available 🥂 Definite solution has been done and removed Investigating 🤔 labels May 10, 2020
@Joulinar
Copy link
Collaborator

@MichaIng
I guess this would need to be implemented by default. I did a test installation on 6.30 and it fails as network interface bring-up takes longer. See attached picture.

root@DietPi3:~# systemctl cat gmrender.service
# /etc/systemd/system/gmrender.service
[Unit]
Description=GMediaRender (DietPi)
Documentation=https://github.com/hzeller/gmrender-resurrect/blob/master/INSTALL.md#commandline-options
Wants=network-online.target
After=network-online.target sound.target dietpi-boot.service

[Service]
User=gmrender
ExecStartPre=+/bin/dash -c 'systemctl set-environment ACTIVE_IP=$(mawk 'NR==4' /run/dietpi/.network)'
ExecStart=/usr/local/bin/gmediarender -u 'be44fcef-43f6-4b60-85f1-9479df37c41a' -f 'DietPi3' --gstout-audiosink=alsasink --gstout-audiodevice=default --logfile=stdout -I "$ACTIVE_IP"

[Install]
WantedBy=multi-user.target
root@DietPi3:~#

LAN IP is not detected right after reboot, therefore GMediaRender is going to fail.
20200511_094206

@MichaIng
Copy link
Owner

@Joulinar
Agree. I did another step to delay network data estimation until network time sync has proven internet connectivity (in most cases): 7fb8b09
Will also add the info refresh to all service starts which read the info file, so also on service restarts, when users e.g. connect to a different WiFi, or DHCP changed the IP, info will be also up-to-date.

MichaIng added a commit that referenced this issue May 11, 2020
+ CHANGELOG | Add v6.31 changelog
+ CHANGELOG | GMediaRender+WireGuard: Resolved an issue where service start could have failed due to invalid network information. Many thanks to @fnsnyc for reporting this issue: #3519
+ CHANGELOG | After travelling back to the future 2030, we were able to apply bug fixes with alien technology to the v6.30 release back in 2020.
@MichaIng
Copy link
Owner

Done, as well for WireGuard: e5fc3bb
Changelog: 9633e71

@MichaIng MichaIng added this to the v6.31 milestone May 11, 2020
@MichaIng MichaIng mentioned this issue Jun 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Projects
None yet
Development

No branches or pull requests

3 participants