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

Not Running #49

Open
kakious opened this issue May 13, 2017 · 7 comments
Open

Not Running #49

kakious opened this issue May 13, 2017 · 7 comments
Labels

Comments

@kakious
Copy link

kakious commented May 13, 2017

I have installed the terminal via PIP and it will not run. It is not producing any logs.

@jesseward
Copy link
Owner

hi @kakious thanks for reporting.

What version of python and which operating system are currently using?

@jesseward jesseward added the bug label May 16, 2017
@kakious
Copy link
Author

kakious commented May 17, 2017

I am running
Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-75-generic x86_64)
Python 2.7.12

@jesseward
Copy link
Owner

thanks @kakious please paste a copy of your plex-scrobble.toml configuration file as well. Though please remove any reference to your last.fm credentials (user/key/secret).

Please also run plex-scrobble through strace and pass along the output. The following will stuff the output into /tmp/plex-scrobble.out. You can dump the output into http://pastebin.com or some other text sharing site.

strace -f -o /tmp/plex-scrobble.out plex-scrobble

If you have existing plex-scrobble cache files, try deleting those as well (cache_location in your config file)

@kakious
Copy link
Author

kakious commented May 17, 2017

.toml
[lastfm] api_key = "**********" password = "**********" user_name = "kakious" api_secret = "**********" [plex-scrobble] mediaserver_log_location = "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.log" log_file = "/tmp/plex-scrobble.log" mediaserver_url = "http://localhost:32400" cache_location = "/tmp/plex_scrobble.cache

Strace : http://termbin.com/ozu2

@jesseward
Copy link
Owner

jesseward commented May 17, 2017

hey @kakious , in the run that was captured with strace , it suggests that that pid 19575 was able to open the logger file handle and spit out a few lines to the log. Do you see anything on disk this time around ?

PID defs

19575 - parent plex-scrobble pid
19582 - child thread that polls "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.log",
19582 - child thread that monitors the cache file /tmp/plex_scrobble.cache

file handle 3

19575 open("/tmp/plex-scrobble.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = 3
...
19575 write(3, "2017-05-17 10:19:29,878 [19575] "..., 80) = 80
19583 write(3, "2017-05-17 10:19:29,882 [19575] "..., 87 <unfinished ...>
19583 <... write resumed> )             = 87

plex-scrobbler was attempting to stuff 170 bytes into file handle 3 (> /tmp/plex-scrobble.log) . Is there any data currently present in that log file ? If so , could you send it along

file handle 4

Appears to be controlled by PID 19582 and looks like its reading your Plex log file. The select call waits for 30k microseconds then reads the file again looking for new log entries.. The polling behaviour seems to be working as expected..

19582 open("/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.log", O_RDONLY <unfinished ...>
19582 <... open resumed> )              = 4
...
19582 select(0, NULL, NULL, NULL, {0, 30000}) = 0 (Timeout)
19582 fstat(4, {st_mode=S_IFREG|0644, st_size=1511896, ...}) = 0
19582 read(4, "", 4096)   
19582 select(0, NULL, NULL, NULL, {0, 30000}) = 0 (Timeout)
19582 fstat(4, {st_mode=S_IFREG|0644, st_size=1515568, ...}) = 0
19582 read(4, "", 4096)  

If you didn't see anything in the log file that time around, I can create a patch that will allow you to log to STDOUT instead of a file for further debugging....

@kakious
Copy link
Author

kakious commented May 18, 2017

It seems there are some data in log. Here is what it has:
http://termbin.com/huep

I will actually try running it and testing it again. I just updated the system fully and there was a strange occurrence where I had multiple linux headers.

UPDATE : Still not registering I am listening anything

@jesseward
Copy link
Owner

jesseward commented May 18, 2017

hi @kakious , if the script is still logging, please dump the most recent logs.

Do you see the following logs being written to /tmp/plex-scrobble.log-> https://github.com/jesseward/plex-lastfm-scrobbler/blob/master/plex_scrobble/plex_monitor.py#L135

When you view your Plex server log data (/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.log), does the now played log entry match any of the regex found in -> https://github.com/jesseward/plex-lastfm-scrobbler/blob/master/plex_scrobble/plex_monitor.py#L26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants