-
-
Notifications
You must be signed in to change notification settings - Fork 500
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
not working with rabbitmq-server 3.7 - Cannot parse invalid user line #671
Comments
@heap98:
It's possible that dumping stderr in the rabbitmqctl command would fix this (or, more helpfully, capturing it in a different stream), but it might also obscure errors that would be helpful in debugging. |
puppet runs as user root. output of the command is below and looks fine.
doesn't fix the issue. output von locale:
|
I have a similar error. The solution for this is to use: def self.instances
user_list = run_with_retries do
rabbitmqctl('-q', 'list_users')
end
user_list = `/usr/sbin/rabbitmqctl -q list_users`
.... instead of: def self.instances
user_list = run_with_retries do
rabbitmqctl('-q', 'list_users')
end
user_list.split(%r{\n}).map do |line|
....
end So the problem arise with the mapped usage of |
Gets around this issue |
@mUbsta thanks for the advice, I'll try this. |
@mUbsta thank you very much, you have saved my life here. |
I wonder if there's a good fix to this that's clean but avoids explicitly hard coding locales / env variables. Maybe we could capture stderr from the command and only print it in the output it if the command fails? |
Thank you very much @mUbsta, this had us stumped for a couple of days! |
After adding
So, this solution removes one problem and introduces another one. The problem is in this regular expression:
|
Created a PR to resolve this ^^^ |
Hm, it looks I'm also hitting this bug with latest 8.1.0 code. Distribution is CentOS 7, but also RHEL 6.8 seems to be affected. This is the debug output around the error:
Running the command And yes, the solution proposes by @mUbsta is working |
We are seeing the same issue with Debian 8.10 and RabbitMQ 3.7.2 on Erlang 20.1 and the latest 8.1.0 code. |
Can someone post the actual |
|
I think #674 fixed the policy provider, not user I agree that fixing this with that workaround is not ideal, but I'm not sure that this module should be getting into the business of doing a more complicated fix for this (unless it's to set the locale to something sane like C or UTF-8 in the defaults?), e.g.,
in |
Can you see if #690 resolves this? |
@wyardley Doesn't seem so
|
This sets a (somewhat US-centric) default of en_US.UTF-8 for LC_ALL in $environment_variables, to work around a warning given via Elixir in newer version of the RabbitMQ CLI tools.
This is an Elixir requirement and their team seems to feel strongly about this. Configuration software that uses CLI tools can override locale environment variables for the calls that expect an output that is parsed:
Team RabbitMQ will consider forcing this in our shell scripts (rabbitmq/rabbitmq-server#1573) but IIRC this has been considered before and rejected. |
Merged a fix that forces |
Same issue again In rabbitmq-3.7.9 added a new string "user tags", that breaks output parsing
Puppet exit with error "Error: Failed to apply catalog: Cannot parse invalid user line: user tags" |
See rabbitmq/rabbitmq-cli#273 for details on how to solve this issue. |
So the issue is not resolved for new rabbitmq. |
When we use rabbitmq 3.7 we might hit the following issue when running rabbitmqctl commands inside containers (as puppet does): Error: Failed to apply catalog: Cannot parse invalid user line: warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell) This is fundamentally the tripleo version of voxpupuli/puppet-rabbitmq#671 This is a strict requirement coming from Elixir: elixir-lang/elixir#3548 Since containers do not have UTF-8 as a default we have this problem: [root@overcloud-controller-0 ~]# podman exec -it rabbitmq-bundle-podman-0 sh ()[root@overcloud-controller-0 /]$ rabbitmqctl -q list_users warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by ru nning "locale" in your shell) user tags guest [administrator] ()[root@overcloud-controller-0 /]$ locale LANG= LC_CTYPE="POSIX" LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE="POSIX" LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL= Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com> Related-Bug: #1822673 Change-Id: I21ef2e7862f3e5e21812d342b1681f8d5f7f005d
* Update puppet-tripleo from branch 'master' - Merge "Force C.UTF-8 when dealing with rabbitmq" - Force C.UTF-8 when dealing with rabbitmq When we use rabbitmq 3.7 we might hit the following issue when running rabbitmqctl commands inside containers (as puppet does): Error: Failed to apply catalog: Cannot parse invalid user line: warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell) This is fundamentally the tripleo version of voxpupuli/puppet-rabbitmq#671 This is a strict requirement coming from Elixir: elixir-lang/elixir#3548 Since containers do not have UTF-8 as a default we have this problem: [root@overcloud-controller-0 ~]# podman exec -it rabbitmq-bundle-podman-0 sh ()[root@overcloud-controller-0 /]$ rabbitmqctl -q list_users warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by ru nning "locale" in your shell) user tags guest [administrator] ()[root@overcloud-controller-0 /]$ locale LANG= LC_CTYPE="POSIX" LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE="POSIX" LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL= Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com> Related-Bug: #1822673 Change-Id: I21ef2e7862f3e5e21812d342b1681f8d5f7f005d
* Update tripleo-heat-templates from branch 'master' - Merge "Force C.UTF-8 when dealing with rabbitmq" - Force C.UTF-8 when dealing with rabbitmq When we use rabbitmq 3.7 we might hit the following issue when running rabbitmqctl commands inside containers (as puppet does): Error: Failed to apply catalog: Cannot parse invalid user line: warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell) This is fundamentally the tripleo version of voxpupuli/puppet-rabbitmq#671 This is a strict requirement coming from Elixir: elixir-lang/elixir#3548 Since containers do not have UTF-8 as a default we have this problem: [root@overcloud-controller-0 ~]# podman exec -it rabbitmq-bundle-podman-0 sh ()[root@overcloud-controller-0 /]$ rabbitmqctl -q list_users warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by ru nning "locale" in your shell) user tags guest [administrator] ()[root@overcloud-controller-0 /]$ locale LANG= LC_CTYPE="POSIX" LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE="POSIX" LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL= This is the THT version of forcing UTF-8 on all rabbitmq_init_bundles and on epmd itself. The puppet-tripleo one is the depends-on: Depends-on: I21ef2e7862f3e5e21812d342b1681f8d5f7f005d Tested on the original environment from Emilien where we saw this issue during scale-up. After appling this review and its dependency we correctly got a scaleup with rabbitm3.7 working Closes-Bug: #1822673 Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com> Change-Id: Ifc1377811de68bf14ea4aea4dfb52e22a8864d46
When we use rabbitmq 3.7 we might hit the following issue when running rabbitmqctl commands inside containers (as puppet does): Error: Failed to apply catalog: Cannot parse invalid user line: warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell) This is fundamentally the tripleo version of voxpupuli/puppet-rabbitmq#671 This is a strict requirement coming from Elixir: elixir-lang/elixir#3548 Since containers do not have UTF-8 as a default we have this problem: [root@overcloud-controller-0 ~]# podman exec -it rabbitmq-bundle-podman-0 sh ()[root@overcloud-controller-0 /]$ rabbitmqctl -q list_users warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by ru nning "locale" in your shell) user tags guest [administrator] ()[root@overcloud-controller-0 /]$ locale LANG= LC_CTYPE="POSIX" LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE="POSIX" LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL= This is the THT version of forcing UTF-8 on all rabbitmq_init_bundles and on epmd itself. The puppet-tripleo one is the depends-on: Depends-on: I21ef2e7862f3e5e21812d342b1681f8d5f7f005d Tested on the original environment from Emilien where we saw this issue during scale-up. After appling this review and its dependency we correctly got a scaleup with rabbitm3.7 working Closes-Bug: #1822673 Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com> Change-Id: Ifc1377811de68bf14ea4aea4dfb52e22a8864d46
Support policy format change in v3.7.0 - voxpupuli#671 (Replaces voxpupuli#674)
This sets a (somewhat US-centric) default of en_US.UTF-8 for LC_ALL in $environment_variables, to work around a warning given via Elixir in newer version of the RabbitMQ CLI tools.
Is this fixed? I too get same error when using in puppet.. Error - Puppet config - |
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
just run
puppet agent -t
What are you seeing
What behaviour did you expect instead
something went wrong with name encoding when the module is trying to fetch the result of the command:
/usr/sbin/rabbitmqctl -q list_users
the function itself is located in this file line 22:
./lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
Output log
Any additional information you'd like to impart
The text was updated successfully, but these errors were encountered: