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

CLI Environment Fixes #876

Merged
merged 10 commits into from
Mar 17, 2021
Merged

CLI Environment Fixes #876

merged 10 commits into from
Mar 17, 2021

Conversation

bishopbm1
Copy link
Contributor

@bishopbm1 bishopbm1 commented Mar 6, 2021

Fixes issue where the local encoding is not correct by adding the correct LC_ALL values to the environment.
Error:

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)

CHANGELOG.md Outdated

- Updated the environment to unclude LANG and LC_ALL vairables to fix issues with trying to run with the incorrect encoding
- Fixed issues with when managing repos the Erlang repo was not managed and the required version was not available in EPEL

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn’t be edited in a PR - it would be generated with a release (same with metadata)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah i didn't realize. I reverted the changes!

@@ -14,6 +15,17 @@
gpgcheck => 1,
}

# This is required because when using the latest version of rabbitmq because the latest version in EPEL
# for Erlang is 22.0.7 which is not compatible: https://www.rabbitmq.com/which-erlang.html
yumrepo { 'erlang':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Historically, the module is setup in such a way that Erlang configuration is out of the module’s scope. There have been some proposals to fix puppet-erlang, but I think any fix along these lines would have to be made in that module and then update that dependency here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally I would agree except this is a version of Erlang packaged and maintained by RabbitMQ https://www.rabbitmq.com/which-erlang.html#erlang-repositories so i think that it makes sense to have it in here only when managing the repos and downloading from their package cloud.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue would be if users also need a competing (but compatible) erlang version on the same machine. Also, adding this here only would be inconsistent with how the module works on other OSes / distros. However, if https://github.com/voxpupuli/puppet-erlang gets released finally, it could be made a dependency or a recommended install, and the issue could be solved that way.

Copy link
Contributor

@wyardley wyardley Mar 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current behavior, the module is also not (by default) using the official rabbitmq packages either, tho there have been some proposals to switch that to being the default.

most of them have gotten stuck on similar issues around the Erlang dependency issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add the same code for the other OS's to make it consistent, that definitely makes sense. We could also add second variable to manage this repo if you think that may be a better option?

When using RHEL 8 with out this addition made the module unusable. So I definitely think having this in here even if it is optional would be a good add. Especially since https://github.com/voxpupuli/puppet-erlang isn't released yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pretty much always been the case with this module that the user has to satisfy the Erlang dependency themself, I think. It could potentially be documented better, but IMO, it's better if that's done through a separate module vs. a parameter in this one.

Keep in mind that the module doesn't list support for RHEL 8 yet. #842 was @nmaludy's WIP working on adding support for it, which has some good discussion about these points.

I think if we
a) make the module default to using the rabbitmq package vs. OS vendor's default as the default again (as a breaking / major change; essentially toggling the value for repos_ensure)
b) get @nmaludy's puppet-erlang actually building and released and use it in the integration tests + recommend that users use it to manage erlang installation

that can work.

That said, so far, haven't seen anyone follow through with getting all this done in a way that works, passes tests, etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, could there be issues with the newer erlang if older versions of rabbitmq were chosen?

@@ -25,7 +25,7 @@ def self.append_to_path(dir)

def self.home_tmp_command(name, path)
has_command name, path do
environment HOME: '/tmp'
environment HOME: '/tmp', LANG: 'en_US.UTF-8', LC_ALL: 'en_US.UTF-8'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, this should already be set for most use cases via

rabbitmq::environment_variables:
'LC_ALL': 'en_US.UTF-8'

I'm not 100% sure that that applies to commands run in the provider, but I think it should; I know there have been some previous fixes around this error.

Since environment_variables is a parameter already, maybe the right fix here is to somehow either add HOME to defaults or merge the defaults with the environment for the CLI here?

Either way, I think the environment fix here should probably be a separate PR, as it's a narrower fix that we should be able to merge quickly, and likely affects other OSes besides RHEL.

Did you confirm that both LANG and LC_ALL were necessary? LC_ALL has worked in the past and is the somewhat narrower fix.

@bishopbm1
Copy link
Contributor Author

I made the requested changes to the variables and the erlang repo.

