Subscribe

WFA ERROR [Create lunMigrate Job] Create table failed: Warning: Using a password on the command

I've got this error

 

ERROR [Create lunMigrate Job] Create table failed: Warning: Using a password on the command line interface can be insecure.
12:52:38.373 ERROR [Create lunMigrate Job] Command failed for Workflow '7toC LUN Migrate Job Baseline' with error : Create table failed: Warning: Using a password on the command line interface can be insecure.

I found a bug, 892276

 

but i was not able to resolve by changing the password either by  changing the service account

 

I use WFA 3.0.0.0.1P1

 

 

Re: WFA ERROR [Create lunMigrate Job] Create table failed: Warning: Using a password on the command

[ Edited ]

COMMITSUPPORT,

 

        I've seen this error before. I believe you are having a command where you are using the mysql.exe present in WFA/mysql/bin folder. It started to appear from WFA3.0 when WFA upgreded its MYSQL version and the new mysql version started to give this warning if password is used in the the mysql.exe cli command line. This new warning has an error code, so it appears as an error in command execution.

 

There is NO way to supress this warning from mysql side. But there is a way( actually 2 ways) to resolve this issue in WFA with minimal code change. I had resolved it for a customer, but didn't post the solution for general availability. Now I think this should be posted for everyone. 

 

Also  can you share your command code?

 

sinhaa

 

 

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: WFA ERROR [Create lunMigrate Job] Create table failed: Warning: Using a password on the command

[ Edited ]

COMITSUPPORT

 

You have reached the right bug, 892276, I've given the public report on the workaround to resolve it. But I see that l didn't mention that you would also need to change a bit of your command code.

 

The solution is about executing mysql.exe without having to provide the password in the command line. By creating a new login-path with the credentials wfa/Wfa123. Accoring modify the command code too, a bit.

 

Approach 1:

 

 

  1. Create a new mysql login-path for wfa 

  Open a cmd prompt as “Administrator” on WFA and do the following.

 

C:\Program Files\NetApp\WFA\mysql\bin>mysql_config_editor set --login-path=wfa --host=localhost --user=wfa --password

Enter password:

 

Enter Wfa123 as password.

     

 

2. Change properties of NetApp WFA Server service to start it as any Administrator account and not LocalSystem (Default).

 

NA_WFA_SRV.jpg

 

 

Once done you would need to modify your command code in the line where you are using mysql.exe

 

3. Modify your command code in the line where its using mysql.exe. Now this depends on the code. A sample is below, understand and see if you can can modify it. If you give your command code, i'll return you with the fix.

 

......

......

$pwd = Get-Location

$mysqlcmd = $pwd.Path+"\..\..\..\..\mysql\bin\mysql.exe"

$MySQLDatabase = 'playground'
$MySQLHost = "localhost"

$MySQLLoginPath = 'wfa'

$MySQLAdminUserName = 'wfa'

 

$cmd1 = "SELECT * FROM cm_storage.cluster"

 

# Attempt Command Execution via mysql.exe
$output = & "$mysqlcmd" "--login-path=$MySQLLoginPath" "--user=$MySQLAdminUserName" "--host=$MySQLHost" "-B" "-f" "-e$cmd1" "$MySQLDatabase" 2>&1

 

.......

.......

 

Approach 2:

 

Alternate way is using cmdlet Invoke-MySqlQuery to execute your SQL queries and get data. But this would mean you need to restructure your entire code as the output of this execution is a list of row objects. I would suggest this for new commands, but for existing ones, you can do approach 1.

 

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: WFA ERROR [Create lunMigrate Job] Create table failed: Warning: Using a password on the command

Yes you are right, it worked.. all fine except the Update lunMigrate Job

 

 

 

Update failed: ERROR 1045 (28000): Access denied for user 'wfa'@'localhost' (using password: NO)

 

Source code:

 

 

