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

metadata_extract.py ... Unavailable Video ... SyntaxError: f-string: unterminated string [and "502 Bad Gateway" on RPi 4 & RPi 400] #187

Closed
holta opened this issue Jun 14, 2024 · 9 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@holta
Copy link
Member

holta commented Jun 14, 2024

This same error appears throughout @nzola's Raspberry Pi journalctl log (journalctl -u calibre-web).

Excerpt from iiab-diagnostics https://dpaste.com/7GNXBAD7F :

Jun 13 21:49:43 lokole10 systemd[1]: Started calibre-web.service - Calibre-Web.
Jun 13 21:49:49 lokole10 python3[8440]: Traceback (most recent call last):
Jun 13 21:49:49 lokole10 python3[8440]:   File "/usr/local/calibre-web-py3/cps.py", line 51, in <module>
Jun 13 21:49:49 lokole10 python3[8440]:     main()
Jun 13 21:49:49 lokole10 python3[8440]:   File "/usr/local/calibre-web-py3/cps/main.py", line 37, in main
Jun 13 21:49:49 lokole10 python3[8440]:     from .editbooks import editbook
Jun 13 21:49:49 lokole10 python3[8440]:   File "/usr/local/calibre-web-py3/cps/editbooks.py", line 61, in <module>
Jun 13 21:49:49 lokole10 python3[8440]:     from .tasks.metadata_extract import TaskMetadataExtract
Jun 13 21:49:49 lokole10 python3[8440]:   File "/usr/local/calibre-web-py3/cps/tasks/metadata_extract.py", line 141
Jun 13 21:49:49 lokole10 python3[8440]:     self.message += f"<br><br>Unavailable Video(s):<br>{'<br>'.join(f'<a href="{url}" target="_blank">{url}</a>' for url in self.unavailable)}"
Jun 13 21:49:49 lokole10 python3[8440]:                                                                                ^
Jun 13 21:49:49 lokole10 python3[8440]: SyntaxError: f-string: unterminated string

Context:

  • He upgraded IIAB Calibre-Web up to and including PRs 182, 183, 184
  • xklb (unfortunately) remains 2.8.059
  • yt-dlp (unfortunately) remains 2024.04.09

Tangentially related:

@holta holta added question Further information is requested bug Something isn't working labels Jun 14, 2024
@nzola
Copy link

nzola commented Jun 15, 2024

New iiab install on pi4, Calibre-Web browser still produces error 502 Bad Gateway.
PUBLISHING TO URL... https://dpaste.com/BLUAQSFKU
image

@holta holta changed the title metadata_extract.py ... Unavailable Video ... SyntaxError: f-string: unterminated string metadata_extract.py ... Unavailable Video ... SyntaxError: f-string: unterminated string [and "502 Bad Gateway" on RPi 4] Jun 15, 2024
@holta
Copy link
Member Author

holta commented Jun 15, 2024

Thank you @nzola:

  1. Logs appear very similar on both your RPi 4 installs.

  2. This should be a very high priority for @deldesir to try to understand and resolve in the coming week!

@holta
Copy link
Member Author

holta commented Jun 15, 2024

Oh dear, https://dpaste.com/BLUAQSFKU#line-2448 shows:

FILE DOES NOT EXIST: /var/log/xklb.log

@nzola can you please run all 4 commands below — and show us the output with a photo or copy/paste?

lb --version
pipx list | grep xklb
yt-dlp --version
/root/.local/pipx/venvs/xklb/bin/yt-dlp --version

@holta
Copy link
Member Author

holta commented Jun 15, 2024

@deldesir systemd service (calibre-web) says it's running, but its systemctl status at https://dpaste.com/BLUAQSFKU#line-2297 is extremely ugly again — definitely needing clean-up to remove SyntaxError: f-string: unterminated string : (Python 3.11 on Raspberry Pi OS 12 here)

COMMAND: /usr/bin/systemctl status calibre-web    # Is Calibre-Web running?

● calibre-web.service - Calibre-Web
     Loaded: loaded (/etc/systemd/system/calibre-web.service; enabled; preset: enabled)
     Active: active (running) since Sat 2024-06-15 00:38:35 PDT; 18min ago
   Main PID: 595 (python3)
      Tasks: 3 (limit: 3910)
        CPU: 7.657s
     CGroup: /system.slice/calibre-web.service
             └─595 /usr/local/calibre-web-py3/bin/python3 /usr/local/calibre-web-py3/cps.py -p /library/calibre-web/config/app.db

Jun 15 00:39:14 Lokole11 python3[595]:   File "/usr/local/calibre-web-py3/cps.py", line 51, in <module>
Jun 15 00:39:14 Lokole11 python3[595]:     main()
Jun 15 00:39:14 Lokole11 python3[595]:   File "/usr/local/calibre-web-py3/cps/main.py", line 37, in main
Jun 15 00:39:14 Lokole11 python3[595]:     from .editbooks import editbook
Jun 15 00:39:14 Lokole11 python3[595]:   File "/usr/local/calibre-web-py3/cps/editbooks.py", line 61, in <module>
Jun 15 00:39:14 Lokole11 python3[595]:     from .tasks.metadata_extract import TaskMetadataExtract
Jun 15 00:39:14 Lokole11 python3[595]:   File "/usr/local/calibre-web-py3/cps/tasks/metadata_extract.py", line 141
Jun 15 00:39:14 Lokole11 python3[595]:     self.message += f"<br><br>Unavailable Video(s):<br>{'<br>'.join(f'<a href="{url}" target="_blank">{url}</a>' for url in self.unavailable)}"
Jun 15 00:39:14 Lokole11 python3[595]:                                                                                ^
Jun 15 00:39:14 Lokole11 python3[595]: SyntaxError: f-string: unterminated string

