Chef WebPI cookbook fails install in Azure - azure

I setup a new Win2012 VM in Azure with the Chef plugin and have it connected to manage.chef.io. Added a cookbook which uses the WebPi cookbook to install ServiceBus and its dependencies. The install fails with the following error:
“Error opening installation log file. Verify that the specified log file location exists and is writable.”
After some searching it looks like this is not new in Azure based on this 2013 blog post - https://nemetht.wordpress.com/2013/02/27/web-platform-installer-in-windows-azure-startup-tasks/
It offers a hack to disabled security on the folder temporarily but I'm looking for a better solution.
Any ideas?
More of the log output -
Started installing: 'Microsoft Windows Fabric V1 RTM'
.
Install completed (Failure): 'Microsoft Windows Fabric V1 RTM'
.
WindowsFabric_1_0_960_0 : Failed.
Error opening installation log file. Verify that the specified log file location exists and is writable.
DependencyFailed: Microsoft Windows Fabric V1 CU1
DependencyFailed: Windows Azure Pack: Service Bus 1.1
.
..
Verifying successful installation...
Microsoft Visual C++ 2012 SP1 Redistributable Package (x64) True
Microsoft Windows Fabric V1 RTM False
Log Location: C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\Web Platform Installer\logs\install\2015-05-11T14.15.51\WindowsFabric.txt
Microsoft Windows Fabric V1 CU1 False
Windows Azure Pack: Service Bus 1.1 False
Install of Products: FAILURE
STDERR:
---- End output of "WebpiCmd.exe" /Install /products:ServiceBus_1_1 /suppressreboot /accepteula /Log:c:/chef/cache/WebPI.log ----
Ran "WebpiCmd.exe" /Install /products:ServiceBus_1_1 /suppressreboot /accepteula /Log:c:/chef/cache/WebPI.log returned -1

A Chef contact (thanks Bryan!) helped me understand this issue better. Some WebPI packages do not respect the explicit log path provided to WebPIcmd.exe. The author should fix the package to use the provided log path when it is set. So the options became:
Have the author fix the package
Run Chef in a new scheduled task as a different user which has access
to the AppData folder
Edit the cookbook to perform/unperform a registry edit to temporarily move the AppData folder to a location that the System
user has access. Either in my custom cookbook or fork the WebPI
cookbook.
Obviously, waiting on the author (Microsoft in this case) to fix the package would not happen quickly.
Changing how the Azure VM runs Chef doesn't make sense considering the whole idea is to provide the configuration at the time of provisioning and it just work. Plus changing the default setup may have unintended consequences and puts us in a non-standard environment.
In the short term, I decided to alter the registry in my custom cookbook.
registry_key 'HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders' do
values [{
:name => "Local AppData",
:type => :expand_string,
:data => "%~dp0appdata"
}]
action :create
end
webpi_product 'ServiceBus_1_1' do
accept_eula true
action :install
end
webpi_product 'ServiceBus_1_1_CU1' do
accept_eula true
action :install
end
registry_key 'HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders' do
values [{
:name => "Local AppData",
:type => :expand_string,
:data => '%%USERPROFILE%%\AppData\Local'
}]
end
This change could also be done in the WebPI cookbook as well to fix this issue for all dependent cookbooks. I decided to not approach this until the WebPI team responds to a feature request for the framework to verify packages respect the log path instead.
http://forums.iis.net/t/1225061.aspx?WebPI+Feature+Request+Validate+product+package+log+path+usage
Please go and reply to this thread to try to get the team to help protect against this common package issue.

