ontoportal / ontoportal-project

OntoPortal Alliance centralized repository for the management of the OntoPortal project
https://ontoportal.org/
3 stars 1 forks source link

Appliance ID not showing on new deployment using VirtualBox #22

Closed chris-day closed 8 months ago

chris-day commented 1 year ago

Following the instructions to obtain the Appliance ID, the Appliance ID is not shown.

To Reproduce Steps to reproduce the behaviour:

  1. Start up the virtual machine using Virtual Box on Windows
  2. Using the admin account, go to the http:////admin# page

Expected behaviour I expect to see an Appliance ID key that I can use for registration.

Screenshots

onto-portal-appliance-id-not-showing

Desktop (please complete the following information):

jonquet commented 1 year ago

Hello. Are you sure you've been looking into the "License" Tab ? You're showing us the "Site admin" tab.

In case, this is not there, I am sure @alexskr may help ;)

The rest of the instructions are here: https://ontoportal.github.io/documentation/administration/steps/registration#obtaining-and-providing-the-appliance-id

jvendetti commented 1 year ago

I believe this is a known issue, and has been logged/detailed in BioPortal's issue tracker: https://github.com/ncbo/bioportal_web_ui/issues/182. The behavior is currently reproducible in the BioPortal staging environment:

Screen Shot 2023-05-02 at 1 32 36 PM

I'll try to take a quick look at this in the next day or two.

chris-day commented 1 year ago

Hi Clement –

Here is the Licensing tab with the same issue.

This might help - when using a made up key, you get the following error when applying

onto-portal-appliance-id-not-showing

Cheers

Chris Day

c: +44 7930 909 297

s: bigchrisday

https://www.linkedin.com/in/chrisdayabinitio/ https://www.linkedin.com/in/chrisdayabinitio/

