Commit Graph

59086 Commits

Author SHA1 Message Date
Michael Klishin d5b883223f
Merge pull request #13559 from rabbitmq/tls-header
Log clearer message if TLS client connects to AMQP port
2025-03-17 19:26:25 -04:00
David Ansari 11e56bdd2d Detect misconfigured HTTP clients
It also happens from time to time that HTTP clients use the wrong port
5672. Like for TLS clients connecting to 5672, RabbitMQ now prints a
more descriptive log message.

For example
```
curl http://localhost:5672
```
will log
```
[info] <0.946.0> accepting AMQP connection [::1]:57736 -> [::1]:5672
[error] <0.946.0> closing AMQP connection <0.946.0> ([::1]:57736 -> [::1]:5672, duration: '1ms'):
[error] <0.946.0> {detected_unexpected_http_header,<<"GET / HT">>}
```

We only check here for GET and not for all other HTTP methods, since
that's the most common case.
2025-03-17 23:43:07 +01:00
David Ansari 7ed3a0b0d8 Log clearer message if TLS client connects to AMQP port
## What?

If a TLS client app is misconfigured trying to connect to AMQP port 5672
instead to the AMQPS port 5671, this commit makes RabbitMQ log a more
descriptive error message.

```
openssl s_client -connect localhost:5672 -tls1_3
openssl s_client -connect localhost:5672 -tls1_2
```

RabbitMQ logs prior to this commit:
```
[info] <0.1073.0> accepting AMQP connection [::1]:53535 -> [::1]:5672
[error] <0.1073.0> closing AMQP connection <0.1073.0> ([::1]:53535 -> [::1]:5672, duration: '0ms'):
[error] <0.1073.0> {bad_header,<<22,3,1,0,192,1,0,0>>}

[info] <0.1080.0> accepting AMQP connection [::1]:53577 -> [::1]:5672
[error] <0.1080.0> closing AMQP connection <0.1080.0> ([::1]:53577 -> [::1]:5672, duration: '1ms'):
[error] <0.1080.0> {bad_header,<<22,3,1,0,224,1,0,0>>}
```

RabbitMQ logs after this commit:
```
[info] <0.969.0> accepting AMQP connection [::1]:53632 -> [::1]:5672
[error] <0.969.0> closing AMQP connection <0.969.0> ([::1]:53632 -> [::1]:5672, duration: '0ms'):
[error] <0.969.0> {detected_unexpected_tls_header,<<22,3,1,0,192,1,0,0>>

[info] <0.975.0> accepting AMQP connection [::1]:53638 -> [::1]:5672
[error] <0.975.0> closing AMQP connection <0.975.0> ([::1]:53638 -> [::1]:5672, duration: '1ms'):
[error] <0.975.0> {detected_unexpected_tls_header,<<22,3,1,0,224,1,0,0>>}
```

 ## Why?

I've seen numerous occurrences in the past few years where misconfigured TLS apps
connected to the wrong port. Therefore, RabbitMQ trying to detect a TLS client
and providing a more descriptive log message seems appropriate to me.

 ## How?

The first few bytes of any TLS connection are:

Record Type (1 byte):
Always 0x16 (22 in decimal) for a Handshake message.

Version (2 bytes):
This represents the highest version of TLS that the client supports. Common values:
0x0301 → TLS 1.0 (or SSL 3.1)
0x0302 → TLS 1.1
0x0303 → TLS 1.2
0x0304 → TLS 1.3

Record Length (2 bytes):
Specifies the length of the following handshake message.

Handshake Type (1 byte, usually the 6th byte overall):
Always 0x01 for ClientHello.
2025-03-17 22:48:42 +01:00
Michael Klishin 18533d4dee
Mention #13541 #13542 #13549 13551 in release notes
References #13537.
2025-03-17 16:54:31 -04:00
Arnaud Cogoluègnes 302fb38df2
Merge pull request #13554 from rabbitmq/increase-frame-size-limit-091-generated-code
Commit generated code after FRAME-MIN-SIZE change
2025-03-17 17:23:52 +01:00
Arnaud Cogoluègnes 0dc55be1d3 Commit generated code after FRAME-MIN-SIZE change
References #13541
2025-03-17 17:04:38 +01:00
Aitor Pérez Cedres 24a0f29ae1
Merge pull request #13534 from rabbitmq/ci/refine-oci-triggers
Refine CI triggers for building OCI
2025-03-17 13:29:33 +00:00
Aitor Pérez Cedres dcf1bbc72d
Merge pull request #13552 from rabbitmq/ci/ci-otp-27
Use Erlang 27 in CI for tests
2025-03-17 12:54:43 +00:00
Aitor Perez 3596ee9533
CI: use OTP 27 for tests
Erlang 27 is fully supported in main and v4.1.x. Support for Erlang 26
in v4.1 remains. It's better to "drop" erlang 26 from CI because, at the
moment, our PRs and commits to main trigger about 270 jobs. If we just
add '27' to the matrix, we would spawn ~216 more jobs, totalling around
496 jobs per PR and commit to main. That's simply too much, because it's
reaching the usage limits of Github Actions [1], namely the 256 limit of
matrix jobs.

