Skip to content

Troubleshooting

Brian Riley edited this page Apr 8, 2022 · 22 revisions

The following are a series of common issues people have encountered. Please let us know if you find solutions to other issues that may be useful to the community.

Installation

Post Installation

Shibboleth - Institutional Sign In

Installation Issues:

1) Bundler fails installing libv8

An error occurred while installing libv8 (3.11.8.17), and Bundler cannot continue.

Make sure that `gem install libv8 -v '3.11.8.17'` succeeds before bundling. 

If you are installing on a system that already has v8 installed then you may need to install the libv8 gem manually using your system's current v8 engine. If you're using homebrew to manage your packages you should run 'brew update' and 'brew upgrade' to make sure you have the latest packages

> gem uninstall -a libv8
> gem install libv8 -v '<<VERSION>>' -- --with-system-v8
> bundle install

2) Bundler fails installing json

Example:

An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.

If running the suggested gem installation fails as well, you can try to have bundler update that specific gem.

 > bundle update pg

If you run into Build Errors when installing gem json -v 1.8.3 on OSX(v10.12), make sure for the following are installed:

  • xcode-select --install [active developer directory for Xcode and BSD tools]
  • brew install coreutils

3) Bundler fails installing pg or mysql2

Example:

An error occurred while installing pg (0.19.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.19.0'` succeeds before bundling.

You must install the database you want to use before running bundler!

Follow the installation instructions for the database you prefer to use (note that you may need root access to install these dependencies on your server):

If Bundler fails on mysql2 but you're not using MySQL or it fails on pg and you're not using PostgreSQL, just comment out the corresponding gem in the Gemfile and then rerun bundler.

# ------------------------------------------------
#    DATABASE/SERVER
gem 'mysql2', '~> 0.3.18'
# gem 'pg'
gem 'flag_shih_tzu'  # Allows for bitfields in activereccord

Post Installation Issues

4) Users unable to login after migrating from DMPOnline v4

This happens when the 'pepper' key defined in config/initializers/devise.rb does not match the one on your old server. Simply update the pepper and restart the application.


5) Receiving undefined method Devise on the User model

This happens when you have not created a copy of the devise.rb.example initializer file. To correct it copy the file and update its parameters accordingly:

> cp config/initializers/devise.rb.example config/initializers/devise.rb

6) Undefined public_key for Recaptcha

NoMethodError: undefined method `public_key=' for #<Recaptcha::Configuration:0x007fb1375b8930>
/Users/briley/Documents/workspace/roadmap/config/initializers/recaptcha.rb:2:in `block in <top (required)>'
/Users/briley/Documents/workspace/roadmap/config/initializers/recaptcha.rb:1:in `<top (required)>'
/Users/briley/Documents/workspace/roadmap/config/environment.rb:9:in `<top (required)>'
Tasks: TOP => db:migrate => environment

This can happen during the upgrade/migration process from DMPOnline4 to DMPRoadmap. The recaptcha initializer is present but the gem is out of date or not configured correctly. To bypass the issue and continue with the upgrade just comment out the 3 Recaptcha config lines in the config/initializers/recaptcha.rb:

Recaptcha.configure do |config|
#  config.public_key  = 'replace_this_with_your_public_key'
#  config.private_key = 'replace_this_with_your_private_key'
#  config.proxy = 'http://someproxy.com:port'
end

7) When I run a rake or rails task it tells me I have a version conflict