Here is the solution with POWERSHELL
I had the same error while installing "Service Fabric SDK" during VMSS VM creation. Also the system user was used.
Issue: when I was connecting with RDP with my "admin" user and run the same, it worked.
Solution: change the registry entry as above, install and reset back
here is my solution using "powershell"
I installed 2 .reg files into %TEMP% folder. The content is the old and new exported key / value for the
plugin-sf-SDK-temp.reg
Windows Registry Editor Version 5.00
[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"Local AppData"=hex(2):25,00,54,00,45,00,4d,00,50,00,25,00,00,00
plugin-sf-SDK-orig.reg
Windows Registry Editor Version 5.00
[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"Local AppData"=hex(2):25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,\
49,00,4c,00,45,00,25,00,5c,00,41,00,70,00,70,00,44,00,61,00,74,00,61,00,5c,\
00,4c,00,6f,00,63,00,61,00,6c,00,00,00
Integrate the following code into your custom-powershelgl script:
Write-Output "Reset LocalApp Folder to TEMP"
Start-Process "$($env:windir)\regedit.exe" `
-ArgumentList "/s", "$($env:TEMP)\plugin-sf-SDK-temp.reg"
## replace the following lines with your installation - here my SF SDK installation via WebWPIcmd
Write-Output "Installing /Products:MicrosoftAzure-ServiceFabric-CoreSDK"
Start-Process "$($env:programfiles)\microsoft\web platform installer\WebPICMD.exe" `
-ArgumentList '/Install', `
'/Products:"MicrosoftAzure-ServiceFabric-CoreSDK"', `
'/AcceptEULA', "/Log:$($env:TEMP)\WebPICMD-install-service-fabric-sdk.log" `
-NoNewWindow -Wait `
-RedirectStandardOutput "$($env:TEMP)\WebPICMD.log" `
-RedirectStandardError "$($env:TEMP)\WebPICMD.error.log"
Write-Output "Reset LocalApp Folder to ORIG"
Start-Process "$($env:windir)\regedit.exe" `
-ArgumentList "/s", "$($env:TEMP)\plugin-sf-SDK-orig.reg"

Related

Azure Deployment Pool Agent Fails to install IIS

Goal
I'm trying to install IIS on remote server using azure devops. I have done this on other vm servers without issue.
Problem
When running this stage the Agent Errors with very little details
Agent Errors when installing IIS
Error
2020-08-11T19:06:19.1822182Z ##[section]Starting: IIS Web App Manage
2020-08-11T19:06:19.1984662Z ==============================================================================
2020-08-11T19:06:19.1985052Z Task : IIS web app manage
2020-08-11T19:06:19.1985379Z Description : Create or update websites, web apps, virtual directories, or application pools
2020-08-11T19:06:19.1985671Z Version : 0.5.15
2020-08-11T19:06:19.1985908Z Author : Microsoft Corporation
2020-08-11T19:06:19.1986227Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/deploy/iis-web-app-management-on-machine-group
2020-08-11T19:06:19.1986625Z ==============================================================================
2020-08-11T19:06:21.2180244Z Installing IIS. This may take few minutes.
2020-08-11T19:06:46.1602426Z ##[error]The request to add or remove features on the specified server failed.
Installation of one or more roles, role services, or features failed.
The source files could not be found.
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077. Error: 0x800f081f
2020-08-11T19:06:46.1908491Z ##[section]Finishing: IIS Web App Manage
Stage Settings
steps:
- task: IISWebAppManagementOnMachineGroup#0
displayName: 'Manage IISWebsite'
inputs:
EnableIIS: true
WebsiteName: 'Default Web Site'
AddBinding: true
Bindings: '{"bindings":[{"protocol":"http","ipAddress":"All Unassigned","port":"80","hostname":"","sslThumbprint":"","sniFlag":false}]}'
CreateOrUpdateAppPoolForWebsite: true
AppPoolNameForWebsite: default
I solved this by stop trying to use the prebuilt IIS web app manage tool and ended up just installing iis via power shell command
Install-WindowsFeature -name Web-Server -IncludeManagementTools

Azure webapp deployment fails after removing Composer SiteExtension

I had Composer Site extension installed till now on azure php webapp.
I need custom deployment that can run grunt tasks also. So I created the .deployment and deploy.sh files in project root. But that deploy.sh is not being picked up.
.deployment file contents:
[config]
command = bash deploy.sh
Looking at the deployment logs, I find this
2017-05-04T06:21:03.9301086Z,Updating submodules.,8bc3029f-d77b-4c1e-860f-a3d439d7a354,0
2017-05-04T06:21:03.9926050Z,Preparing deployment for commit id 'e2b45fb52b'.,61c286b1-5c00-4c11-ae14-54e0711d6857,0
2017-05-04T06:21:04.2632947Z,Running custom deployment command...,e71c397e-bc63-4357-abc4-acd49bc2041d,0
2017-05-04T06:21:04.3101663Z,Running deployment command...,24db1c4f-8a51-463b-8c4a-ee040bc5dfd8,0
2017-05-04T06:21:04.3101663Z,Command: D:\home\SiteExtensions\ComposerExtension\Hooks\deploy.cmd,,0
2017-05-04T06:21:04.4039215Z,The system cannot find the path specified.,,1
2017-05-04T06:21:04.4195462Z,The system cannot find the path specified.\r\nD:\Program Files (x86)\SiteExtensions\Kudu\62.60430.2807\bin\Scripts\starter.cmd D:\home\SiteExtensions\ComposerExtension\Hooks\deploy.cmd,,2
Seems like somewhere the trigger for Composer site extension still remains which is being invoked during deployment.
How can I completely remove Composer site extension and use my custom deployment script deploy.sh? Thanks in advance.
Found the problem. After uninstalling Composer SiteExtension, this environment variable is still present APPSETTING_COMMAND = D:\home\SiteExtensions\ComposerExtension\Hooks\deploy.cmd. Deleted the environment variable using kudu console and then deployment succeeded.
After removing the Composer Extension the APPSETTING_COMMAND remains as an environment variable.
Use the Kudu PowerShell command Remove-Item Env:\APPSETTING_COMMAND to remove the variable online.
Alternatively, restarting the App Service via the overview tab will refresh the environment variables, though this could be a little invasive.

Without domain how to install sharepoint 2016 in windows server 2012 R2

I new in sharepoint, stuck on sharepoint installation process with out domain.My pc is in workgroup so i use the bellow script for create the db,But it's show me error.Need help how to solve this script error.
Script
New-SPConfigurationDatabase –DatabaseName SharePoint16_Config –DatabaseServer TEST_SERVER\MSSQLSERVER2014 –AdministrationContentDatabaseName SharePoint16_Content –Passphrase (ConvertTo-SecureString 786#r!5t0c## –AsPlaintext –Force) –FarmCredentials (Get-Credential) -localserverrole SingleServerFarm
Script error
What should i do? how to solve this script error?
you have to type this command :
psconfig.exe -cmd configdb -create -server sp2016-local -database SharePoint_Config -user Administrator -password YOUR password !! -passphrase P#ssw0rd -admincontentdatabase SharePoint_AdminContent -localserverrole SingleServerFarm
enter image description here
after that you should have like this :
enter image description here
and you can now Use the Start Screen of the server, type "SharePoint" to locate the SharePoint Products Wizard and launch it. The wizard detects the Farm we have just created.
enter image description here
If you have followed this tutorial carefully and named the computer as I did, the only diference between your command line and mine is the Administrator account pasword. If your server name is different you will have also to update the server name.
You can see here in the blog post that SharePoint 2016 installation on a environment with Workgroup and no Active Directory is not supported:
What’s new in SharePoint Server 2016 Installation and Deployment
Try specify username in format MachineName\UserName in your case TEST_SERVER\Administrator.

Azure storage emulator failed to initialize for Azure SDK 2.4

I was learning how to use the Microsoft Azure Tools for Visual Studio to develop an Azure cloud service at :"Getting Started with the Azure Tools for Visual Studio".
I successfully completed the following steps:
1. Install the Azure tools.
2. Create an Azure cloud service.
3rd step was build and debug the cloud service, where i was stuck.
While debugging i got an error "Failed to initialize Microsoft Azure Storage Emulator".
I did try various methods given on various websites to initialize the Storage Emulator, but none of them worked for me.
When I was trying the command WAStorageEmulator.exe init , i got an error "cannot create database".
Any help would be greatly appreciated.
Step 1 : Start your system in safe mode (Immediately after the computer is powered on or restarted tap the F8 key to enter safe mode).
Step 2 : In safe mode go the path C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator.
Step 3 : Search for WAStorageEmulator.exe - config file.
Step 4 : Edit WAStorageEmulator.exe with Notepad++ (any editor).
Step 5 : Change the port numbers as shown in the above snapshot.
(By default the port numbers will be 10000, 10001, 10002).
<services>
<service name="Blob" url="http://127.0.0.1:30000/"/>
<service name="Queue" url="http://127.0.0.1:30001/"/>
<service name="Table" url="http://127.0.0.1:30002/"/>
</services>
Step 6 : Save the file and restart your system in normal mode and run the program.
I hope this helps.
I had a similar problem and it sounds like one of the answers posted here:
This post talks about removing old mdf files so you can install again
This seems to be closer to what you are experiencing.
I hope this helps
Open MS Azure Command Prompt. Type (depending on your local db name):
SqlLocalDb stop projectv12
SqlLocalDb delete projectv12
Then go to
C:\Users(admin)\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances
and I deleted all instance in there. Then try re-install the Azure storage emulator. This worked for me.
A re-boot is not neccesary as per the accepted answer.
Open a Powershell window in admin mode.
Enter the following command: netstat -p tcp -ano | findstr :10000
That will tell you what process id is using the emulator designated port.
Use the Detail Tab in Task Manager detail to find the associated application for the process id. Often times this is something like bittorrent/utorrent.
Kill that process and you're done.
..
But if you absolutely must run the conflicting application while you develop then you can change the ports used by the emulator.
To change the ports used by the emulator, then in powershell:
chdir "C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator"
.\WAStorageEmulator stop
Then edit the config file as per the accepted answer and just save it.
C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\WAStorageEmulator.exe.config
You don't need to copy it anywhere. Then back into Powershell and :
.\WAStorageEmulator status
.\WAStorageEmulator start
Make sure you have SQL Server Express or SQL LocalDb installed. You should then be able to type
.\AzureStorageEmulator.exe init
Or, in this older case:
.\WAStorageEmulator.exe init
...and it should install the default database. Note I'm using the PowerShell syntax. If using the command prompt, it's minus the .\ portion.
It's not always a port conflict, contrary to what other posts may suggest.
You can download SQL Server Express editions here:
https://www.microsoft.com/en-us/sql-server/sql-server-editions-express
You should see something like this when you run the command:
PS C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator> .\AzureStorageEmulator.exe init
Windows Azure Storage Emulator 5.10.0.0 command line tool
Empty SQL Instance. Autodetecting SQL Instance to use.
Looking for a LocalDB Installation.
Probing SQL Instance: '(localdb)\MSSQLLocalDB'.
Caught exception while probing for SQL endpoint. Login failed for user 'somedomain\someguy'.
Number of SqlErrors Reported: 1
SqlError: System.Data.SqlClient.SqlError: Login failed for user 'somedomain\someguy'.
Could not find a LocalDB Installation.
Probing SQL Instance: 'localhost\SQLExpress'.
Found SQL Instance localhost\SQLExpress.
Creating database AzureStorageEmulatorDb510 on SQL instance 'localhost\SQLExpress'.
Granting database access to user somedomain\someguy.
Database access for user somedomain\someguy was granted.
Initialization successful. The storage emulator is now ready for use.
The storage emulator was successfully initialized and is ready to use.
PS C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>
The problem is with the “(localdb)\MSSQLLocalDB” SQL Service with Permissions.
The best option is using below commands,
Step 1: Go the path “C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator”
Step 2: Open PowerShell as Administrator,
Step 3: Run the below command in PowerShell,
“AzureStorageEmulator.exe init -server . -sqlinstance SQLEXPRESS -forcecreate”
Below is the output,
Step 4: Run the below command in PowerShell to Start Emulator,
“AzureStorageEmulator.exe start”
Below is the output,
Step 5: After that check the “SQLEXPRESS” Databases,
New Database is created.
Now you can use the Storage Emulator.

TFS Workspace and Workfold conflicting on Linux with hosted TFS (VisualStudio.com)

I'm trying to figure out how to connect to TFS and get code stored on the hosted TFS (ie - visualstudio.com) down to my linux web server.
I have installed the TFS command-line client (tf.exe)
i run the following command:
$ tf workspace -new "My - Workspace" -collection:https://me.visualstudio.com/DefaultCollection -login:user,pass
then, i list the workspaces:
$ tf workspaces
Collection: https://gotmike.visualstudio.com/DefaultCollection/
Workspace Owner Computer Comment
-------------------- ----------- ------------------ -------------
My - Workspace My Name ip-xxx-xxx-xxx-xxx
all seems good...
then, i try to run workfold...
$ tf workfold -map -login:user,pass -server:http://me.visualstudio.com -workspace:"My - Workspace" '$/My - Workspace/My - Workspace' '/home/me/test'
An argument error occurred: The workspace 'My - Workspace' could not be found.
how can it not be found if it's showing up in the list? what am i doing wrong?
The /server flag is deprecated and should not be used against recent servers (those that have "project collections", like Visual Studio Online.) Instead use the /collection flag, like you did in the first example. The workspace should then be able to be found in the specified project collection.
For example:
tf workfold -map -login:user,pass -collection:https://me.visualstudio.com/DefaultCollection -workspace:"My - Workspace" '$/My - Workspace/My - Workspace' '/home/me/test'

Resources