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

Default temporary queue name uses reserved prefix 'amq.*' on Fedora's RabbitMQ #262

Open
jlebon opened this issue Sep 22, 2023 · 1 comment
Labels

Comments

@jlebon
Copy link

jlebon commented Sep 22, 2023

Jenkins and plugins versions report

Environment
Jenkins: 2.401.1
OS: Linux - 5.14.0-284.30.1.el9_2.x86_64
Java: 11.0.19 - Red Hat, Inc. (OpenJDK 64-Bit Server VM)
---
ace-editor:1.1
ant:487.vd79d090d4ea_e
antisamy-markup-formatter:162.v0e6ec0fcfcf6
apache-httpcomponents-client-4-api:4.5.14-150.v7a_b_9d17134a_5
authentication-tokens:1.53.v1c90fd9191a_b_
basic-branch-build-strategies:1.3.2
blueocean:1.27.4
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.27.4
blueocean-commons:1.27.4
blueocean-config:1.27.4
blueocean-core-js:1.27.4
blueocean-dashboard:1.27.4
blueocean-display-url:2.4.2
blueocean-events:1.27.4
blueocean-git-pipeline:1.27.4
blueocean-github-pipeline:1.27.4
blueocean-i18n:1.27.4
blueocean-jwt:1.27.4
blueocean-personalization:1.27.4
blueocean-pipeline-api-impl:1.27.4
blueocean-pipeline-editor:1.27.4
blueocean-pipeline-scm-api:1.27.4
blueocean-rest:1.27.4
blueocean-rest-impl:1.27.4
blueocean-web:1.27.4
bootstrap5-api:5.3.0-1
bouncycastle-api:2.28
branch-api:2.1105.v472604208c55
caffeine-api:3.1.6-115.vb_8b_b_328e59d8
checks-api:2.0.0
cloudbees-bitbucket-branch-source:805.v7f97d29dc0f5
cloudbees-folder:6.815.v0dd5a_cb_40e0e
command-launcher:100.v2f6722292ee8
commons-lang3-api:3.12.0-36.vd97de6465d5b_
commons-text-api:1.10.0-36.vc008c8fcda_7b_
conditional-buildstep:1.4.2
config-file-provider:938.ve2b_8a_591c596
configuration-as-code:1647.ve39ca_b_829b_42
configuration-as-code-groovy:1.1
credentials:1254.vb_96f366e7b_a_d
credentials-binding:604.vb_64480b_c56ca_
data-tables-api:1.13.4-1
display-url-api:2.3.7
docker-commons:419.v8e3cd84ef49c
durable-task:507.v050055d0cb_dd
echarts-api:5.4.0-5
email-ext:2.97
favorite:2.4.2
font-awesome-api:6.4.0-1
generic-webhook-trigger:1.84.2
git:5.0.2
git-client:4.3.0
git-server:99.va_0826a_b_cdfa_d
github:1.37.1
github-api:1.314-431.v78d72a_3fe4c3
github-branch-source:1725.vd391eef681a_e
github-oauth:0.39
google-oauth-plugin:1.0.8
groovy:453.vcdb_a_c5c99890
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953
htmlpublisher:1.31
instance-identity:142.v04572ca_5b_265
ionicons-api:56.v1b_1c8c49374e
jackson2-api:2.15.2-350.v0c2f3f8fc595
jakarta-activation-api:2.0.1-3
jakarta-mail-api:2.0.1-3
javadoc:233.vdc1a_ec702cff
javax-activation-api:1.2.0-6
javax-mail-api:1.6.2-9
jaxb:2.3.8-1
jdk-tool:66.vd8fa_64ee91b_d
jenkins-design-language:1.27.4
jersey2-api:2.39.1-2
jira:3.10
jjwt-api:0.11.5-77.v646c772fddb_0
jms-messaging:1.1.27
job-dsl:1.84
jquery3-api:3.7.0-1
jsch:0.2.8-65.v052c39de79b_2
junit:1207.va_09d5100410f
kubernetes:3937.vd7b_82db_e347b_
kubernetes-client-api:6.4.1-215.v2ed17097a_8e9
kubernetes-credentials:0.10.0
kubernetes-credentials-provider:1.199.v4a_1d1f5d074f
lockable-resources:1156.v5e9f897ece02
mailer:457.v3f72cb_e015e5
mapdb-api:1.0.9-28.vf251ce40855d
matrix-auth:3.1.8
matrix-project:789.v57a_725b_63c79
maven-plugin:3.22
mercurial:1260.vdfb_723cdcc81
metrics:4.2.18-438.v0ede325a_4c68
mina-sshd-api-common:2.10.0-69.v28e3e36d18eb_
mina-sshd-api-core:2.10.0-69.v28e3e36d18eb_
momentjs:1.1.1
oauth-credentials:0.645.ve666a_c332668
okhttp-api:4.11.0-145.vcb_8de402ef81
openshift-client:1.1.0.413.v3023d27e8434
openshift-login:1.1.0.227.v27e08dfb_1a_20
openshift-sync:1.1.0.790.v2051fca_5ed8d
pam-auth:1.10
parameterized-trigger:2.45
pipeline-build-step:491.v1fec530da_858
pipeline-github:2.8-138.d766e30bb08b
pipeline-graph-analysis:202.va_d268e64deb_3
pipeline-groovy-lib:656.va_a_ceeb_6ffb_f7
pipeline-input-step:468.va_5db_051498a_4
pipeline-milestone-step:111.v449306f708b_7
pipeline-model-api:2.2133.ve46a_6113dfc3
pipeline-model-definition:2.2133.ve46a_6113dfc3
pipeline-model-extensions:2.2133.ve46a_6113dfc3
pipeline-rest-api:2.32
pipeline-stage-step:305.ve96d0205c1c6
pipeline-stage-tags-metadata:2.2133.ve46a_6113dfc3
pipeline-stage-view:2.32
pipeline-utility-steps:2.15.4
plain-credentials:143.v1b_df8b_d3b_e48
plugin-util-api:3.3.0
prometheus:2.2.3
pubsub-light:1.17
run-condition:1.5
scm-api:672.v64378a_b_20c60
script-security:1251.vfe552ed55f8d
slack:625.va_eeb_b_168ffb_0
snakeyaml-api:1.33-95.va_b_a_e3e47b_fa_4
splunk-devops:1.9.9
splunk-devops-extend:1.9.9
sse-gateway:1.26
ssh-credentials:305.v8f4381501156
sshd:3.303.vefc7119b_ec23
structs:324.va_f5d6774f3a_d
subversion:2.17.2
timestamper:1.20
token-macro:359.vb_cde11682e0c
trilead-api:2.84.v72119de229b_7
variant:59.vf075fe829ccb
workflow-api:1213.v646def1087f9
workflow-basic-steps:1017.vb_45b_302f0cea_
workflow-cps:3673.v5b_dd74276262
workflow-cps-global-lib:609.vd95673f149b_b
workflow-durable-task-step:1247.v7f9dfea_b_4fd0
workflow-job:1308.v58d48a_763b_31
workflow-multibranch:746.v05814d19c001
workflow-scm-step:408.v7d5b_135a_b_d49
workflow-step-api:639.v6eca_cd8c04a_a_
workflow-support:839.v35e2736cfd5c

