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

Smart State Analysis Fails due to Error : Unable to mount filesystem. Reason:[wrong number of arguments (given 3, expected 0..2)] #890

Closed
Dhamo1107 opened this issue Sep 12, 2024 · 15 comments · Fixed by ManageIQ/manageiq#23194
Assignees
Labels

Comments

@Dhamo1107
Copy link

Dhamo1107 commented Sep 12, 2024

  1. When i try to run the Smart State Analysis for a VM, it shows this error:
    Unable to mount filesystem. Reason:[wrong number of arguments (given 3, expected 0..2)]

image

Log:

INFO -- evm: Q-task_id([job_dispatcher]) EVM SmartState Analysis initiated for VM [Asterisk-PBX]
Sep 12 07:17:13 cmp evm[1238650]: DEBUG -- evm: MIQ(MiqSmartProxyWorker::Runner) Garbage collection took 0.5062440359033644 seconds
Sep 12 07:17:17 cmp evm[1238607]: DEBUG -- evm: Q-task_id([job_dispatcher]) MIQ(MiqOpenStackInstance#create_evm_snapshot) instance_id=[f5aee704-d074-466e-a6d4-6a47559530d7]: No existing snapshot detected for: Asterisk-PBX
Sep 12 07:17:17 cmp evm[1238607]: DEBUG -- evm: Q-task_id([job_dispatcher]) MIQ(MiqOpenStackInstance#create_evm_snapshot) instance_id=[f5aee704-d074-466e-a6d4-6a47559530d7]: Snapshotting instance: Asterisk-PBX...
Sep 12 07:17:18 cmp evm[1238607]: DEBUG -- evm: Q-task_id([job_dispatcher]) MIQ(MiqOpenStackInstance#create_evm_snapshot) instance_id=[f5aee704-d074-466e-a6d4-6a47559530d7]: queued
Sep 12 07:17:19 cmp evm[1238682]:  WARN -- evm: MIQ(MiqScheduleWorker::Runner) Garbage collection took 7.2575560080586 seconds
Sep 12 07:17:19 cmp evm[1238667]:  WARN -- evm: MIQ(MiqRemoteConsoleWorker::Runner) Garbage collection took 14.861479406012222 seconds
Sep 12 07:17:19 cmp evm[1238708]:  WARN -- evm: MIQ(MiqWebServiceWorker::Runner) Garbage collection took 9.357563548954204 seconds
Sep 12 07:17:19 cmp evm[1236725]:  INFO -- evm: MIQ(EvmServer#monitor) Server Monitoring Complete - Timings: {:server_dequeue=>0.007155418395996094, :role_monitor=>0.002628803253173828, :worker_monitor=>2.307140588760376, :worker_dequeue=>8.20159912109375e-05, :total_time=>2.3175342082977295}
Sep 12 07:17:19 cmp evm[1238607]: DEBUG -- evm: Q-task_id([job_dispatcher]) MIQ(MiqOpenStackInstance#create_evm_snapshot) instance_id=[f5aee704-d074-466e-a6d4-6a47559530d7]: queued
Sep 12 07:17:20 cmp evm[1238522]:  INFO -- evm: MIQ(MiqQueue.get) Message id: [1000009340622], Zone: [default], Role: [ems_inventory], Server: [], MiqTask id: [], Handler id: [MiqWorker 1000000005029], Ident: [ems_1000000000030], Target id: [], Instance id: [], Task id: [], Command: [EmsRefresh.refresh], Timeout: [7200], Priority: [100], State: [dequeue], Deliver On: [], Data: [4 bytes], Args: [], Dequeued in: [7.306412063] seconds
Sep 12 07:17:20 cmp evm[1238522]:  INFO -- evm: MIQ(MiqQueue#deliver) Message id: [1000009340622], Delivering...
Sep 12 07:17:20 cmp evm[1238522]:  INFO -- evm: MIQ(ManageIQ::Providers::Openstack::CloudManager::Refresher#refresh) Refreshing all targets...
Sep 12 07:17:20 cmp evm[1238522]:  INFO -- evm: MIQ(ManageIQ::Providers::Openstack::CloudManager::Refresher#refresh) EMS: [Test Cluster], id: [1000000000030] Refreshing targets for EMS...
Sep 12 07:17:20 cmp evm[1238522]:  INFO -- evm: MIQ(ManageIQ::Providers::Openstack::CloudManager::Refresher#refresh) EMS: [Test Cluster], id: [1000000000030]   ManageIQ::Providers::Openstack::CloudManager [Test Cluster] id [1000000000030]
Sep 12 07:17:20 cmp evm[1238607]: DEBUG -- evm: Q-task_id([job_dispatcher]) MIQ(MiqOpenStackInstance#create_evm_snapshot) instance_id=[f5aee704-d074-466e-a6d4-6a47559530d7]: queued
Sep 12 07:17:20 cmp evm[1238522]:  INFO -- evm: MIQ(ManageIQ::Providers::Openstack::CloudManager::Refresher#refresh_targets_for_ems) EMS: [Test Cluster], id: [1000000000030] Refreshing target ManageIQ::Providers::Openstack::CloudManager [Test Cluster] id [1000000000030]...
Sep 12 07:17:20 cmp evm[1238522]: DEBUG -- evm: MIQ(ManageIQ::Providers::Openstack::CloudManager::Refresher#parse_targeted_inventory) EMS: [Test Cluster], id: [1000000000030] Parsing inventory...
Sep 12 07:17:20 cmp evm[1238520]:  INFO -- evm: MIQ(MiqQueue.get) Message id: [1000009340621], Zone: [default], Role: [ems_inventory], Server: [], MiqTask id: [], Handler id: [MiqWorker 1000000005027], Ident: [ems_1000000000022], Target id: [], Instance id: [], Task id: [], Command: [EmsRefresh.refresh], Timeout: [7200], Priority: [100], State: [dequeue], Deliver On: [], Data: [4 bytes], Args: [], Dequeued in: [7.534763416] seconds
Sep 12 07:17:20 cmp evm[1238520]:  INFO -- evm: MIQ(MiqQueue#deliver) Message id: [1000009340621], Delivering...
Sep 12 07:17:20 cmp evm[1238520]:  INFO -- evm: MIQ(ManageIQ::Providers::Openstack::CloudManager::Refresher#refresh) Refreshing all targets...
Sep 12 07:17:20 cmp evm[1238520]:  INFO -- evm: MIQ(ManageIQ::Providers::Openstack::CloudManager::Refresher#refresh) EMS: [Dham-Test], id: [1000000000022] Refreshing targets for EMS...
Sep 12 07:17:20 cmp evm[1238520]:  INFO -- evm: MIQ(ManageIQ::Providers::Openstack::CloudManager::Refresher#refresh) EMS: [Dham-Test], id: [1000000000022]   ManageIQ::Providers::Openstack::CloudManager [Dham-Test] id [1000000000022]
Sep 12 07:17:21 cmp evm[1238520]:  INFO -- evm: MIQ(ManageIQ::Providers::Openstack::CloudManager::Refresher#refresh_targets_for_ems) EMS: [Dham-Test], id: [1000000000022] Refreshing target ManageIQ::Providers::Openstack::CloudManager [Dham-Test] id [1000000000022]...
ERROR -- evm: Q-task_id([job_dispatcher]) MIQ(ManageIQ::Providers::Openstack::CloudManager::Vm#scan_via_miq_vm) ScanMetadata error status:[16]:  message:[Unable to mount filesystem.  Reason:[wrong number of arguments (given 3, expected 0..2)]]
Sep 12 06:55:37 cmp evm[1238640]: DEBUG -- evm: Q-task_id([job_dispatcher]) [RuntimeError]: Unable to mount filesystem.  Reason:[wrong number of arguments (given 3, expected 0..2)]  Method:[block (2 levels) in <class:LogProxy>]
Sep 12 06:55:37 cmp evm[1238640]: DEBUG -- evm: Q-task_id([job_dispatcher]) /var/www/miq/vmdb/app/models/mixins/scanning_mixin.rb:243:in scan_via_miq_vm'
                                  /opt/manageiq/manageiq-gemset/bundler/gems/manageiq-providers-openstack-c18e073b6552/app/models/manageiq/providers/openstack/cloud_manager/vm.rb:124:in perform_metadata_scan'
                                  /var/www/miq/vmdb/app/models/miq_server/server_smart_proxy.rb:95:in scan_metadata'
                                  /var/www/miq/vmdb/app/ 
@Dhamo1107 Dhamo1107 added the bug label Sep 12, 2024
@Dhamo1107
Copy link
Author

I run Smart State analysis for a instance in cloud provider (Compute -> Clouds -> Providers -> instances)

Does anyone have thoughts on this or suggestions on how to address it?

@agrare agrare self-assigned this Sep 18, 2024
@agrare
Copy link
Member

agrare commented Sep 18, 2024

@Dhamo1107 it looks like that error is coming from https://github.com/ManageIQ/manageiq-smartstate/blob/master/lib/metadata/MIQExtract/MIQExtract.rb#L71 and that last backtrace isn't the root of the problem.
Do you see any errors in the log that start with MIQExtract ? E.g. https://github.com/ManageIQ/manageiq-smartstate/blob/master/lib/metadata/MIQExtract/MIQExtract.rb#L74

You might need to enable debug logging in order for it to show up.

@Dhamo1107
Copy link
Author

Dhamo1107 commented Sep 19, 2024

Hi @agrare, This the log with MIQExtract: (https://github.com/ManageIQ/manageiq-smartstate/blob/5ddb6379aff4acb2f2ac4202ea57aa8103ead258/lib/miq_tempfile.rb)

MiqOpenStackInstance#get_image_file_glance_v2: image = Fog::OpenStack::Image::V2::Image
Sep 19 05:35:50 cmp evm[1238650]: DEBUG -- evm: Q-task_id([job_dispatcher]) MiqOpenStackInstance#download_image_data_glance_v2: iname = EvmSnapshot
Sep 19 05:35:50 cmp evm[1238650]: DEBUG -- evm: Q-task_id([job_dispatcher]) MiqOpenStackInstance#download_image_data_glance_v2: isize = 161061273600
Sep 19 05:35:50 cmp evm[1238650]: ERROR -- evm: Q-task_id([job_dispatcher]) Unable to mount filesystem.  Reason:[wrong number of arguments (given 3, expected 0..2)] for VM [bcc54dcf-3123-40e7-aa5e-b67545fefb99]
Sep 19 05:35:50 cmp evm[1238650]: ERROR -- evm: Q-task_id([job_dispatcher]) MIQExtract.new /usr/share/ruby/tempfile.rb:134:in `initialize'
Sep 19 05:35:50 cmp evm[1238650]: ERROR -- evm: Q-task_id([job_dispatcher]) MIQExtract.new /opt/manageiq/manageiq-gemset/gems/manageiq-smartstate-0.8.1/lib/miq_tempfile.rb:10:in `new'
Sep 19 05:35:50 cmp evm[1238650]: ERROR -- evm: Q-task_id([job_dispatcher]) MIQExtract.new /opt/manageiq/manageiq-gemset/gems/manageiq-smartstate-0.8.1/lib/miq_tempfile.rb:10:in `initialize'
Sep 19 05:35:50 cmp evm[1238650]: ERROR -- evm: Q-task_id([job_dispatcher]) MIQExtract.new /opt/manageiq/manageiq-gemset/gems/manageiq-smartstate-0.8.1/lib/OpenStackExtract/MiqOpenStackVm/MiqOpenStackCommon.rb:32:in `new'
Sep 19 05:35:50 cmp evm[1238650]: ERROR -- evm: Q-task_id([job_dispatcher]) MIQExtract.new /opt/manageiq/manageiq-gemset/gems/manageiq-smartstate-0.8.1/lib/OpenStackExtract/MiqOpenStackVm/MiqOpenStackCommon.rb:32:in `download_image_data_glance_v2'

@agrare
Copy link
Member

agrare commented Sep 19, 2024

Perfect thank you @Dhamo1107 I'll have a fix out in a few minutes

@Dhamo1107
Copy link
Author

@agrare And also do you have any updates regarding the issue in Host Aggregate

@agrare
Copy link
Member

agrare commented Sep 19, 2024

@Dhamo1107
Copy link
Author

@agrare now i got this error:

DEBUG -- evm: MIQ(MiqQueue.get) All 10 messages stale, returning...
Sep 19 08:34:36 cmp evm[2973717]: DEBUG -- evm: Q-task_id([job_dispatcher]) MiqOpenStackInstance#get_image_file_glance_v2: image = Fog::OpenStack::Image::V2::Image
Sep 19 08:34:36 cmp evm[2973717]: DEBUG -- evm: Q-task_id([job_dispatcher]) MiqOpenStackInstance#download_image_data_glance_v2: iname = EvmSnapshot
Sep 19 08:34:36 cmp evm[2973717]: DEBUG -- evm: Q-task_id([job_dispatcher]) MiqOpenStackInstance#download_image_data_glance_v2: isize = 107374182400
Sep 19 08:34:36 cmp evm[2973717]: ERROR -- evm: Q-task_id([job_dispatcher]) Unable to mount filesystem. Reason:[no implicit conversion of Hash into String] for VM [c318ec05-1951-49be-b09e-b61d1254709f]
Sep 19 08:34:36 cmp evm[2973717]: ERROR -- evm: Q-task_id([job_dispatcher]) MIQExtract.new /usr/share/ruby/tmpdir.rb:143:in join'
Sep 19 08:34:36 cmp evm[2973717]: ERROR -- evm: Q-task_id([job_dispatcher]) MIQExtract.new /usr/share/ruby/tmpdir.rb:143:in create'
Sep 19 08:34:36 cmp evm[2973717]: ERROR -- evm: Q-task_id([job_dispatcher]) MIQExtract.new /usr/share/ruby/tempfile.rb:139:in initialize'
Sep 19 08:34:36 cmp evm[2973717]: ERROR -- evm: Q-task_id([job_dispatcher]) MIQExtract.new /opt/manageiq/manageiq-gemset/gems/manageiq-smartstate-0.8.1/lib/miq_tempfile.rb:10:in new'
Sep 19 08:34:36 cmp evm[2973717]: ERROR -- evm: Q-task_id([job_dispatcher]) MIQExtract.new /opt/manageiq/manageiq-gemset/gems/manageiq-smartstate-0.8.1/lib/miq_tempfile.rb:10:in initialize'
Sep 19 08:34:36 cmp evm[2973717]: ERROR -- evm: Q-task_id([job_dispatcher]) MIQExtract.new /opt/manageiq/manageiq-gemset/gems/manageiq-smartstate-0.8.1/lib/OpenStackExtract/MiqOpenStackVm/MiqOpenStackCommon.rb:32:in new'
Sep 19 08:34:36 cmp evm[2973717]: ERROR -- evm: Q-task_id([job_dispatcher]) MIQExtract.new /opt/manageiq/manageiq-gemset/gems/manageiq-smartstate-0.8.1/lib/OpenStackExtract/MiqOpenStackVm/MiqOpenStackCommon.rb:32:in `download_image_data_glance_v2'

@agrare
Copy link
Member

agrare commented Sep 19, 2024

Interesting I don't get that when I run that command on my appliance, can you try the following in a rails console?

cd /var/www/miq/vmdb
rails c
MiqTempfile.new("EvmSnapshot", :encoding => 'ascii-8bit')

@Dhamo1107
Copy link
Author

@agrare I encountered an error when trying to create a new MiqTempfile instance

irb(main):001:0> MiqTempfile.new("EvmSnapshot", :encoding => 'ascii-8bit')
(irb):1:in `

': uninitialized constant MiqTempfile (NameError)
Did you mean? MIQRexml
from /opt/manageiq/manageiq-gemset/gems/railties-6.1.7.4/lib/rails/commands/console/console_command.rb:70:in start'

@agrare
Copy link
Member

agrare commented Sep 19, 2024

@Dhamo1107 okay throw a require 'miq_tempfile' before you run MiqTempfile.new then

@Dhamo1107
Copy link
Author

@agrare Restarting the server did the trick.
image

However, the EVM logs show the following for an extended period:

DEBUG -- evm: Q-task_id([job_dispatcher]) MiqOpenStackInstance#download_image_data_glance_v2: response_block: 4716220206 bytes written of
Sep 19 09:25:40 cmp evm[3043670]: DEBUG -- evm: Q-task_id([job_dispatcher]) MiqOpenStackInstance#download_image_data_glance_v2: response_block: 4716228398 bytes written of
Sep 19 09:25:40 cmp evm[3043670]: DEBUG -- evm: Q-task_id([job_dispatcher]) MiqOpenStackInstance#download_image_data_glance_v2: response_block: 4716236590 bytes written of
Sep 19 09:25:40 cmp evm[3043670]: DEBUG -- evm: Q-task_id([job_dispatcher]) MiqOpenStackInstance#download_image_data_glance_v2: response_block: 4716240686 bytes written of
Sep 19 09:25:40 cmp evm[3043670]: DEBUG -- evm: Q-task_id([job_dispatcher]) MiqOpenStackInstance#download_image_data_glance_v2: response_block: 4716248878 bytes written of
Sep 19 09:25:40 cmp evm[3043670]: DEBUG -- evm: Q-task_id([job_dispatcher]) MiqOpenStackInstance#download_image_data_glance_v2: response_block: 4716257070 bytes written of
Sep 19 09:25:40 cmp evm[3043670]: DEBUG -- evm: Q-task_id([job_dispatcher]) MiqOpenStackInstance#download_image_data_glance_v2: response_block: 4716265262 bytes written of
Sep 19 09:25:40 cmp evm[3043670]: DEBUG -- evm: Q-task_id([job_dispatcher]) MiqOpenStackInstance#download_image_data_glance_v2: response_block: 4716273454 bytes written of
Sep 19 09:25:40 cmp evm[3043670]: DEBUG -- evm: Q-task_id([job_dispatcher]) MiqOpenStackInstance#download_image_data_glance_v2: response_block: 4716277550 bytes written of

@Dhamo1107
Copy link
Author

@agrare the test failed with this error:

image

@agrare
Copy link
Member

agrare commented Sep 19, 2024

@Dhamo1107 that means your appliance disk isn't large enough to hold the disk you're trying to scan

@Dhamo1107
Copy link
Author

@agrare Could you advise on how I can run tests or perform scans under these constraints?

I also have more space available in that folder.

Size: 10G Used: 104M Avail: 9.9G Use% 2% Mounted on : /var/www/miq_tmp

@agrare
Copy link
Member

agrare commented Sep 19, 2024

@Dhamo1107 you can attach an additional disk to the appliance that is large enough to hold the disks that you need to scan, and mount that to /var/www/miq_tmp. You can use appliance_console_cli --tmpdisk /dev/newdisk to configure it.

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.

2 participants