[1]
https://docs.github.com/en/actions/administering-github-actions/usage-limits-billing-and-administration#usage-limits
2025-03-17 11:23:21 +00:00
Aitor Perez 8fc3ce990a
Trigger OCI builds on changes to its Dockerfile 2025-03-17 10:53:09 +00:00
Aitor Perez ed033772cb
Trigger OCI builds only on code changes
Prior to this change, we built the OCI for almost any change. That
doesn't make sense. For example, when there were changes to CI, it
didn't make because RabbitMQ had not changed.

CI will now build dev OCI images when there are actual code changes, or
changes to rabbit dependencies.
2025-03-17 10:53:02 +00:00
Arnaud Cogoluègnes 60fc3b14a6
Merge pull request #13549 from rabbitmq/increase-frame-size-limit-091
Increase FRAME-MIN-SIZE in AMQP 0-9-1 code generation file
2025-03-17 11:19:59 +01:00
Arnaud Cogoluègnes 34ed66037c Increase FRAME-MIN-SIZE in AMQP 0-9-1 code generation file
References #13541
2025-03-17 11:05:20 +01:00
Michael Klishin cc0989f679
Merge pull request #13542 from rabbitmq/rabbitmq-server-13541
Increase initial AMQP 0-9-1 connection frame size limit
2025-03-15 19:55:47 -04:00
Michael Klishin b8078874a7
Increase initial AMQP 0-9-1 connection frame size limit
Before the client authenticates, the standard
frame_max is not used. Instead, the limit is
a special constant.

This is fine for password or x.509 certificate-based
authentication but not for some JWT tokens,
which can vary in size, and take multiple
kilobytes.

8 kB specifically is the default HTTP header
length limit used by Nginx.
Sounds like this value was good enough
for a lot of Bearer headers with JWT tokens.

Closes #13541.
2025-03-15 18:22:55 -04:00
Michael Klishin ecf26b2670
Merge pull request #13538 from rabbitmq/dependabot/maven/deps/rabbit/test/amqp_jms_SUITE_data/main/dev-deps-1af6299c8b
[skip ci] Bump the dev-deps group across 5 directories with 3 updates
2025-03-15 14:45:53 -04:00
dependabot[bot] ea71ef5ab6
[skip ci] Bump the dev-deps group across 5 directories with 3 updates
Bumps the dev-deps group with 1 update in the /deps/rabbit/test/amqp_jms_SUITE_data directory: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5).
Bumps the dev-deps group with 1 update in the /deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot directory: [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5).
Bumps the dev-deps group with 1 update in the /deps/rabbitmq_mqtt/test/java_SUITE_data directory: [org.junit.jupiter:junit-jupiter](https://github.com/junit-team/junit5).
Bumps the dev-deps group with 2 updates in the /deps/rabbitmq_stream/test/rabbit_stream_SUITE_data directory: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5) and [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5).
Bumps the dev-deps group with 2 updates in the /deps/rabbitmq_stream_management/test/http_SUITE_data directory: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5) and [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5).


Updates `org.junit.jupiter:junit-jupiter-engine` from 5.12.0 to 5.12.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.0...r5.12.1)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.12.0 to 5.12.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.0...r5.12.1)

Updates `org.junit.jupiter:junit-jupiter` from 5.12.0 to 5.12.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.0...r5.12.1)

Updates `org.junit.jupiter:junit-jupiter-engine` from 5.12.0 to 5.12.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.0...r5.12.1)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.12.0 to 5.12.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.0...r5.12.1)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.12.0 to 5.12.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.0...r5.12.1)

