nextcloud / nextcloud/notify_push
Failed to connect to Nextcloud database: received corrupt message
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 344
- Forks
- 64
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 5
Description
x86_64$ LOG=DEBUG ./notify_push -- config.php
[2021-05-24 15:26:03.946631 +02:00] DEBUG [rustls::client::hs] /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.19.0/src/client/hs.rs:89: No cached session for DNSNameRef("localhost")
[2021-05-24 15:26:03.946674 +02:00] DEBUG [rustls::client::hs] /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.19.0/src/client/hs.rs:211: Not resuming any session
Error:
0: Failed to connect to Nextcloud database
1: error communicating with the server: received corrupt message
2: received corrupt message
Location:
/tmp/krankerl.PNFmShx8gZmS/notify_push/src/storage_mapping.rs:57
Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Dump-config looks correct:
./notify_push --dump-config config.php
Config {
database: AnyConnectOptions(
MySql(
MySqlConnectOptions {
host: "localhost",
port: 3306,
socket: Some(
"/var/run/mysqld/mysqld.sock",
),
username: "nextcloud",
password: Some(
"XXXXXXXXXX",
),
database: Some(
"nextcloud",
),
ssl_mode: Preferred,
ssl_ca: None,
statement_cache_capacity: 100,
charset: "utf8mb4",
collation: None,
log_settings: LogSettings {
statements_level: Info,
slow_statements_level: Warn,
slow_statements_duration: 1s,
},
},
),
),
database_prefix: "oc_",
redis: [
ConnectionInfo {
addr: Unix(
"/var/run/redis/redis.sock",
),
db: 0,
username: None,
passwd: None,
},
],
nextcloud_url: "https://XXX.XXX.XX/",
metrics_bind: None,
log_level: "DEBUG",
bind: Tcp(
0.0.0.0:7867,
),
allow_self_signed: false,
}
It seems to be as if the tools tries to establish an TLS connecion over the local unix socket what does not make any sense.
Using 127.0.0.1 as DB host also doesn't work (failing with InvalidDNSNameError what is correct, using the hostname in the server certificate doesn't work too with the very same error "received corrupt message"),
How can the ssl_mode config be controlled?
System:
- Debian 10.9
- DB: MariaDB 10.3
- PHP 8.0
- ./notify_push --version:
notify_push 0.1.7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/storage_mapping.rs:57 and reproduce the failure with the shown notify_push command and config.php on MariaDB 10.3. Inspect how the database connection and ssl_mode are selected, then verify the behavior with the reported Unix-socket and host configurations. Done means the connection handles the configured transport without the corrupt-message error or clearly reports an unsupported configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mariadb, rust
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100