cloud_controller_ng icon indicating copy to clipboard operation
cloud_controller_ng copied to clipboard

[Codespaces Error] Codespace opening in recovery environment

Open vipinvkmenon opened this issue 1 year ago • 2 comments

Thanks for submitting an issue to cloud_controller_ng. We are always trying to improve! To help us, please fill out the following template.

Issue

When trying to open the repo in codespaces, we get the error that codespaces opened in recovery mode.

Context

When we try to open the repo in codespaces, we get the following Pop-Up Message: This codespace is currently running in recovery mode due to a configuration error. Please review the creation logs, update your dev container configuration as needed, and run the "Rebuild Container" command to rectify. ``` `` A dump of the container logsis also provided. (Attached) From the look of it the error seems to be coming from rakeargument error`:

2024-02-23 16:37:35.861Z: Post-install message from codeclimate-test-reporter:

  Code Climate's codeclimate-test-reporter gem has been deprecated in favor of
  our language-agnostic unified test reporter. The new test reporter is faster,
  distributed as a static binary so dependency conflicts never occur, and
  supports parallelized CI builds & multi-language CI configurations.

  Please visit https://docs.codeclimate.com/v1.0/docs/configuring-test-coverage
  for help setting up your CI process with our new test reporter.
  Post-install message from rubyzip:
RubyZip 3.0 is coming!
**********************

The public API of some Rubyzip classes has been modernized to use named
parameters for optional arguments. Please check your usage of the
following classes:
  * `Zip::File`
  * `Zip::Entry`
  * `Zip::InputStream`
  * `Zip::OutputStream`

Please ensure that your Gemfiles and .gemspecs are suitably restrictive
to avoid an unexpected breakage when 3.0 is released (e.g. ~> 2.3.0).
See ********/rubyzip/rubyzip for details. The Changelog also
lists other enhancements and bugfixes that have been implemented since
version 2.3.0.
2024-02-23 16:37:37.542Z: rake aborted!
rake aborted!
2024-02-23 16:37:37.545Z: ArgumentError: wrong number of arguments (given 3, expected 1..2) (ArgumentError)

  EMAIL_REGEXP_WHOLE = Regexp.new("\\A#{ADDR_SPEC}\\z", nil, 'n')
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ArgumentError: wrong number of arguments (given 3, expected 1..2) (ArgumentError)

  EMAIL_REGEXP_WHOLE = Regexp.new("\\A#{ADDR_SPEC}\\z", nil, 'n')

And another during (CREATE DATABASE?):

(See full trace by running task with --trace)
2024-02-23 16:37:37.997Z: CREATE DATABASE
2024-02-23 16:37:39.223Z: rake aborted!
2024-02-23 16:37:39.225Z: ArgumentError: wrong number of arguments (given 3, expected 1..2) (ArgumentError)

  EMAIL_REGEXP_WHOLE = Regexp.new("\\A#{ADDR_SPEC}\\z", nil, 'n')
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-23 16:37:39.228Z: /usr/local/rvm/gems/default/gems/rfc822-0.1.5/lib/rfc822.rb:16:in `initialize'
/usr/local/rvm/gems/default/gems/rfc822-0.1.5/lib/rfc822.rb:16:in `new'
/usr/local/rvm/gems/default/gems/rfc822-0.1.5/lib/rfc822.rb:16:in `<module:RFC822>'
/usr/local/rvm/gems/default/gems/rfc822-0.1.5/lib/rfc822.rb:1:in `<top (required)>'
<internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/workspace/lib/vcap/rest_api/message.rb:2:in `<top (required)>'
<internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/workspace/lib/vcap/rest_api.rb:4:in `<top (required)>'
<internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/workspace/lib/sinatra/vcap.rb:1:in `<top (required)>'
<internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2024-02-23 16:37:39.231Z: <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/workspace/lib/cloud_controller.rb:13:in `<top (required)>'
<internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/workspace/Rakefile:13:in `<top (required)>'

Steps to Reproduce

Open master in codespaces.

Expected result

Codespaces opens up as expected and rake runs without failures

Current result

rake fails causing the container creation to fail/start

[include relevant logs] container-error-dump.log

vipinvkmenon avatar Feb 23 '24 17:02 vipinvkmenon

I haven't really used codespaces in for cloud controller, but wanted to point out that error is what you get if you try to run cloud controller with ruby 3.3 instead of ruby 3.2. I can see in the logs you shared it is using ruby 3.3 so whatever needs to happen in codespaces it should use ruby 3.2 for now until https://github.com/cloudfoundry/cloud_controller_ng/issues/3559 is resolved

moleske avatar Feb 23 '24 23:02 moleske

The ruby version in the devcontainer image was not pinned to 3.2 and therefore used the latest ruby version 3.3. I fixed it with https://github.com/cloudfoundry/cloud_controller_ng/commit/e8ac7e01f828e9f247b9dbed07a3a7ae3ca2225d @vipinvkmenon Please try again

johha avatar Feb 26 '24 11:02 johha

@vipinvkmenon is this working for you now? I'm going to close this issue, but if it's still broken please let us know.

tcdowney avatar May 07 '24 16:05 tcdowney