Updates `org.junit.jupiter:junit-jupiter-engine` from 5.12.0 to 5.12.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.0...r5.12.1)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.12.0 to 5.12.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.0...r5.12.1)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.12.0 to 5.12.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.0...r5.12.1)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-15 18:31:53 +00:00
Jean-Sébastien Pédron 67d9d89f1a
rabbit_khepri: Remove setup retries
[Why]
Khepri already managed retries if needed, we can just use a timeout.

Note that the timeout was already bumped to a more appropriate 5
minutes, which also matches what we had with Mnesia. However, with 10
retries by default, it meant that this timeout at the end of `init/1`
would thus be 5 * 10 = 50 minutes.
2025-03-14 17:25:25 +01:00
Aitor Pérez Cedres dcd5415a18
Merge pull request #13514 from rabbitmq/remove-bazel-files
Remove Bazel files
2025-03-14 12:06:19 +00:00
Iliia Khaprov a0abfaa5b0 Change browser tab/window title according to currently loaded 'page'.
It is very hard now to distinguish different tabs. With this addition
we have titles like 'RabbitMQ - Queue vhost/name', 'RabbitMQ - Exchanges'.
To be continued...
2025-03-14 09:42:53 +01:00
Michael Klishin f9a1ed9559
Merge pull request #13528 from rabbitmq/ik-dpc-cli-force-queue-deletion
By @ikavgo: add a --force option to 'rabbitmqctl delete_queue'
2025-03-14 01:02:54 -04:00
Michael Klishin 4bb21d7549
RMQ-1263 CLI tools: replace Erlang files with Elixir
otherwise we end up with two copies of the compiled
module on the code path some of the time.

We don't need to mix Erlang and Elixir even
more to bring in one constant that hasn't changed
since its introduction some eight years ago.

(cherry picked from commit c32b948258f226a86be91cab80448d7a536afd7d)
2025-03-14 00:06:18 -04:00
Diana Parra Corbacho d2f66ced1b
RMQ-1263: Add a --force option to rabbitmqctl delete_queue command
RMQ-1263: Add a --force option to rabbitmqctl delete_queue command.

This work was originally done by Iliia Khaprov <iliia.khaprov@broadcom.net>.

---------