rake aborted!
Gem::LoadError: You have already activated rake 12.0.0, but your Gemfile requires rake 11.3.0. Prepending `bundle exec` to your command may solve this.
/Users/name/Documents/workspace/roadmap/config/boot.rb:6:in `<top (required)>'
/Users/name/Documents/workspace/roadmap/config/application.rb:1:in `<top (required)>'
/Users/name/Documents/workspace/roadmap/Rakefile:5:in `<top (required)>'

Use the suggested advise and prepend your command with bundle exec (e.g. bundle exec rake db:migrate)


8) Some or all of my assets are missing

This sometimes happens when Webpacker gets out of sync. Try running the following command and then restart the rails server:

 > rake assets:precompile

If your assets are still missing try clearing out the public folder and JS dependencies, re-install the JS dependencies via Yarn, precompiling the assets and restarting the rails server again:

 > rm -rf public/assets
 > rm -rf public/packs
 > rm -rf node_modules
 > yarn install
 > rake assets:precompile

9) The Tinymce editors are not visible in the UI

This can be caused by several issues.

  • JS Issue: If you inspect the web page and see JS errors in the console then the error is preventing the Tinymce editors from loading properly. See the issue above about recompiling your assets. If that does not help you will need to investigate the JS issue and resolve.
  • CSS Issue: If you inspect the web page and see that the content and or skins css files are returning a 404 error then you need to copy the fiiles into your public directory cp -r [project root]/node_modules/tinymce/skins [project root]/public

10) Contents of dropdown or modal are empty

If a dropdown like the 'Research Domain' field on the Project Details page or the search results from a modal window like the Metadata Standard search/selection window are empty, then you likely have an empty table. To populate the contents of the table you should run the appropriate job in the lib/tasks/utils/external_api.rake file. For example to populate the research_domains table you should run: bin/rails external_api:add_field_of_science_to_research_domains RAILS_ENV=[your env]

Shibboleth - Institutional Login

11) I do not see an institutional login option on the home page

The institutional login option will only appear if you have an entry for it in the identifier_schemes table. If you do not have an entry for shibboleth in this table you need to add one. INSERT INTO identifier_schemes (name, description, active) VALUES ('shibboleth', 'Shibboleth', 1);

12) Shibboleth not correctly linking to user accounts

Providing instruction on Shibboleth SP installation and management is beyond the scope of the DMPRoadmap project but we have found the following troubleshooting information to be useful for those familiar with management of Shibboleth and the OAuth workflow.

Verify that your Shibboleth SP information has been correctly configured in the config/initializers/devise.rb. For example:

config.omniauth :shibboleth, {
  request_type: :header,
  uid_field: "eppn",
  info_fields: {
    email: "mail",
    name: "displayName",
    last_name: "sn",
    first_name: "givenName",
    identity_provider: "shib_identity_provider"
  },
  extra_fields: [:schacHomeOrganization],
  debug: false
}

The system will expect the shibd service to be listening on the same domain as your site https://mysite.org/Shibboleth.sso this will likely involve some setup in your web server (e.g. Apache, Nginx, etc.). Review the Shibboleth docs for your particular webserver. For example the following Apache vhost configuration will direct traffic bound for your Shibboleth SP to the shibd service.

<Location /Shibboleth.sso>
  AuthType shibboleth
  require shibboleth
  SSLRequireSSL
</Location>

<Location /users/auth/shibboleth/callback>
  AuthType shibboleth
  require shibboleth
  ShibUseHeaders On
  SSLRequireSSL
</Location>

<Location /shibtest>
   AuthType shibboleth
   ShibRequestSetting requireSession 1
   require valid-user
   # Require all granted
   ShibUseHeaders On
   SSLRequireSSL
</Location>

Any institutions that have an IdP should then have an entry in the org_identifiers table for the shibboleth identifier_schemes record. The value you store in this table should be the shibboleth entityId. Your shibd service will use the entityId to determine where to send the user for login.

Also ... Make sure your traffic is over HTTPS! Shibboleth requires this.

Its still not working!

If you are still not directed to the institution's IdP for login, then there is an issue with the above configuration and shibd is not receiving your request.

In this case check your apache/nginx logs to make sure the call to Shibboleth.sso is happening. If it is not, recheck the configuration outlined above. If it is then the issue lies somewhere within the shibd service. Check the Shibboleth SP logs for more information. You may need to increase the log level to get useful information.

If your user gets to their institutions IdP but receives an error after being redirected to your site you should recheck the configuration outlined above along with the apache/nginx, shibd and your site's log files. Failures here are often caused by a mismatch between the info_fields you have defined in the devise.rb initializer and what is actually being returned by the IdP.

If all is successful, the user should be returned to the either a page asking for their name, email, etc. (if Shibboleth did not provide them) or the Dashboard page. The user's shibboleth eppn should also be stored in the users_identifiers table. That identifier will be used by future oAuth logins.

Clone this wiki locally