param (
[parameter(Mandatory=$true, HelpMessage="Destination Cluster Name")]
[string]$TargetCluster,

[parameter(Mandatory=$true, HelpMessage="Destination Vserver")]
[string]$TargetVserver,

[parameter(Mandatory=$true, HelpMessage="Destination Volume")]
[string]$TargetVolume,

[parameter(Mandatory=$false, HelpMessage="New Job State.")]
[string]$State
)

# Default credentials for playground database
$MySQLAdminUserName = 'wfa'
$MySQLAdminPassword = 'Wfa123'
$MySQLDatabase = 'playground'
$MySQLHost = "localhost"
$MySQLLoginPath = 'wfa'


Get-WFALogger -Info -message $("Obtaining MySQL location.")
# Attempt to find mysql.exe based on the wfa tmp working path, or default location if not found
$pwd = Get-Location
$mysqlcmd = $pwd.Path+"\..\..\..\..\..\mysql\bin\mysql.exe"
$mysqlcmd_found = Test-Path $mysqlcmd
if ($mysqlcmd_found -ne $true)
{
$mysqlcmd = "$($env:ProgramFiles)\NetApp\WFA\mysql\bin\mysql.exe"
}
Get-WFALogger -Info -message $("Preparing Command")

$cmd1 = "UPDATE playground.lunMigrateJob SET " +
"State='$State' "+
"WHERE TargetCluster='$TargetCluster' AND "+
"TargetVserver='$TargetVserver' AND "+
"TargetVolume='$TargetVolume'"

#$key_name + "='" + $key_value + "'"

for ($tries = 0; $tries -lt 20 ; $tries++) {
# Attempt update via mysql.exe
Get-WFALogger -Info -message $("Executing SQL: " + $cmd1)
$output = & "$mysqlcmd" "--user=$MySQLAdminUserName" "--host=$MySQLHost" "-B" "-f" "-e$cmd1" "$MySQLDatabase" 2>&1
$ret = $?
if ($ret -eq $false -and $output -match "ERROR 2013") {
Get-WFALogger -Info -message $("Got error '$output' from mysql. Sleeping for 5s and retrying")
Start-Sleep 5
continue
}
break
}

if ($ret -eq $false) {
throw $("Update failed: $output")
}

 

Re: WFA ERROR [Create lunMigrate Job] Create table failed: Warning: Using a password on the command

[ Edited ]

@

 

----

Are you sure about this Access Denied Error is coming still after making the changes I suggested. By default the DB user 'wfa' has ALL PRIVILEDGES on playground. So unless any grants modified on a table ( in your case table playground.lunMigrateJob )  this user can do any query updates.

 

I've tested with a simple UPDATE query on a playground table using a smilar construct as I suggested to you. and it works for me.

See below:

 

mysql1.jpg

 

To verify, lets keep WFA out and try if you can run UPDATE queries on this table from mysql CLI : 

 

1. Check the grants for this user

 

C:\NetApp2\WFA\mysql\bin>mysql -u wfa -p -e "show grants for wfa"
Enter password: ******
+----------------------------------------------------------------------------------------------------+
| Grants for wfa@% |
+----------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'wfa'@'%' IDENTIFIED BY PASSWORD '*BC42C719CEC89F3C2714BBE2E36725A6C49A8A73' |
| GRANT SELECT ON `oci`.* TO 'wfa'@'%' |
| GRANT SELECT ON `people2`.* TO 'wfa'@'%' |
| GRANT ALL PRIVILEGES ON `playground`.* TO 'wfa'@'%' |
| GRANT SELECT ON `dvd`.* TO 'wfa'@'%' |
| GRANT SELECT ON `hypervisor`.* TO 'wfa'@'%' |
| GRANT SELECT ON `deleteit`.* TO 'wfa'@'%' |
| GRANT SELECT ON `performance`.* TO 'wfa'@'%' |
| GRANT SELECT ON `oracle`.* TO 'wfa'@'%' |
| GRANT SELECT ON `people`.* TO 'wfa'@'%' |
| GRANT SELECT ON `vc`.* TO 'wfa'@'%' |
| GRANT SELECT ON `storage`.* TO 'wfa'@'%' |
| GRANT SELECT ON `ad`.* TO 'wfa'@'%' |
| GRANT SELECT ON `oracle_script`.* TO 'wfa'@'%' |
| GRANT SELECT ON `scheme_vserver_comment`.* TO 'wfa'@'%' |
| GRANT SELECT ON `active_directory`.* TO 'wfa'@'%' |
| GRANT SELECT ON `cm_storage`.* TO 'wfa'@'%' |
| GRANT SELECT ON `cm_performance`.* TO 'wfa'@'%' |
+----------------------------------------------------------------------------------------------------+

 

2. Run the UPDATE query from similar as above and see if that works. If you keep getting the same Access Denied error, we have zeroed down the problem.

 

3. You can also try to execute the query from the WFA cmdlet.

 

Go to WFA\bin and double-click on file ps.cmd

 It launches a Powershell console for you. Try the Update query as below:

 

Invoke-MySqlQuery -Query <your UPDATE query>

 

 

The thing is GRANT command is only available to the root user, so unless you get the root password, you can't change the GRANTS for any user.

 

Once you confirm the behaviour, we can resolve the issue.

 

sinhaa

 

 

 

 

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: WFA ERROR [Create lunMigrate Job] Create table failed: Warning: Using a password on the command

Maybe this happend because i have change the wfa password more than one time. First time i used a non default password. After reverting to the default password to Wfa123 i ve got a prompt to overwrite the WFA directory and i enter yes... I test the workflow and worked except the update. I will try the suggested workaround with the permissions and let you know

Re: WFA ERROR [Create lunMigrate Job] Create table failed: Warning: Using a password on the command

Here you are

 

 

C:\Program Files\NetApp\WFA\mysql\bin>mysql -u wfa -p -e "show grants for wfa"
Enter password: ******
+-------------------------------------------------------------------------------
---------------------+
| Grants for wfa@%
|
+-------------------------------------------------------------------------------
---------------------+
| GRANT USAGE ON *.* TO 'wfa'@'%' IDENTIFIED BY PASSWORD '*BC42C719CEC89F3C2714B
BE2E36725A6C49A8A73' |
| GRANT SELECT ON `performance`.* TO 'wfa'@'%'
|
| GRANT SELECT ON `vc`.* TO 'wfa'@'%'
|
| GRANT SELECT ON `storage`.* TO 'wfa'@'%'
|
| GRANT ALL PRIVILEGES ON `playground`.* TO 'wfa'@'%'
|
| GRANT SELECT ON `cm_storage`.* TO 'wfa'@'%'
|
| GRANT SELECT ON `cm_performance`.* TO 'wfa'@'%'
|
+-------------------------------------------------------------------------------
---------------------+

C:\Program Files\NetApp\WFA\mysql\bin>mysql --login-path=wfa --host=localhost --user=wfa -B -f -e "select * from playground.play"
ERROR 1146 (42S02) at line 1: Table 'playground.play' doesn't exist

 

C:\Program Files\NetApp\WFA\mysql\bin>mysql --login-path=wfa --host=localhost --user=wfa -B -f -e "select * from playground"
ERROR 1045 (28000): Access denied for user 'wfa'@'localhost' (using password: NO)

 

Re: WFA ERROR [Create lunMigrate Job] Create table failed: Warning: Using a password on the command

You are using an old version of the workflow that is not fully compatible with WFA 3.0. An updated version is available. Please follow private-communities/forum link in fieldportal to obtain the latest version and post any questions there.

Re: WFA ERROR [Create lunMigrate Job] Create table failed: Warning: Using a password on the command

[ Edited ]

Wrong post

Re: WFA ERROR [Create lunMigrate Job] Create table failed: Warning: Using a password on the command

ktim,COMMITSUPPORT

 

    This query has been resolved. The correct answer is my 2nd post on this thread.

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.