Closed eacharya closed 7 years ago
Error around Messaging::Connections::GenericClient
. This looks like a load sequence issue.
In azvm3
ubuntu@azvm3:~/rasbari/engines/messaging$ irb
2.2.1 :001 > Dir["lib/messaging/**/*.rb"]
=> ["lib/messaging/connections/generic_server.rb", "lib/messaging/connections/generic_client.rb", "lib/messaging/connections/clients/storage_client.rb", "lib/messaging/connections/cache.rb", "lib/messaging/connections/bunny_connection.rb", "lib/messaging/connections/rpc_client.rb", "lib/messaging/connections/rpc_server.rb", "lib/messaging/states/video_capture/capture_states.rb", "lib/messaging/states/storage/file_operation_types.rb", "lib/messaging/states/samosa/clip_eval_states.rb", "lib/messaging/states/samosa/chia_states.rb", "lib/messaging/states/samosa/khajuri_states.rb", "lib/messaging/states/samosa/operation_types.rb", "lib/messaging/messages/header_types.rb", "lib/messaging/messages/video_capture/capture_details.rb", "lib/messaging/messages/video_capture/clip_details.rb", "lib/messaging/messages/video_capture/state_transition.rb", "lib/messaging/messages/video_capture/vnc_server_start.rb", "lib/messaging/messages/video_capture/state_query.rb", "lib/messaging/messages/base_message.rb", "lib/messaging/messages/storage/file_operations.rb", "lib/messaging/messages/storage/client_details.rb", "lib/messaging/messages/header.rb", "lib/messaging/messages/base_non_persisted.rb", "lib/messaging/messages/message_factory.rb", "lib/messaging/messages/samosa/clip_details.rb", "lib/messaging/messages/samosa/khajuri_state_query.rb", "lib/messaging/messages/samosa/chia_details.rb", "lib/messaging/messages/samosa/khajuri_details.rb", "lib/messaging/messages/samosa/chia_state_query.rb", "lib/messaging/messages/samosa/clip_eval_details.rb", "lib/messaging/messages/general/none.rb", "lib/messaging/messages/header_states.rb", "lib/messaging/version.rb", "lib/messaging/base_libs/mlogger.rb", "lib/messaging/base_libs/ordered_options.rb", "lib/messaging/base_libs/deep_symbolize.rb", "lib/messaging/non_rails/monkeypatch.rb", "lib/messaging/config/reader.rb", "lib/messaging/engine.rb"]
In az3:
ubuntu@az3:~/rasbari/engines/messaging$ irb
2.3.3 :001 > Dir["lib/messaging/**/*.rb"]
=> ["lib/messaging/config/reader.rb", "lib/messaging/non_rails/monkeypatch.rb", "lib/messaging/base_libs/deep_symbolize.rb", "lib/messaging/base_libs/ordered_options.rb", "lib/messaging/base_libs/mlogger.rb", "lib/messaging/states/samosa/chia_states.rb", "lib/messaging/states/samosa/khajuri_states.rb", "lib/messaging/states/samosa/clip_eval_states.rb", "lib/messaging/states/samosa/operation_types.rb", "lib/messaging/states/video_capture/capture_states.rb", "lib/messaging/states/storage/file_operation_types.rb", "lib/messaging/messages/base_message.rb", "lib/messaging/messages/header_types.rb", "lib/messaging/messages/base_non_persisted.rb", "lib/messaging/messages/message_factory.rb", "lib/messaging/messages/general/none.rb", "lib/messaging/messages/samosa/chia_details.rb", "lib/messaging/messages/samosa/clip_eval_details.rb", "lib/messaging/messages/samosa/clip_details.rb", "lib/messaging/messages/samosa/khajuri_state_query.rb", "lib/messaging/messages/samosa/chia_state_query.rb", "lib/messaging/messages/samosa/khajuri_details.rb", "lib/messaging/messages/header_states.rb", "lib/messaging/messages/video_capture/state_transition.rb", "lib/messaging/messages/video_capture/capture_details.rb", "lib/messaging/messages/video_capture/clip_details.rb", "lib/messaging/messages/video_capture/state_query.rb", "lib/messaging/messages/video_capture/vnc_server_start.rb", "lib/messaging/messages/header.rb", "lib/messaging/messages/storage/client_details.rb", "lib/messaging/messages/storage/file_operations.rb", "lib/messaging/version.rb", "lib/messaging/connections/generic_server.rb", "lib/messaging/connections/clients/storage_client.rb", "lib/messaging/connections/rpc_client.rb", "lib/messaging/connections/generic_client.rb", "lib/messaging/connections/rpc_server.rb", "lib/messaging/connections/cache.rb", "lib/messaging/connections/bunny_connection.rb", "lib/messaging/engine.rb"]
2.3.3 :002 > exit
The solution is to do a breadth first directory glob. If this works in the messaging engine, similar hack will also need to be done for other engines to future proof. Relevant portion in the messaging engine that needs update: https://github.com/zigvu/rasbari/blob/development/engines/messaging/lib/messaging.rb#L22
The correction in load order fixes the ruby error.
To restore the database, follow the rake task here: https://github.com/zigvu/rasbari/blob/development/lib/tasks/backup_database.rake#L30
Note that the newer version of mysql does NOT allow non-password access to root user. Hence, L42 in the above file fails. It might be a good idea to fix that using the branch for this issue. Also, we can store the password in the ~/.profile file as an environment variable to be loaded at runtime. An example of using the environment variable for secret stuff can be found in: https://github.com/zigvu/rasbari/blob/development/config/secrets.yml#L22
@eacharya There still seem to be lots of issues with the installation.
Rails still not working properly though it does not complain at the startup. It is not able to find the foundation module.
For rasbari_servers, it does not run till irb shell.
Following non-committed changes need to happen in the system running rasbari:
In ~/.bash_profile
, add the following to end of file:
export RAILS_RASBARI_MYSQL_PWD="<what pwd is>"
Merged to development:
issue 11: Read database password from environment - https://github.com/zigvu/rasbari/commit/8c28273fac18445dc7caafb1c97f07286c3348da Issue-11: Passing password for mysql user using parameter/environment - https://github.com/zigvu/rasbari/commit/8ba57e44d02bb642ab9bfaf32fcaa438b0f32a47 Issue-11: Logic to compare directory/files moved to messagin.rb instead; This also takes care of Issue-6 (module dependency issue) in nimki for storage server - https://github.com/zigvu/rasbari/commit/9aa0cc43c91378ae5b2fe3e9d46580286aff5c54 Issue-11: Rasbari Installation: Files loaded by depth of the directory and dictionrary order; Files at higher directory are loaded first; Required to prevent loading files from lower level directory, which are depended upon the higher level once, so that module dependency requirement are fulfilled during loading - https://github.com/zigvu/rasbari/commit/e9733d9334ab552f2fbd62ba5b9459b2fda9d9fd
This issue deals with all code change necessary in rasbari to enable installation/usage in 16.04. We have eliminated both ruby and rails version differences as being the culprit.
In the comment section of this issue, we'll list the bugs, potential causes and solution.