What Operating System are you using (both controller, and any agents involved in the problem)?

Default openshift/jenkins image (RHEL8-based) on OCP 4.13.

Reproduction steps

  1. Set up the plugin for Fedora's RabbitMQ instance, connected to public endpoint. Leave queue field blank.
  2. Set up job with JMS trigger with queue field left blank.

Expected Results

The plugin can't create its queue because the name it chose contains the reserved prefix 'amq.*':

2023-09-22 17:01:54 SEVERE  com.redhat.jenkins.plugins.ci.messaging.RabbitMQMessagingWorker subscribe Eexception raised while subscribing job 'jlebon-tmp', retrying in 1 minutes.
java.io.IOException
        at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:129)
        at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:125)
        at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:147)
        at com.rabbitmq.client.impl.ChannelN.queueDeclare(ChannelN.java:968)
        at com.rabbitmq.client.impl.recovery.AutorecoveringChannel.queueDeclare(AutorecoveringChannel.java:333)
        at com.redhat.jenkins.plugins.ci.messaging.RabbitMQMessagingWorker.subscribe(RabbitMQMessagingWorker.java:85)
        at com.redhat.jenkins.plugins.ci.messaging.JMSMessagingWorker.subscribe(JMSMessagingWorker.java:49)
        at com.redhat.jenkins.plugins.ci.messaging.RabbitMQMessagingWorker.receive(RabbitMQMessagingWorker.java:159)
        at com.redhat.jenkins.plugins.ci.threads.CITriggerThread.run(CITriggerThread.java:90)
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=403, reply-text=ACCESS_REFUSED - queue name 'amq.gen-ZAVSaGe4XPv84jWbO7upYQ' contains reserved prefix 'amq.*', class-id=50, method-id=10)
        at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66)
        at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
        at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:502)
        at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:293)
        at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:141)
        ... 6 more
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=403, reply-text=ACCESS_REFUSED - queue name 'amq.gen-ZAVSaGe4XPv84jWbO7upYQ' contains reserved prefix 'amq.*', class-id=50, method-id=10)
        at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:522)
        at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:346)
        at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:182)
        at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:114)
        at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:672)
        at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:48)
        at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:599)
        at java.base/java.lang.Thread.run(Thread.java:829)

Actual Results

The temporary queue name chosen Just Works.

Anything else?

This isn't hard to work around (just come up with a valid queue name), but it adds friction (e.g. it means unnecessarily hardcoding random queue names).

According to the Fedora Messaging docs, the queue name should be a UUID: https://github.com/fedora-infra/fedora-messaging/blob/8163f0bcb290c751b04794e19479c48616e92eb1/configs/fedora.toml#L28

@jlebon jlebon added the bug label Sep 22, 2023
@jlebon
Copy link
Author

jlebon commented Sep 22, 2023

To clarify, though the RabbitMQ support isn't designed to exclusively support Fedora's broker, if any random queue name is valid then it seems harmless to use a UUID to conform to Fedora's requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant