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

Errno::ENOENT (No such file or directory @ rb_sysopen - .../cache/saml/metadata/Influitive-AdvocateHub) #16

Closed
heaven opened this issue Feb 18, 2015 · 7 comments · Fixed by #24
Labels

Comments

@heaven
Copy link

heaven commented Feb 18, 2015

Subj, what should be there?

Errno::ENOENT (No such file or directory @ rb_sysopen - /var/www/crm.wegohealth.com/releases/20150218112304/cache/saml/metadata/Influitive-AdvocateHub):
  config/initializers/saml_idp.rb:118:in `initialize'
  config/initializers/saml_idp.rb:118:in `open'
  config/initializers/saml_idp.rb:118:in `block (2 levels) in <top (required)>'
  lib/response_timer.rb:21:in `call'
  lib/core_ext/thread.rb:16:in `call'
  lib/core_ext/thread.rb:16:in `block in initialize'
@TJM
Copy link

TJM commented May 28, 2015

We are getting a similar error. The problem appears to be that the "metadata_persister" is not running before the "metadata_getter" runs

@jphenow
Copy link
Collaborator

jphenow commented May 28, 2015

can you provide some truncated version of the initializer? I think I'm missing something

@TJM
Copy link

TJM commented May 28, 2015

I had to change the initializer to read:

  # `identifier` is the entity_id or issuer of the Service Provider,
  # `service_provider` is a ServiceProvider object. Based on the `identifier` or the
  # `service_provider` you should return the settings.to_h from above
  config.service_provider.persisted_metadata_getter = ->(identifier, service_provider){
    fname = identifier.to_s.gsub(/\/|:/,"_")
    `mkdir -p #{Rails.root.join("cache/saml/metadata")}`
    if File.file?(Rails.root.join("cache/saml/metadata/#{fname}"))
      File.open Rails.root.join("cache/saml/metadata/#{fname}"), "rb" do |f|
        Marshal.load f
      end
    end
  }

.. so the problem was in the backtrace:

config/initializers/saml_idp.rb:174:in `initialize'
config/initializers/saml_idp.rb:174:in `open'
config/initializers/saml_idp.rb:174:in `block (2 levels) in <top (required)>'
saml_idp (0.2.0) lib/saml_idp/service_provider.rb:44:in `[]'
saml_idp (0.2.0) lib/saml_idp/service_provider.rb:44:in `get_current_or_build'
saml_idp (0.2.0) lib/saml_idp/service_provider.rb:40:in `current_metadata'
saml_idp (0.2.0) lib/saml_idp/service_provider.rb:27:in `should_validate_signature?'
saml_idp (0.2.0) lib/saml_idp/service_provider.rb:21:in `valid_signature?'
saml_idp (0.2.0) lib/saml_idp/request.rb:50:in `valid_signature?'
saml_idp (0.2.0) lib/saml_idp/request.rb:45:in `valid?'
saml_idp (0.2.0) lib/saml_idp/controller.rb:58:in `valid_saml_request?'
saml_idp (0.2.0) lib/saml_idp/controller.rb:22:in `validate_saml_request'

Which basically says that its checking to see if the metadata is current or if it needs built, so it tries the "metadata_getter" which fails cause the file doesn't exist. ;)

So, the "README" just needs updated in this case.

~tommy

@TJM
Copy link

TJM commented Jun 2, 2015

@jphenow was my comment sufficient for you to update the README (example) or should I try to submit a pull request.

@jphenow
Copy link
Collaborator

jphenow commented Jun 2, 2015

Oh cripes, my bad.

I'll take a look at your PR and we'll wrap it up there.

@jphenow
Copy link
Collaborator

jphenow commented Jun 2, 2015

Ah, derping this morning. Also not a PR.

Writing up a change to the README now

@jphenow
Copy link
Collaborator

jphenow commented Jun 2, 2015

@TJM please see #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants