mattmcspirit / azurestack

Azure Stack Resources
80 stars 41 forks source link

Didn't find the Scripts folder located with your AzSPoC.ps1 file #114

Closed cdr34 closed 4 years ago

cdr34 commented 4 years ago

Describe the issue VERBOSE: Importing cmdlet 'Set-AzureRmResource'. VERBOSE: Importing cmdlet 'New-AzureRmResource'. VERBOSE: Importing cmdlet 'Set-AzureRmResourceLock'. VERBOSE: Importing cmdlet 'Get-AzureRmResource'. [12:11 AM]::[CONNECTING]:: Didn't find the Scripts folder located with your AzSPoC.ps1 file. If this is a rerun, ensure your AzSPoC.ps1 file is located in the same location as the first run, for example, if your AzSPoC.ps1 file is located at C:\AzSPoC\AzSPoC.ps1, you should find the Scripts folder located at C:\AzSPoC\Scripts. Moving your AzSPoC.ps1 file to another folder for a rerun will likely cause the script to fail, unless you also move your Scripts folder..Exception.Message

Mode : Process ContextDirectory : ContextFile : CacheDirectory : CacheFile : Settings : {}

GetScripts : Complete CheckPowerShell : Complete InstallPowerShell : Complete DownloadTools : Complete CheckCerts : Skipped HostConfiguration : Complete Registration : Skipped AdminPlanOffer : Complete UbuntuServerImage : Incomplete WindowsUpdates : Incomplete ServerCore2016Image : Incomplete ServerFull2016Image : Incomplete ServerCore2019Image : Incomplete ServerFull2019Image : Incomplete

Hardware [ 00:24:23 ] Checking for physical/virtual machine status... [ 00:24:23 ] -- This is a physical machine. [ 00:24:23 ] Checking system disk capacity... [ 00:24:23 ] -- Check system disk passed successfully. [ 00:24:23 ] Checking physical disks... [ 00:24:23 ] -- Listing of all physical disks on this server: [ 00:24:24 ] -- Check physical disks passed successfully. Note that ASDK handles situations where there is a pre-existing storage pool, and will delete/recreate it. [ 00:24:24 ] Checking Memory... [ 00:24:24 ] -- Memory on this server = 256 [ 00:24:24 ] -- System memory check passed successfully. ASDK requires a minimum of 96 GB of RAM, with 128 GB recommended. [ 00:24:24 ] Checking processor information... [ 00:24:26 ] -- Number of CPU sockets = 2 [ 00:24:26 ] -- Number of physical cores = 16 [ 00:24:26 ] -- CPU socket count (2) and core count (12) meet the minimum requirements for ASDK.

Send the logs Emailed

mattmcspirit commented 4 years ago

Hi Corey,

Thanks for this, and sharing your logs.

Could you please walk me through each time you've run this script? From the logs, it appears that you may have run the script once, from say C:\AzSPoC\AzsPoC.ps1, something happened, you moved/deleted the original folder, and then you've rerun again, either from a recreated C:\AzsPoC folder, or somewhere else?

When AzSPoC.ps1 runs, it looks for a folder in the same directory, called Scripts. The first time it runs, the script will create the Scripts folder, download a number of PS1 files from GitHub, store them in this folder, and use them through the process. As you can see in your post above:

GetScripts : Complete CheckPowerShell : Complete InstallPowerShell : Complete DownloadTools : Complete CheckCerts : Skipped HostConfiguration : Complete Registration : Skipped

This stage (GetScripts) was successful, so on subsequent re-runs of the script, it assumes it doesn't need to re-download the scripts from GitHub.

If you've deleted the Scripts folder, or have moved AzSPoC.ps1 to run somewhere else, it won't know where the Scripts folder is, and as it stands, it won't re-download them as that stage is 'Complete' as shown above.

If that's the case, and you want the script to recreate the Scripts folder, and re-download the PS1 files, you could do this, from an ISE (as Administrator)

Import-Module SQLServer
$sqlServerInstance = '(localdb)\MSSQLLocalDB'
$databaseName = "AzSPoC"
$tableName = "Progress"
$progressStage = "GetScripts"