Copy link
Contributor

@wyardley wyardley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the PR title / commit message to clarify that it's an environment fix vs. a RHEL fix?

metadata.json Outdated
@@ -1,6 +1,6 @@
{
"name": "puppet-rabbitmq",
"version": "11.0.1-rc0",
"version": "11.0.2-rc0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be adjusted in here. it will get bumped with a release.

@bishopbm1 bishopbm1 changed the title RHEL Fixes CLI Environment Fixes Mar 16, 2021
@bishopbm1
Copy link
Contributor Author

Removed metadata tag and fix the title and message.

@wyardley wyardley merged commit 63fee2c into voxpupuli:master Mar 17, 2021
@wyardley wyardley added the bug Something isn't working label Mar 17, 2021
cegeka-jenkins pushed a commit to cegeka/puppet-rabbitmq that referenced this pull request Mar 26, 2021
Fixes issue where the local encoding is not correct by adding the correct 
LC_ALL values to the environment.
wyardley added a commit to wyardley/puppet-rabbitmq that referenced this pull request Apr 16, 2021
- Add support for oom_score_adj (voxpupuli#877)
- CLI Environment Fixes (voxpupuli#876)
- make sure the rabbitmq_version method actually returns the version (voxpupuli#874)
- Use mocked facts in tests (voxpupuli#873)
@wyardley wyardley mentioned this pull request Apr 16, 2021
wyardley added a commit to wyardley/puppet-rabbitmq that referenced this pull request Apr 16, 2021
- Add support for oom_score_adj (voxpupuli#877)
- CLI Environment Fixes (voxpupuli#876)
- make sure the rabbitmq_version method actually returns the version (voxpupuli#874)
- Use mocked facts in tests (voxpupuli#873)
- Enable Puppet 7 support (voxpupuli#881)
wyardley added a commit to wyardley/puppet-rabbitmq that referenced this pull request Apr 20, 2021
- Add support for oom_score_adj (voxpupuli#877)
- CLI Environment Fixes (voxpupuli#876)
- make sure the rabbitmq_version method actually returns the version (voxpupuli#874)
- Use mocked facts in tests (voxpupuli#873)
- Enable Puppet 7 support (voxpupuli#881)
- Add auto cluster configuration support (voxpupuli#883)
wyardley added a commit to wyardley/puppet-rabbitmq that referenced this pull request May 6, 2021
- Add support for oom_score_adj (voxpupuli#877)
- CLI Environment Fixes (voxpupuli#876)
- make sure the rabbitmq_version method actually returns the version (voxpupuli#874)
- Use mocked facts in tests (voxpupuli#873)
- Enable Puppet 7 support (voxpupuli#881)
- Add auto cluster configuration support (voxpupuli#883)
wyardley added a commit to wyardley/puppet-rabbitmq that referenced this pull request May 6, 2021
- Add support for oom_score_adj (voxpupuli#877)
- CLI Environment Fixes (voxpupuli#876)
- make sure the rabbitmq_version method actually returns the version (voxpupuli#874)
- Use mocked facts in tests (voxpupuli#873)
- Enable Puppet 7 support (voxpupuli#881)
- Add auto cluster configuration support (voxpupuli#883)
- Compatibility with camptocamp/systemd 3.x (voxpupuli#886)
wyardley added a commit to wyardley/puppet-rabbitmq that referenced this pull request May 6, 2021
- Add support for oom_score_adj (voxpupuli#877)
- CLI Environment Fixes (voxpupuli#876)
- make sure the rabbitmq_version method actually returns the version (voxpupuli#874)
- Use mocked facts in tests (voxpupuli#873)
- Enable Puppet 7 support (voxpupuli#881)
- Add auto cluster configuration support (voxpupuli#883)
- Compatibility with camptocamp/systemd 3.x (voxpupuli#886)
- puppetlabs/apt: Allow 8.x (voxpupuli#884)
- puppet/archive: Allow 5.x (voxpupuli#884)
- puppetlabs/stdlib: allow 7.x (voxpupuli#884)
@bishopbm1 bishopbm1 deleted the feature/rhel-8-fix branch July 6, 2021 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants