XDGFX / ultrasonics

Sync music playlists between all your music services. Do more with your music.
GNU General Public License v3.0
218 stars 18 forks source link

plex shows nothing on the page #24

Closed off112a closed 2 years ago

off112a commented 3 years ago

Plexpage shows nothing after I have setup the Plex plugin and pressed submit.

The same thing happens if I choose plex as input.

I have reinstall the docker image but the same happens every time.

plex

XDGFX commented 3 years ago

Could you post any relevant logs? Hopefully it shows something isn't working when you try to submit.

rodrigorodrigo commented 3 years ago

can confirm that this is happening. After putting plex configs, it just goes straight to the main page. Console doesn't show anything significant.

EDIT: logs show the following:

Message: 'Could not build plugin! Check your database settings are correct.'
Arguments: (ParseError('mismatched tag: line 260, column 2'),)
--- Logging error ---
Traceback (most recent call last):
File "/ultrasonics/webapp.py", line 230, in html_configure_plugin
settings = plugins.plugin_build(plugin, version, component)
File "/ultrasonics/plugins.py", line 133, in plugin_build
settings_dict = found_plugins[name].builder(
File "/ultrasonics/official_plugins/up_plex.py", line 366, in builder
root = ElementTree.fromstring(resp.text)
File "/usr/local/lib/python3.8/xml/etree/ElementTree.py", line 1320, in XML
parser.feed(text)
File "<string>", line None
xml.etree.ElementTree.ParseError: mismatched tag: line 260, column 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/logging/handlers.py", line 69, in emit
if self.shouldRollover(record):
File "/usr/local/lib/python3.8/logging/handlers.py", line 185, in shouldRollover
msg = "%s\n" % self.format(record)
File "/usr/local/lib/python3.8/logging/__init__.py", line 925, in format
return fmt.format(record)
File "/usr/local/lib/python3.8/logging/__init__.py", line 664, in format
record.message = record.getMessage()
File "/usr/local/lib/python3.8/logging/__init__.py", line 369, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "/usr/local/lib/python3.8/site-packages/eventlet/greenthread.py", line 221, in main
result = function(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/eventlet/wsgi.py", line 825, in process_request
proto.__init__(conn_state, self)
File "/usr/local/lib/python3.8/site-packages/eventlet/wsgi.py", line 357, in __init__
self.handle()
File "/usr/local/lib/python3.8/site-packages/eventlet/wsgi.py", line 390, in handle
self.handle_one_request()
File "/usr/local/lib/python3.8/site-packages/eventlet/wsgi.py", line 466, in handle_one_request
self.handle_one_response()
File "/usr/local/lib/python3.8/site-packages/eventlet/wsgi.py", line 573, in handle_one_response
result = self.application(self.environ, start_response)
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.8/site-packages/flask_socketio/__init__.py", line 45, in __call__
return super(_SocketIOMiddleware, self).__call__(environ,
File "/usr/local/lib/python3.8/site-packages/engineio/middleware.py", line 74, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/ultrasonics/webapp.py", line 246, in html_configure_plugin
log.error(
XDGFX commented 3 years ago

Alright, looks like Plex is returning an xml response which isn't quite correct.

Just to confirm, you can complete and fill in this page, but clicking submit here brings you back to the homepage? Was the test successful?

Screenshot from 2021-08-12 23-27-26

I want to have a look at what XML file Plex is returning, could you please add the following line above line 366 in ultrasonics/official_plugins/up_plex.py?

    log.error(resp.text)

It should look like this:

image

Then run again, and it should print the whole XML file as an error to console. Copy and paste it here inside a code block and I'll have a look :)

rodrigorodrigo commented 3 years ago

Server URL only tests correct if I don't insert the port which, according to the placeholder syntax is not correct.

I will log that line later today and will post the results.

EDIT: I'm using the docker deployment option and apparently /bin/bash is not present on the container. Any other way to access it?

rodrigorodrigo commented 3 years ago

some other debugging that may help:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1953, in full_dispatch_request
return self.finalize_request(rv)
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1968, in finalize_request
response = self.make_response(rv)
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2097, in make_response
raise TypeError(
TypeError: The view function did not return a valid response. The function either returned None or ended without a return statement.
2021-08-16 20:32:24,247 - 🎧 plex - DEBUG - Running settings test for plugin plex v0.1 (plugins.py:187)
2021-08-16 20:32:24,248 - 🎧 plex - DEBUG - Checking that Plex responds to API requests... (up_plex.py:310)
2021-08-16 20:32:24,247 - 🎧 plex - DEBUG - Running settings test for plugin plex v0.1 (plugins.py:187)
2021-08-16 20:32:24,248 - 🎧 plex - DEBUG - Checking that Plex responds to API requests... (up_plex.py:310)
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:981: InsecureRequestWarning: Unverified HTTPS request is being made to host 'plex.algumacoisa.online'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
warnings.warn(
2021-08-16 20:32:24,725 - 🎧 plex - DEBUG - Test successful. (up_plex.py:317)
2021-08-16 20:32:24,725 - 🎧 plex - DEBUG - Testing music directories... (up_plex.py:322)
2021-08-16 20:32:24,725 - 🎧 plex - DEBUG - Plex and ultrasonics music paths detected successfully. (up_plex.py:324)
2021-08-16 20:32:24,725 - 🎧 plex - DEBUG - Checking permissions... (up_plex.py:329)
2021-08-16 20:32:24,726 - 🎧 plex - DEBUG - Successfully created and removed temporary ultrasonics sync directory. (up_plex.py:343)
2021-08-16 20:32:24,726 - 🎧 plex - INFO - Settings test successful. (up_plex.py:349)
[2021-08-16 20:32:24,726] ERROR in app: Exception on /configure_plugin [POST]

this happens everytime I try to add plex as a source. Apparently something fails at the very end, on the builder

XDGFX commented 3 years ago

Server URL only tests correct if I don't insert the port which, according to the placeholder syntax is not correct.

Unverified HTTPS request is being made to host 'plex.algumacoisa.online'

It seems that you're trying to connect to Plex over WAN. Assuming you're using a reverse proxy to forward port 443 to port 32400 on your Plex machine that's why it works without a port.

EDIT: I'm using the docker deployment option and apparently /bin/bash is not present on the container. Any other way to access it?

There should be some shell, try accessing /bin/sh or /usr/bin/sh? If that still doesn't work you could edit the file on your computer and then overwrite it in the container using docker cp.

XDGFX commented 2 years ago

Closing as I haven't had a response from OP. Please re-open if you're still having issues!

koiralasandesh commented 1 year ago

First of all, thanks for the awesome tool @XDGFX.
I was having this issue after I updated my plex password. Every time I clicked on 'Plex', it would redirect me to the homepage. I wanted to update the plex token in ultrasonics but I looked everywhere and could not find where to. Finally, I whipped out sqlite editor and changed the Plex Token in the db which solved the issue for me. I suspect you have a broken plex config somewhere in db. I hope you find this helpful.