Read-SqlTableData -ServerInstance $sqlServerInstance -DatabaseName "$databaseName" -SchemaName "dbo" -TableName "$tableName" -ErrorAction SilentlyContinue | Out-String
Invoke-Sqlcmd -Server $sqlServerInstance -Query "USE $databaseName UPDATE Progress SET $progressStage = 'Incomplete';" -Verbose:$false -ErrorAction Stop
Read-SqlTableData -ServerInstance $sqlServerInstance -DatabaseName "$databaseName" -SchemaName "dbo" -TableName "$tableName" -ErrorAction SilentlyContinue | Out-String

You should find that the progress table is reset for that particular stage and next time you run the script, it should re-try that specific step.

Hope that helps, Matt

cdr34 commented 4 years ago

Hi Matt,

the first time I ran the script, it complained about a Ubuntu Image (after a few other attempts; same Ubuntu error). I deleted all directories and started over the following day. This is when it complained about there not being a Scripts directory ( then I manually created the directory ) and then it complained about the first .ps1 Script not being in the Scripts directory.

I then deleted all of the folders and rechecked the GitHub site to see if there had been recent changes that may fix the issue.

I have been running it each day in hopes of getting by this error (After day 3 I decided to contact you). I have been running the Configurator since June 2019 and they have been really great. This has been the first small hiccup.

The script you provided to recreate the Scripts folder fixed the issue.

Thanks!

Corey


From: Matt McSpirit notifications@github.com Sent: Tuesday, December 10, 2019 8:26 PM To: mattmcspirit/azurestack azurestack@noreply.github.com Cc: cdr34 coreyrivers@outlook.com; Author author@noreply.github.com Subject: Re: [mattmcspirit/azurestack] Didn't find the Scripts folder located with your AzSPoC.ps1 file (#114)

Hi Corey,

Thanks for this, and sharing your logs.

Could you please walk me through each time you've run this script? From the logs, it appears that you may have run the script once, from say C:\AzSPoC\AzsPoC.ps1, something happened, you moved/deleted the original folder, and then you've rerun again, either from a recreated C:\AzsPoC folder, or somewhere else?

When AzSPoC.ps1 runs, it looks for a folder in the same directory, called Scripts. The first time it runs, the script will create the Scripts folder, download a number of PS1 files from GitHub, store them in this folder, and use them through the process. As you can see in your post above:

GetScripts : Complete CheckPowerShell : Complete InstallPowerShell : Complete DownloadTools : Complete CheckCerts : Skipped HostConfiguration : Complete Registration : Skipped

This stage (GetScripts) was successful, so on subsequent re-runs of the script, it assumes it doesn't need to re-download the scripts from GitHub.

If you've deleted the Scripts folder, or have moved AzSPoC.ps1 to run somewhere else, it won't know where the Scripts folder is, and as it stands, it won't re-download them as that stage is 'Complete' as shown above.

If that's the case, and you want the script to recreate the Scripts folder, and re-download the PS1 files, you could do this, from an ISE (as Administrator)

Import-Module SQLServer $sqlServerInstance = '(localdb)\MSSQLLocalDB' $databaseName = "AzSPoC" $tableName = "Progress" $progressStage = "GetScripts"

Read-SqlTableData -ServerInstance $sqlServerInstance -DatabaseName "$databaseName" -SchemaName "dbo" -TableName "$tableName" -ErrorAction SilentlyContinue | Out-String Invoke-Sqlcmd -Server $sqlServerInstance -Query "USE $databaseName UPDATE Progress SET $progressStage = 'Incomplete';" -Verbose:$false -ErrorAction Stop Read-SqlTableData -ServerInstance $sqlServerInstance -DatabaseName "$databaseName" -SchemaName "dbo" -TableName "$tableName" -ErrorAction SilentlyContinue | Out-String

You should find that the progress table is reset for that particular stage and next time you run the script, it should re-try that specific step.

Hope that helps, Matt

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mattmcspirit/azurestack/issues/114?email_source=notifications&email_token=AKZTJWRSOBZL7COCIOQDR7DQYA6V5A5CNFSM4JZG3GJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGRRHNI#issuecomment-564335541, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKZTJWRYNWVU3VHST4YU6CLQYA6V5ANCNFSM4JZG3GJQ.