From: Clement Jonquet @.> Sent: Tuesday, May 2, 2023 9:00 PM To: ontoportal/ontoportal-project @.> Cc: Chris Day @.>; Author @.> Subject: Re: [ontoportal/ontoportal-project] Appliance ID not showing on new deployment using VirtualBox (Issue #22)

Hello. Are you sure you've been looking into the "License" Tab ? You're showing us the "Site admin" tab.

The rest of the instructions are here: https://ontoportal.github.io/documentation/administration/steps/registration#obtaining-and-providing-the-appliance-id

— Reply to this email directly, view it on GitHub https://github.com/ontoportal/ontoportal-project/issues/22#issuecomment-1532069432 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSWATHL42MKZ2QUUVVZ6STXEFRTTANCNFSM6AAAAAAXTNTRBQ . You are receiving this because you authored the thread. https://github.com/notifications/beacon/ADSWATFSPCVGEXK7XV6MDC3XEFRTTA5CNFSM6AAAAAAXTNTRBSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS3KGDDQ.gif Message ID: @. @.> >

chris-day commented 1 year ago

When applying a licence, you get a retrieval error for the Appliance ID too.

onto-portal-appliance-id-invalid-apply
syphax-bouazzouni commented 1 year ago

Hi @chris-day, happy that you use Ontoportal.

A hacky solution (meanwhile it is fixed), is to use the API endpoint/URL https://your_api_endpoint/admin/update_info?apikey=admin_api_key; replace your_api_endpoint with 192.168.l.23:8080 and admin_api_key with the API key of the user admin that can be found in the Account settings (192.168.l.23/account while been login as admin)

I hope with this you will get your appliance ID.

chris-day commented 1 year ago

Many thanks, @syphax-bouazzouni - this worked a treat and I've requested a licence now

chris-day commented 1 year ago

@syphax-bouazzouni is there another API endpoint I should call to apply my license key ? If I use the UI I get the same error in https://github.com/ontoportal/ontoportal-project/issues/22#issuecomment-1532145769

jvendetti commented 1 year ago

I'm not aware of a workaround for getting the RoR application to save the licensing information, short of manually modifying the licenses table in the database, which isn't advisable.

The VirtualApplianceIdValidator class needs to be modified, specifically at this line:

https://github.com/ncbo/bioportal_web_ui/blob/5e1b27d8170b34cebb2a75fb348ea7aeddb24073/app/validators/virtual_appliance_id_validator.rb#L20

When this code was originally developed, the admin/update_info endpoint wasn't returning 503 errors, as it is now.

syphax-bouazzouni commented 1 year ago

@syphax-bouazzouni is there another API endpoint I should call to apply my license key? If I use the UI I get the same error in #22 (comment)

@chris-day, you can do the following. But be aware that this is just a temporary and hacky solution, I'm sure @jvendetti and @alexskr will deploy a newer version of the appliance that will fix this soon.

So the steps to follow are the following:

  1. log in your virtual appliance (VirtualBox)
  2. do cd /srv/ontoportal/bioportal_web_ui/current/
  3. do bin/rails c, a console will open
  4. Write the following License.new(encrypted_key: "your_encrypted_key", ).save(:validate => false), replace you_encrypted_key with your license key
  5. write exit (or Ctrl+c to exit)
  6. sudo oprestart

Hope it works

chris-day commented 1 year ago

@syphax-bouazzouni is there another API endpoint I should call to apply my license key? If I use the UI I get the same error in #22 (comment)

@chris-day, you can do the following. But be aware that this is just a temporary and hacky solution, I'm sure @jvendetti and @alexskr will deploy a newer version of the appliance that will fix this soon.

So the steps to follow are the following:

  1. log in your virtual appliance (VirtualBox)
  2. do cd /srv/ontoportal/bioportal_web_ui/current/
  3. do bin/rails c, a console will open
  4. Write the following License.new(encrypted_key: "your_encrypted_key", ).save(:validate => false), replace you_encrypted_key with your license key
  5. write exit (or Ctrl+c to exit)
  6. sudo oprestart

Hope it works

Hi @syphax-bouazzouni - when I try step 3. I get an abend

[centos@localhost current]$ bin/rails c Traceback (most recent call last): 51: from bin/rails:4:in

' 50: from bin/rails:4:in require' 49: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/commands.rb:18:in<top (required)>' 48: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/command.rb:46:in invoke' 47: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/command/base.rb:69:inperform' 46: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor.rb:392:in dispatch' 45: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:ininvoke_command' 44: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor/command.rb:27:in run' 43: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/commands/console/console_command.rb:101:inperform' 42: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/command/actions.rb:15:in require_application_and_environment!' 41: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/command/actions.rb:28:inrequire_environment!' 40: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/application.rb:339:in require_environment!' 39: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:324:inrequire' 38: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:291:in load_dependency' 37: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:324:inblock in require' 36: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:324:in require' 35: from /srv/ontoportal/bioportal_web_ui/releases/20220602203400/config/environment.rb:5:in<top (required)>' 34: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/application.rb:363:in initialize!' 33: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/initializable.rb:60:inrun_initializers' 32: from /usr/local/rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:205:in tsort_each' 31: from /usr/local/rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:226:intsort_each' 30: from /usr/local/rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:347:in each_strongly_connected_component' 29: from /usr/local/rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:347:incall' 28: from /usr/local/rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:347:in each' 27: from /usr/local/rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:349:inblock in each_strongly_connected_component' 26: from /usr/local/rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:415:in each_strongly_connected_component_from' 25: from /usr/local/rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:415:incall' 24: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/initializable.rb:50:in tsort_each_child' 23: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/initializable.rb:50:ineach' 22: from /usr/local/rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:421:in block in each_strongly_connected_component_from' 21: from /usr/local/rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:431:ineach_strongly_connected_component_from' 20: from /usr/local/rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:422:in block (2 levels) in each_strongly_connected_component_from' 19: from /usr/local/rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:350:inblock (2 levels) in each_strongly_connected_component' 18: from /usr/local/rbenv/versions/2.7.6/lib/ruby/2.7.0/tsort.rb:228:in block in tsort_each' 17: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/initializable.rb:61:inblock in run_initializers' 16: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/initializable.rb:32:in run' 15: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/initializable.rb:32:ininstance_exec' 14: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/engine.rb:612:in block in <class:Engine>' 13: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/engine.rb:612:ineach' 12: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/engine.rb:613:in block (2 levels) in <class:Engine>' 11: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:324:inrequire' 10: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:291:in load_dependency' 9: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:324:inblock in require' 8: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:324:in require' 7: from /srv/ontoportal/bioportal_web_ui/releases/20220602203400/config/environments/development.rb:1:in<top (required)>' 6: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/railtie.rb:217:in configure' 5: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/railties-6.0.4.1/lib/rails/railtie.rb:217:ininstance_eval' 4: from /srv/ontoportal/bioportal_web_ui/releases/20220602203400/config/environments/development.rb:66:in block in <top (required)>' 3: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:324:inrequire' 2: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:291:in load_dependency' 1: from /srv/ontoportal/.bundle/ruby/2.7.0/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:324:inblock in require' /srv/ontoportal/.bundle/ruby/2.7.0/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:324:in require': no implicit conversion of Pathname into String (TypeError)

chris-day commented 1 year ago

Okay - it seems that bioportal_config_development.rb is missing. Just touched the file to move on from this. Also, this issue appeared https://github.com/puma/puma/issues/1919 and the remediation worked.

chris-day commented 1 year ago

Now get this when trying to apply the key irb(main):001:0> License.new(encrypted_key: "Eafy5sKeJ6YudJIIuy0Fe0GGMw5CCYqyEggqoHC/lC3Nt06uR3D8Rs9RWVMCrisC19kpoVkpUZALyl1UQ3r3OO8vdxxgXrNMqbUT H75q9KayLVgtbjEu7hDDiJoky5x+0IwDVmpMMkE+zfrYtY6GXZUGGQp1jgKk1Y6rw/sYArg0BFxiyP9JwfTB8rSEojhF6fFf55CvSUZudp8ffayNwavdbIIkFAwr9lr7teG+35W1lpCvsL58K BBBytbKylnDEgMDjZ/cNd/izylPP+nwqyv6q0IT+72CFMwvppwogM2dIHTFNPdTXL0hD7qe6b4E1VuP5sUr1u850EJ/o87xiQ==|oqceQ0RW/YjZIACgil221pHkgjuONndsKK/0FF3JgMtHi load_dependency active_record/association_relation/srv/ontoportal/.bundle/ruby/2.7.0/gems/mysql2-0.5.2/lib/mysql2/error.rb:55: warning: Using the last argument as keyword parameters is deprecated /srv/ontoportal/.bundle/ruby/2.7.0/gems/mysql2-0.5.2/lib/mysql2/error.rb:96: warning: Using the last argument as keyword parameters is deprecated Traceback (most recent call last): 1: from (irb):1 **ActiveRecord::NoDatabaseError (Unknown database 'bioportal_ui_dev')**

syphax-bouazzouni commented 1 year ago

Hi @chris-day,

if you do in step 3 this command RAILS_ENV=appliance bi/rails c instead, does it fix the issue?

chris-day commented 1 year ago

Hi @syphax-bouazzouni - This seemed to fix the apply of the appliance-key but broke the instance. I'm reverting to a new deployment

chris-day commented 1 year ago

Hi @syphax-bouazzouni - I've resolved this by opening up the MySQL Port and inserting the encrypted key in the licenses table.

jvendetti commented 1 year ago

I've committed fixes for the absent appliance ID on the Site Administration page, as well as the inability to save licenses. The fixes are in the BioPortal codebase (see release 6.10.4). @alexskr indicated it will likely be another couple of weeks before a new release of OntoPortal is issued that contains the fixes.

syphax-bouazzouni commented 8 months ago

I've committed fixes for the absent appliance ID on the Site Administration page, as well as the inability to save licenses. The fixes are in the BioPortal codebase (see release 6.10.4). @alexskr indicated it will likely be another couple of weeks before a new release of OntoPortal is issued that contains the fixes.

@alexskr can you close this if fixed, please

alexskr commented 8 months ago

Recently released appliance v3.2.0+ comes with v6.11.0 of the UI so it should be fixed