@deldesir
Copy link
Collaborator

Weird. The log says it's a syntax error, but the xklb and yt-dlp versions' freeze is another serious issue.

@holta
Copy link
Member Author

holta commented Jun 15, 2024

xklb and yt-dlp versions' freeze is another serious issue

My guess is that:

  1. Stale versions of xklb & yt-dlp were incidental yesterday. As @nzola did not know he was supposed to run...

    pipx upgrade --include-injected xklb
    

    ...during upgrade of IIAB Calibre-Web.

  2. His fresh install today might have the latest xklb & yt-dlp even though these (sadly) do not appear in the logs. Hopefully he'll confirm later today: metadata_extract.py ... Unavailable Video ... SyntaxError: f-string: unterminated string [and "502 Bad Gateway" on RPi 4 & RPi 400] #187 (comment)

@nzola
Copy link

nzola commented Jun 15, 2024

@holta @deldesir > Oh dear, https://dpaste.com/BLUAQSFKU#line-2448 shows:

FILE DOES NOT EXIST: /var/log/xklb.log

@nzola can you please run all 4 commands below — and show us the output with a photo or copy/paste?

lb --version
pipx list | grep xklb
yt-dlp --version
/root/.local/pipx/venvs/xklb/bin/yt-dlp --version
admin@Lokole11:~ $ sudo -i
root@Lokole11:~# lb --version
pipx list | grep xklb
2.8.063
   package xklb 2.8.63, installed using Python 3.11.2
root@Lokole11:~# yt-dlp --version
/root/.local/pipx/venvs/xklb/bin/yt-dlp --version
2024.05.27
2024.05.27
root@Lokole11:~#

@holta
Copy link
Member Author

holta commented Jun 24, 2024

@deldesir please try to solve this within the week:

@nzola has done yet another fresh install (Raspberry Pi OS 12 on Raspberry Pi 400) and the Syntax Error with "Bad Gateway" result is the same — journalctl -u calibre-web shows:

 -- Boot bd5d4bea20094c508bd257d7e65b63c6 --
Jun 23 22:07:42 box systemd[1]: Started calibre-web.service - Calibre-Web.
Jun 23 22:08:23 box python3[640]: Traceback (most recent call last):
Jun 23 22:08:23 box python3[640]:   File "/usr/local/calibre-web-py3/cps.py", line 51, in <module>
Jun 23 22:08:23 box python3[640]:     main()
Jun 23 22:08:23 box python3[640]:   File "/usr/local/calibre-web-py3/cps/main.py", line 38, in main
Jun 23 22:08:23 box python3[640]:     from .editbooks import editbook
Jun 23 22:08:23 box python3[640]:   File "/usr/local/calibre-web-py3/cps/editbooks.py", line 45, in <module>
Jun 23 22:08:23 box python3[640]:     from .tasks.metadata_extract import TaskMetadataExtract
Jun 23 22:08:23 box python3[640]:   File "/usr/local/calibre-web-py3/cps/tasks/metadata_extract.py", line 142
Jun 23 22:08:23 box python3[640]:     self.message += f"<br><br>Unavailable Video(s):<br>{'<br>'.join(f'<a href="{url}" target="_blank">{url}</a>' for url in self.unavailable)}"
Jun 23 22:08:23 box python3[640]:                                                                                ^
Jun 23 22:08:23 box python3[640]: SyntaxError: f-string: unterminated string
Jun 23 22:14:07 box systemd[1]: Stopping calibre-web.service - Calibre-Web...
Jun 23 22:14:09 box systemd[1]: calibre-web.service: Main process exited, code=exited, status=1/FAILURE
Jun 23 22:14:09 box systemd[1]: calibre-web.service: Failed with result 'exit-code'.
Jun 23 22:14:09 box systemd[1]: Stopped calibre-web.service - Calibre-Web.
Jun 23 22:14:09 box systemd[1]: calibre-web.service: Consumed 9.638s CPU time.
-- Boot 4f00d3b217004ff8a9c468432ca50d46 --

iiab-diagnostics: https://dpaste.com/H7G5CDLGZ

@holta holta changed the title metadata_extract.py ... Unavailable Video ... SyntaxError: f-string: unterminated string [and "502 Bad Gateway" on RPi 4] metadata_extract.py ... Unavailable Video ... SyntaxError: f-string: unterminated string [and "502 Bad Gateway" on RPi 4 & RPi 400] Jun 24, 2024
@holta holta pinned this issue Jun 24, 2024
@holta
Copy link
Member Author

holta commented Jun 24, 2024

Possibly the problem resulted from Python 3.11 within Debian 12 "Bookworm" ≈ Raspberry Pi OS 12?

As compared to Python 3.12 within Ubuntu 24.04+ having more modern f-string support?

In any case it appears fixed, thanks to:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants