envchain icon indicating copy to clipboard operation
envchain copied to clipboard

envchain --list reports include dupe

Open JammalGerardo opened this issue 2 years ago • 12 comments

Background

I am using envchain from a while ago, but recently I am experiencing issues with the namespaces. The AWS_ACCESS_KEY_ID , AWS_SECRET_ACCESS_KEY secrets are not getting updated on both namespaces (nonprod and prod), the problem is that when I check for the available namespaces I am seeing duplications: Note: Namespaces 'test', 'nonprod1' and 'prod1' I set them for testing purposes.

$envchain --list                                                                                                                                               ok | 14:32:03
prod
nonprod
prod1
nonprod
prod1
prod
nonprod
nonprod1
prod
nonprod1
prod
test
prod1

Problem

I already tried a couple things:

  1. Uninstalling envchain to have a clean installation and set the namespaces again, but it keeps carrying the old and bad namespaces.

brew uninstall envchain

As well, I checked for any residual files but nothing is prompting.

brew list envchain                                           ok | 14:52:10
Error: No such keg: /usr/local/Cellar/envchain

And there is no configuration in the shell in my '.zshrc' related to envchain.

 ~  brew uninstall envchain                                                                  ok | 15:03:50

Error: No such keg: /usr/local/Cellar/envchain
 ~  brew install envchain                                                                 1 err | 15:04:01

==> Downloading https://formulae.brew.sh/api/formula.jws.json
##################################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
##################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/envchain/manifests/1.0.1
Already downloaded: /Users/gerardojammal/Library/Caches/Homebrew/downloads/5b1f306f33edaf81010971e94a0fab349073eb178d43d3fb3d32097ae9010a96--envchain-1.0.1.bottle_manifest.json
==> Fetching envchain
==> Downloading https://ghcr.io/v2/homebrew/core/envchain/blobs/sha256:747395bd5b5f304844923251c84df54fb23e5
Already downloaded: /Users/gerardojammal/Library/Caches/Homebrew/downloads/002013d2304cbfc4311081ed3e1bef12813a2e3739ce327af5e311f6c911328c--envchain--1.0.1.ventura.bottle.tar.gz
==> Pouring envchain--1.0.1.ventura.bottle.tar.gz
🍺  /usr/local/Cellar/envchain/1.0.1: 5 files, 42.7KB
==> Running `brew cleanup envchain`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
 ~  envchain --list                                                                     ok | 5s | 15:04:12
test
prod
nonprod1
prod
nonprod1
prod
prod1
nonprod
prod1
nonprod
prod1
nonprod
prod1
prod
  1. Tried to upgrade to the latest version in order to use --unset option but seem like the version available for Homebrew is not getting the latest release that includes that option.

Any help is more than welcome =D

Thanks!

JammalGerardo avatar Sep 14 '23 20:09 JammalGerardo

I have the same issue.

kromiii avatar Oct 07 '23 23:10 kromiii

Hmm, it might be related to the recent Ventura release? Can you confirm that the issue has been started to occur after upgrade?

sorah avatar Oct 08 '23 00:10 sorah

Yes, this issue occurred after upgrading.

% brew upgrade envchain
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 3 taps (bakks/bakks, homebrew/core and homebrew/cask).
==> New Formulae
[email protected]                    python-setuptools          [email protected]
[email protected]           [email protected]
==> New Casks
devtunnel

You have 27 outdated formulae and 1 outdated cask installed.

Warning: envchain 1.0.1 already installed
[9:48:15] 
% envchain --list
personal
personal
emulation
personal

My Mac Version is Monterey, not Ventura.

% sw_vers
ProductName:	macOS
ProductVersion:	12.6.2
BuildVersion:	21G320

kromiii avatar Oct 08 '23 00:10 kromiii

Because the project is not affiliated with Homebrew so I don't want to give support for Homebrew-provided binary.

To distinguish the cause of precompiled binary, can you try reproducing the issue by brew install --build-from-source? Also, I need xcodebuild -version to investigate.

sorah avatar Oct 08 '23 01:10 sorah

Thanks for your instruction. --build-from-source seems not to be supported for this library and the results were the same.

% brew reinstall --build-from-source envchain
Warning: building from source is not supported!
You're on your own. Failures are expected so don't create any issues, please!
==> Fetching envchain
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/a49dba6
######################################################################### 100.0%
==> Downloading https://github.com/sorah/envchain/archive/v1.0.1.tar.gz
==> Downloading from https://codeload.github.com/sorah/envchain/tar.gz/refs/tags
#=#=#                                                                          
==> Reinstalling envchain 
==> make DESTDIR=/opt/homebrew/Cellar/envchain/1.0.1 install
🍺  /opt/homebrew/Cellar/envchain/1.0.1: 5 files, 43.2KB, built in 2 seconds
==> Running `brew cleanup envchain`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
% envchain --list
personal
emulation
personal
personal

However, XCode is not installed in my laptop, and I need to upgrade OS to install XCode. I will report the results after the upgrade.

kromiii avatar Oct 08 '23 02:10 kromiii

seems not to be supported for this library

The warning message says Homebrew does not provide support for non-prebuilt binaries, not build-from-source option is not supported for the formulae

sorah avatar Oct 08 '23 02:10 sorah

However, XCode is not installed in my laptop, and I need to upgrade OS to install XCode.

xcodebuild should be available if you have CLI tools installed (you should have as you have Homebrew), xcodebuild -version should report version information - isn't it available?

sorah avatar Oct 08 '23 02:10 sorah

Thank you for the comments. Finannly, I could check the xcodebuild version.

% xcodebuild -version
Xcode 15.0
Build version 15A240d

Plus, I noticed that the namespace duplication occurs randomly even if I used the same command; I could see no duplicate in the first try, but duplicate appeared in the second try.

[23:00:02] ~
% envchain --list
emulation
personal
[23:00:03] ~
% envchain --list
personal
emulation
personal

As I upgraded to the Mac OS version to 14.0, this may be caused by the new OS specifications.

kromiii avatar Oct 08 '23 14:10 kromiii

Finally, I tried the installation from the source code. https://github.com/sorah/envchain#from-source

It resolved my problem completely. Everything seems to work fine.

% envchain --list
emulation
personal
[23:15:47] ~
% envchain --list
emulation
personal

kromiii avatar Oct 08 '23 14:10 kromiii

@JammalGerardo @kromiii I think this is an issue on Homebrew prebuilt binary, please report to Homebrew if you'd want to keep using Homebrew for envchain: https://docs.brew.sh/Troubleshooting

sorah avatar Oct 11 '23 17:10 sorah

oops, appearently this is a dupe of https://github.com/sorah/envchain/issues/24 - I'll proceed to release the new version 😫 sorry

sorah avatar Oct 11 '23 17:10 sorah

Oh, I didn't notice. Thank you for your resolving the issue.

kromiii avatar Oct 13 '23 00:10 kromiii