bug: pushd error: VAPID_PRIVATE_KEY: InvalidPadding #86

Closed
opened 2026-02-16 12:51:24 -05:00 by yindo · 7 comments
Owner

Originally created by @VladlenAfonin on GitHub (Jan 6, 2025).

What happened?

Error description

When I run docker compose up -d I get the following in the pushd logs:

pushd-1          | thread 'main' panicked at crates/daemons/pushd/src/consumers/outbound/vapid.rs:33:14:
pushd-1          | valid `VAPID_PRIVATE_KEY`: InvalidPadding
pushd-1          | note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

As far as I understand, the issue is related to vapid private key: when I change it in the Revolt.toml, the error message also changes. The keys are generated using the ./generate_config.sh script.

Environment

OS: Debian 12
Docker version 27.4.1, build b9d17ea
Docker Compose version v2.32.1
Arch: amd64 (x86_64)

Maybe important: I don't use domain names. I only use IP address.

Steps to reproduce

Following README.md:

  1. Clone the repository.
  2. Generate keys using ./generate_config.sh 123.123.123.123 (my IP address is different).
  3. Run docker compose up -d.

Expected

All the services start and the pages https://123.123.123.123/* are accessible.

Actual behavior

pushd service does not load and keeps restarting with the error message presented above.

UPD 2025-01-08

I have also tried with domain name and using Ubuntu 24.04 as in the instructions. The error is the same,

Originally created by @VladlenAfonin on GitHub (Jan 6, 2025). ### What happened? # Error description When I run `docker compose up -d` I get the following in the `pushd` logs: ``` pushd-1 | thread 'main' panicked at crates/daemons/pushd/src/consumers/outbound/vapid.rs:33:14: pushd-1 | valid `VAPID_PRIVATE_KEY`: InvalidPadding pushd-1 | note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` As far as I understand, the issue is related to `vapid` private key: when I change it in the `Revolt.toml`, the error message also changes. The keys are generated using the `./generate_config.sh` script. # Environment OS: Debian 12 Docker version 27.4.1, build b9d17ea Docker Compose version v2.32.1 Arch: amd64 (x86_64) **Maybe important**: I don't use domain names. I only use IP address. # Steps to reproduce Following `README.md`: 1. Clone the repository. 2. Generate keys using `./generate_config.sh 123.123.123.123` (my IP address is different). 3. Run `docker compose up -d`. ## Expected All the services start and the pages `https://123.123.123.123/*` are accessible. ## Actual behavior `pushd` service does not load and keeps restarting with the error message presented above. # UPD 2025-01-08 I have also tried with domain name and using Ubuntu 24.04 as in the instructions. The error is the same,
yindo added the bug label 2026-02-16 12:51:24 -05:00
yindo closed this issue 2026-02-16 12:51:24 -05:00
Author
Owner

@Rexogamer commented on GitHub (Jan 8, 2025):

the decoder requires that the generated key has no padding. I suspect that the generated keys have padding - we've seen this issue on our end at Upryzing and, taking a look, our key (which was generated with the script) does have padding. I'll test removing it in a bit and see if that fixes the issue

@Rexogamer commented on GitHub (Jan 8, 2025): [the decoder](https://github.com/revoltchat/backend/blob/main/crates/daemons/pushd/src/consumers/outbound/vapid.rs#L31-L33) requires that the generated key has no padding. I _suspect_ that the generated keys have padding - we've seen this issue on our end at Upryzing and, taking a look, our key (which was generated with the script) does have padding. I'll test removing it in a bit and see if that fixes the issue
Author
Owner

@Rexogamer commented on GitHub (Jan 8, 2025):

yup. removing the padding fixes this issue. now getting a different error which is with our configuration, but the original issue has gone

@Rexogamer commented on GitHub (Jan 8, 2025): yup. removing the padding fixes this issue. now getting a different error which is with our configuration, but the original issue has gone
Author
Owner

@Rexogamer commented on GitHub (Jan 8, 2025):

I'm assuming the fix is to remove the padding when generating the keys so cc @insertish

@Rexogamer commented on GitHub (Jan 8, 2025): I'm assuming the fix is to remove the padding when generating the keys so cc @insertish
Author
Owner

@Akurosia commented on GitHub (Jan 9, 2025):

Can you give an example how you fixed it in the script?
i am currently running into the same issue.

@Akurosia commented on GitHub (Jan 9, 2025): Can you give an example how you fixed it in the script? i am currently running into the same issue.
Author
Owner

@Rexogamer commented on GitHub (Jan 9, 2025):

I didn't tweak the script, but in our Revolt.toml I tweaked the private key to remove the equals signs (=) at the end. equals signs at the end of base64 strings are padding, which the code requires to be absent.

@Rexogamer commented on GitHub (Jan 9, 2025): I didn't tweak the script, but in our `Revolt.toml` I tweaked the private key to remove the equals signs (=) at the end. equals signs at the end of base64 strings are padding, which the code requires to be absent.
Author
Owner

@hakt0r commented on GitHub (Jan 28, 2025):

my pr should automate this, sorry for the brevity, i still encounter other issues

@hakt0r commented on GitHub (Jan 28, 2025): my pr should automate this, sorry for the brevity, i still encounter other issues
Author
Owner

@DeclanChidlow commented on GitHub (Feb 9, 2025):

Closing as should be resolved by https://github.com/revoltchat/self-hosted/pull/126 which is now merged.

@DeclanChidlow commented on GitHub (Feb 9, 2025): Closing as should be resolved by https://github.com/revoltchat/self-hosted/pull/126 which is now merged.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: stoatchat/self-hosted#86