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

Fix issue with logs that contains space in the path #783

Merged

Conversation

piotrmaj
Copy link

@piotrmaj piotrmaj commented Nov 5, 2023

Fix issue with logs that contains space in the path: wrap tail argument in quotes to prevent the faulty behavior as per https://stackoverflow.com/a/43793896

@LinuxServer-CI
Copy link

PR build pushed to ghcr.io/linuxserver/mods:pull_request_783

@aptalca
Copy link
Member

aptalca commented Nov 5, 2023

This will break multiple log paths

Try escaping the space in your var instead

@LinuxServer-CI
Copy link

PR build pushed to ghcr.io/linuxserver/mods:pull_request_783

@piotrmaj
Copy link
Author

piotrmaj commented Nov 5, 2023

This will break multiple log paths

Try escaping the space in your var instead

I tried that at the begging but couldn't make it work.

- name: LOGS_TO_STDOUT 
  value: "/config/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ Crash\ Uploader.log|/config/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ Crash\ Uploader.log"`

Results in

Starting Plex Media Server. . . (you can ignore the libusb_init error)
Executing: tail -F /config/Library/Application Support/Plex Media Server/Logs/Plex Crash Uploader.log /config/Library/Application Support/Plex Media Server/Logs/Plex Crash Uploader.log
tail: cannot open '/config/Library/Application' for reading: No such file or directory
tail: cannot open 'Support/Plex' for reading: No such file or directory
tail: cannot open 'Media' for reading: No such file or directory
tail: cannot open 'Server/Logs/Plex' for reading: No such file or directory
tail: cannot open 'Crash' for reading: No such file or directory
tail: cannot open 'Uploader.log' for reading: No such file or directory
tail: cannot open '/config/Library/Application' for reading: No such file or directory
tail: cannot open 'Support/Plex' for reading: No such file or directory
tail: cannot open 'Media' for reading: No such file or directory
tail: cannot open 'Server/Logs/Plex' for reading: No such file or directory
tail: cannot open 'Crash' for reading: No such file or directory
tail: cannot open 'Uploader.log' for reading: No such file or directory

And version without quotes

- name: DOCKER_MODS
  value: linuxserver/mods:universal-stdout-logs
- name: LOGS_TO_STDOUT 
  value: /config/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ Crash\ Uploader.log|/config/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ Crash\ Uploader.log

give the same results

Starting Plex Media Server. . . (you can ignore the libusb_init error)
Executing: tail -F /config/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ Crash\ Uploader.log /config/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ Crash\ Uploader.log
tail: cannot open '/config/Library/Application\' for reading: No such file or directory
tail: cannot open 'Support/Plex\' for reading: No such file or directory
tail: cannot open 'Media\' for reading: No such file or directory
tail: cannot open 'Server/Logs/Plex\' for reading: No such file or directory
tail: cannot open 'Crash\' for reading: No such file or directory
tail: cannot open 'Uploader.log' for reading: No such file or directory
tail: cannot open '/config/Library/Application\' for reading: No such file or directory
tail: cannot open 'Support/Plex\' for reading: No such file or directory
tail: cannot open 'Media\' for reading: No such file or directory
tail: cannot open 'Server/Logs/Plex\' for reading: No such file or directory
tail: cannot open 'Crash\' for reading: No such file or directory
tail: cannot open 'Uploader.log' for reading: No such file or directory

Current solution with parsing to array seems to work but I'm not very good with bash so maybe it has some other downsides

- name: DOCKER_MODS
  value: linuxserver/mods:pull_request_783
- name: LOGS_TO_STDOUT Uploader.log|/config/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ DLNA\ Server.log
  value: "/config/Library/Application Support/Plex Media Server/Logs/Plex Crash Uploader.log|/config/Library/Application Support/Plex Media Server/Logs/Plex DLNA Server.log"

result:

Starting Plex Media Server. . . (you can ignore the libusb_init error)
Executing: tail -F /config/Library/Application Support/Plex Media Server/Logs/Plex Crash Uploader.log /config/Library/Application Support/Plex Media Server/Logs/Plex DLNA Server.log
==> /config/Library/Application Support/Plex Media Server/Logs/Plex Crash Uploader.log <==
Nov 05, 2023 18:04:58.225 [140202741205816] INFO - Crash Uploader - Platform: Linux ServerUUID: 7eaef04630e39c9d93cca711912451534c8bd7ab UserId: [email protected] Version: 1.32.7.7621-871adbd44
Nov 05, 2023 18:04:58.226 [140202741205816] INFO - Pre-processed minidump directory: /config/Library/Application Support/Plex Media Server/Crash Reports/1.32.7.7621-871adbd44
Nov 05, 2023 18:04:58.226 [140202741205816] INFO - Post-processed minidump directory: /tmp
Nov 05, 2023 18:04:58.216 [140202773784584] INFO - Crash Uploader - Processing Complete.
==> /config/Library/Application Support/Plex Media Server/Logs/Plex DLNA Server.log <==
Jul 15, 2021 20:39:47.630 [0x7f5436bfd700] DEBUG - Mapped object 52557847-e9d7-49f6-b9fa-e6b54923190d_99 to  part 0 on server 
Jul 15, 2021 20:39:47.634 [0x7f5436bfd700] DEBUG - OnBrowseDirectChildren returning success with 4 objects of 4 total
Jul 15, 2021 20:39:48.642 [0x7f5436bfd700] DEBUG - OnBrowseDirectChildren for '52557847-e9d7-49f6-b9fa-e6b54923190d_99' with filter 'res@resolution,res@nrAudioChannels,res@sampleFrequency,res@bitrate,dc:creator,res@dlna:cleartextSize,dc:date,upnp:genre,res,res@duration,res@size,upnp:albumArtURI,upnp:originalTrackNumber,upnp:album,upnp:artist,upnp:author' and sort '', paged as 0 + 30
Jul 15, 2021 20:39:48.642 [0x7f5436bfd700] DEBUG - Mapped client to generic profile: SOAPAction: "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"; DLNADeviceName.lge.com: %5bLG%5d%20webOS%20TV%20OLED55B9SLA; User-Agent: Linux/4.4.84-169.gld4tv.4 UPnP/1.0 LGE WebOS TV LGE_DLNA_SDK/1.6.0/05.10.15 DLNADOC/1.50; Host: 192.168.0.52:32469; Content-Length: 713; Content-Type: text/xml; charset="utf-8"
Jul 15, 2021 20:39:48.643 [0x7f5436bfd700] DEBUG - Mapped object 52557847-e9d7-49f6-b9fa-e6b54923190d_99 to  part 0 on server 
Jul 15, 2021 20:39:48.646 [0x7f5436bfd700] DEBUG - OnBrowseDirectChildren returning success with 4 objects of 4 total
Jul 15, 2021 20:39:49.654 [0x7f5436bfd700] DEBUG - OnBrowseDirectChildren for '52557847-e9d7-49f6-b9fa-e6b54923190d_99' with filter 'res@resolution,res@nrAudioChannels,res@sampleFrequency,res@bitrate,dc:creator,res@dlna:cleartextSize,dc:date,upnp:genre,res,res@duration,res@size,upnp:albumArtURI,upnp:originalTrackNumber,upnp:album,upnp:artist,upnp:author' and sort '', paged as 0 + 30
Jul 15, 2021 20:39:49.654 [0x7f5436bfd700] DEBUG - Mapped client to generic profile: SOAPAction: "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"; DLNADeviceName.lge.com: %5bLG%5d%20webOS%20TV%20OLED55B9SLA; User-Agent: Linux/4.4.84-169.gld4tv.4 UPnP/1.0 LGE WebOS TV LGE_DLNA_SDK/1.6.0/05.10.15 DLNADOC/1.50; Host: 192.168.0.52:32469; Content-Length: 713; Content-Type: text/xml; charset="utf-8"
Jul 15, 2021 20:39:49.654 [0x7f5436bfd700] DEBUG - Mapped object 52557847-e9d7-49f6-b9fa-e6b54923190d_99 to  part 0 on server 
Jul 15, 2021 20:39:49.658 [0x7f5436bfd700] DEBUG - OnBrowseDirectChildren returning success with 4 objects of 4 total

@aptalca aptalca mentioned this pull request Nov 10, 2023
@aptalca
Copy link
Member

aptalca commented Nov 10, 2023

@piotrmaj I didn't see that you had updated your PR to use an array. That would be the proper fix.

Please rename the array to TAIL_LOGS so it's consistent with prior code and we'll merge.

Thanks

@piotrmaj
Copy link
Author

piotrmaj commented Nov 11, 2023

@aptalca good point about the array name - updated the PR. Thanks for the review and for the work on linuxserver images, they are awesome! ☺️

I noticed that for some reason docker build failed now due to
failed to solve: failed to authorize: failed to fetch oauth token: Post "https://auth.docker.io/token": EOF
but it doesn't seem to be related to my changes

@aptalca
Copy link
Member

aptalca commented Nov 11, 2023

Thanks. Docker hub has been having issues today.

@LinuxServer-CI
Copy link

PR build pushed to ghcr.io/linuxserver/mods:pull_request_783

@aptalca aptalca merged commit cfb7dc6 into linuxserver:universal-stdout-logs Nov 11, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants