Description
When running PageKite as both frontend and backend, the service encounters a TypeError indicating an unexpected integer in a string operation. The error output is:
TypeError: sequence item 0: expected str instance, int found
Below is the relevant portion of the systemd status log for pagekite.service:
Jan 22 09:27:11 vps-xxxxxx pagekite[22392]: ^^^^^^^^^^^^^^^^^^^^^^
Jan 22 09:27:11 vps-xxxxxx pagekite[22392]: File "/usr/lib/python3/dist-packages/pagekite/proto/selectables.py", line 695, in Inbound
Jan 22 09:27:11 vps-xxxxxx pagekite[22392]: return self.ProcessTls(data)
Jan 22 09:27:11 vps-xxxxxx pagekite[22392]: ^^^^^^^^^^^^^^^^^^^^^
Jan 22 09:27:11 vps-xxxxxx pagekite[22392]: File "/usr/lib/python3/dist-packages/pagekite/proto/conns.py", line 1813, in ProcessTls
Jan 22 09:27:11 vps-xxxxxx pagekite[22392]: self.Send(TLS_Unavailable(unavailable=True), try_flush=True)
Jan 22 09:27:11 vps-xxxxxx pagekite[22392]: File "/usr/lib/python3/dist-packages/pagekite/proto/selectables.py", line 449, in Send
Jan 22 09:27:11 vps-xxxxxx pagekite[22392]: pending = ''.join([self.write_blocked, str(''.join(data))])
Jan 22 09:27:11 vps-xxxxxx pagekite[22392]: ^^^^^^^^^^^^^
Jan 22 09:27:11 vps-xxxxxx pagekite[22392]: TypeError: sequence item 0: expected str instance, int found
Steps to Reproduce
-
Configure PageKite as both a frontend and a backend.
-
Use the following (simplified) frontend configuration in /etc/pagekite.d/20_frontends.rc:
isfrontend
ports=80,443
protos=http,https
domain=http,https:*.hosting.space:<secret>
tls_endpoint=*.hosting.space:/etc/letsencrypt/live/hosting.space/frontend.pem
-
Run the backend with a command similar to:
./pagekite.py --clean \
--frontend=hosting.space:443 \
--service_on=https:coolify.hosting.space:localhost:8000:<secret> \
--logfile=pagekite.log
-
Check the service status:
sudo systemctl status pagekite.service
-
Observe the TypeError in the logs.
Expected Behavior
PageKite should handle TLS connections without raising a TypeError, successfully passing traffic over HTTP/HTTPS.
Actual Behavior
The PageKite service raises a TypeError indicating that an integer was found where a string was expected, causing an exception in selectables.py.
Additional Information
- OS: Debian 12 (VPS)
- PageKite version: (installed from
apt / system package repository)
- IP Address (Obfuscated):
xxx.xxx.xxx.xxx
- Domain:
hosting.space
- Certificates: Let's Encrypt (stored in
/etc/letsencrypt/live/hosting.space/)
Commands for reference:
sudo systemctl status pagekite.service
sudo systemctl restart pagekite.service
If you need more information (e.g., full logs or configuration details), let me know.
Possible Causes / Ideas
- Mismatch between Python string encoding and integer data in
selectables.py.
- A bug in the TLS handling logic that improperly casts or handles data types.
Description
When running PageKite as both frontend and backend, the service encounters a TypeError indicating an unexpected integer in a string operation. The error output is:
Below is the relevant portion of the systemd status log for
pagekite.service:Steps to Reproduce
Configure PageKite as both a frontend and a backend.
Use the following (simplified) frontend configuration in
/etc/pagekite.d/20_frontends.rc:Run the backend with a command similar to:
Check the service status:
Observe the TypeError in the logs.
Expected Behavior
PageKite should handle TLS connections without raising a
TypeError, successfully passing traffic over HTTP/HTTPS.Actual Behavior
The PageKite service raises a
TypeErrorindicating that an integer was found where a string was expected, causing an exception inselectables.py.Additional Information
apt/ system package repository)xxx.xxx.xxx.xxxhosting.space/etc/letsencrypt/live/hosting.space/)Commands for reference:
sudo systemctl status pagekite.servicesudo systemctl restart pagekite.serviceIf you need more information (e.g., full logs or configuration details), let me know.
Possible Causes / Ideas
selectables.py.