cloudfoundry / cf-uaac

Apache License 2.0
41 stars 29 forks source link

json_pure 2.7.4 breaks uaac #136

Closed MiliDurasovic closed 3 weeks ago

MiliDurasovic commented 1 month ago

Since json_pure version 2.7.4 I receive the following error while setting the target:

uaac --skip-ssl-validation  target https://uaa."${api}" -t
...
wrong number of arguments (given 2, expected 1)

Afterwards .uaac.yml is simply empty:

# cat ~/.uaac.yml
--- {}

After rolling back to json_pure version 2.7.2, uaac works again without any issues.

Maybe consider strictly pinning to json_pure 2.7.2 until the issue has been identified and resolved?

CFMCGEE commented 4 weeks ago

I'm experiencing this exact issue starting today...

Which version of CF-MGMT are you using @MiliDurasovic?

jensdaseking commented 4 weeks ago

Our workaround:

gem install cf-uaac
gem uninstall json_pure --all --force
gem install json_pure --version 2.7.2
MiliDurasovic commented 4 weeks ago

@CFMCGEE I´m not using cf-mgmt and I don´t think it matters for this issue.


@jensdaseking We applied this workaround also in our docker images.

gem install cf-uaac
gem uninstall json_pure -aIx
gem install json_pure -v 2.7.2
strehle commented 4 weeks ago

hi,

for now you can use the workaround. there are multiple json libraries in use which cause the problem, e.g. https://github.com/ruby/json/issues/646

Will cleanup here but first in https://github.com/cloudfoundry/cf-uaa-lib/pull/95

CFMCGEE commented 4 weeks ago

@MiliDurasovic - Apologizes, I meant UAAC CLI. I'll try the work around provided. Thanks for raising this issue!

strehle commented 4 weeks ago

@MiliDurasovic heads up: please check if with https://github.com/ruby/json/releases/tag/v2.7.5 the issue is fixed ? because changelog seems to show this.

However there will be a cleanup and only one json library will be initialized in future

MiliDurasovic commented 4 weeks ago

@strehle Thank you. I can confirm that the issue is gone for me with https://github.com/ruby/json/releases/tag/v2.7.5 .

CFMCGEE commented 4 weeks ago

@strehle Thanks! Works for me now as well.

MiliDurasovic commented 3 weeks ago

@strehle Since tonight we suddenly receive another error:

+ uaac --skip-ssl-validation target https://uaa."${api}"

<internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- multi_json (LoadError)

    from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'

    from /var/lib/gems/3.0.0/gems/cf-uaac-4.21.0/lib/uaa/stub/server.rb:19:in `<top (required)>'

    from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'

    from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'

    from /var/lib/gems/3.0.0/gems/cf-uaac-4.21.0/lib/uaa/cli/token.rb:17:in `<top (required)>'

    from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'

    from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'

    from /var/lib/gems/3.0.0/gems/cf-uaac-4.21.0/lib/uaa/cli/runner.rb:15:in `<top (required)>'

    from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'

Looks like the removal of multi_json is the cause: https://github.com/cloudfoundry/cf-uaa-lib/pull/95

strehle commented 3 weeks ago

see https://github.com/cloudfoundry/cf-uaa-lib/releases/tag/v4.0.6

Sorry for breaking it. Will do replacement in several steps, but we want remove this library and replace it with json / json_pure only