Co-authored-by: Iliia Khaprov <iliia.khaprov@broadcom.net>
Co-authored-by: Michael Klishin <klishinm@vmware.com>
(cherry picked from commit d9522d3ee708250cc84443af5c3556b14f7c5ab9)
2025-03-14 00:06:09 -04:00
Michael Klishin f1396b5695
Merge pull request #13525 from rabbitmq/ik-dpc-queue-protection
By @ikavgo: introduce a deletion protection marker for queues
2025-03-13 21:41:06 -04:00
Diana Parra Corbacho c69403e3e9
RMQ-1263: a mechanism for marking queues as protected (e.g. from deletion) (#44)
* RMQ-1263: Check if queue protected from deleted inside rabbit_amqqueue:with_delete

Delayed exchange automatically manages associated Delayed Queue. We don't want users to delete it accidentally.

If queue is indeed protected its removal can be forced by calling  with
?INTERNAL_USER as ActingUser.

* RMQ-1263: Correct a type spec of amqqueue:internal_owner/1

* RMQ-1263: Add protected queues test

---------

Co-authored-by: Iliia Khaprov <iliia.khaprov@broadcom.net>
Co-authored-by: Michael Klishin <klishinm@vmware.com>
(cherry picked from commit 97f44adfad6d0d98feb1c3a47de76e72694c19e0)
2025-03-13 19:41:36 -04:00
Aitor Perez 43f99912de
Remove Bazel lines from Makefile 2025-03-13 17:30:20 +00:00
Jean-Sébastien Pédron 3eeb8f9c01
Merge pull request #13518 from rabbitmq/update-meck-to-1.0.0
rabbitmq-components.mk: Update meck from 0.9.2 to 1.0.0
2025-03-13 17:17:52 +01:00
Jean-Sébastien Pédron 94b8ef6792
rabbitmq-components.mk: Update meck from 0.9.2 to 1.0.0
[Why]
Hopefully it will fix a crash we observe fairly regularily in CI.
2025-03-13 16:32:42 +01:00
Karl Nilsson 9ef0483b02
Merge pull request #13513 from rabbitmq/ra-2.16.3
Ra 2.16.3 - bug fixes.
2025-03-13 15:35:50 +01:00
Aitor Perez 07adc3e571
Remove Bazel files 2025-03-13 13:42:34 +00:00
Karl Nilsson 2efb9d7edc Ra 2.16.3 - bug fixes.
* Add num_segments to Ra counters
* ra_server_proc: Fix handling of local query replies
* Remove Bazel-related files by @mkuratczyk in #520
* Replication bug fixes that could cause replication to stall
* Use infinity timeout for ra_log_ets:mem_table_please
2025-03-13 12:15:22 +00:00
Jean-Sébastien Pédron 8486728f85
Merge pull request #13511 from rabbitmq/fix-test-flakes-in-python_SUITE
Fix test flakes in `python_SUITE`
2025-03-13 12:52:31 +01:00
Jean-Sébastien Pédron 337292758c
python_SUITE: Increase timeout in `x_queue_name.py` 2025-03-13 10:34:38 +01:00
Jean-Sébastien Pédron 4b6e1af09c
python_SUITE: Fix syntax error 2025-03-13 10:34:38 +01:00
Jean-Sébastien Pédron 38e7bd7f43
Merge pull request #13470 from rabbitmq/fix-test-flakes-in-various-testsuites
Fix test flakes in various testsuites
2025-03-13 10:33:13 +01:00
Michael Klishin 36be7bbe0d
Alpha release workflows: produce 4.2.x releases off of main
and 4.1.x ones off of v4.1.x, which is getting closer
to the RC stage.
2025-03-13 00:55:07 -04:00
Michael Klishin cf1bfa0b15
CLI: remove a non-essential flaky test 2025-03-12 19:01:55 -04:00
Michael Klishin b023062749
CLI distribution_test.exs: skip it on CI
it flakes specifically on CI. We can afford
to skip this specific test there and only
run it locally.
2025-03-12 18:33:13 -04:00
Michael Klishin 69bd5ef0e0
Merge pull request #13485 from cloudamqp/no_obs_cli_in_cli
Minor improvement: Remove observer_cli from CLI escritps
2025-03-12 15:18:13 -04:00
Michael Klishin ea5345e045
Merge pull request #13476 from rabbitmq/mgt-oauth-login-without-redirect
Improve oauth2 idp-initiated login
2025-03-12 15:16:41 -04:00
Jean-Sébastien Pédron 3a278e7e7c
rabbitmq-run.mk: Stop node in `start-background-broker` in case of error
[Why]
The CLI sometimes crashes early because it fails to configure the Erlang
distribution.

Because we use two CLI commands to watch the start of RabbitMQ, if one
of them fails, the Make recipe will exit with an error, leaving the
RabbitMQ node running.

[How]
We use a shell trap to stop the node if the shell is about to exit with
an error.

While here, we retry the `await_startup` CLI command several times
because this is the one failing the most. This is until the crash is
understood and a proper fix is committed.
2025-03-12 17:46:11 +01:00
Jean-Sébastien Pédron 0e7f92aba2
rabbit_stream_SUITE: Increase some timeouts 2025-03-12 17:46:11 +01:00
Jean-Sébastien Pédron 43916da581
logging_SUITE: Increase timetrap to 3 minutes
[Why]
We sometimes hit the 1-minute timetrap in CI even though the tests are
running fine.
2025-03-12 17:46:11 +01:00
Jean-Sébastien Pédron 28870f380c
priority_queue_recovery_SUITE: Add suffix to RabbitMQ node names
[Why]
This helps debugging.
2025-03-12 17:46:11 +01:00
Jean-Sébastien Pédron 97da746160
v5_SUITE: Close all connections in `end_per_testcase/2`
[Why]
Many tests do not clean up their connections if they encounter a
failure. This affects subsequent testcases negatively.
2025-03-12 17:46:07 +01:00
Jean-Sébastien Pédron 7c2ee95ed8
Merge pull request #13336 from rabbitmq/ignore-normal-exit-in-channel
rabbit_channel: Ignore DOWN message from monitored process if it exited normally
2025-03-12 17:44:43 +01:00
Michael Klishin 4c5dd95e5c
Merge pull request #13493 from rabbitmq/add-missing-selenium-function
Add missing selenium function
2025-03-12 12:06:04 -04:00
Mirah Gary 0fc07b93da
Merge pull request #13495 from rabbitmq/support-link
Update support link.
2025-03-12 16:52:57 +01:00
Marcial Rosales 69b54869c9 Use POST+Redirect_with_cookie 2025-03-12 16:48:02 +01:00
Mirah Gary f8ae3f1361
Update support link. 2025-03-12 16:06:51 +01:00