Error: Failed to install provider while installing AWS provider - windows

Here's my provider block
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
}
}
}
Here's the full error message
Error while installing hashicorp/aws v4.12.1: chmod
│ .terraform/providers/registry.terraform.io/hashicorp/aws/4.12.1/linux_amd64/terraform-provider-aws_v4.12.1_x5: operation not permitted
This is my first time trying to run Terraform using WSL(Windows Subsystem for Linux) and I've never received this error before when using powershell. Couldn't find any answers or fixes online.

I had the same issue recently. WSL restart helped. Win + R →
wsl --shutdown

Related

R Markdown / Tinytex install / mirrors / AWS EC2 Windows

I use RStudio from an AWS EC2 Windows. To get .pdf file from my rmarkdown I tried to install MiKTeX on my EC2 and faced some issue, so I decided to try the tinytex solution. I correctly installed the tinytex package but I had some trouble to install tinytex from it. For your info, following security reasons only selected websites are whitelisted. So to be able to install tinytex I asked for whitelisting:
yihui. org
miktex. org
ci.appveyor. com
www.ctan. org
but I still can't get tinytex installed on my EC2 Windows. I also downloaded separetely TinyTeX.zip to install it but tinytex:::install_windows_zip() is not available anymore.
When I try tinytex::install_tinytex() I got the following error:
trying URL 'https://yihui.org/tinytex/TinyTeX-1.zip'
trying URL 'https://yihui.org/tinytex/TinyTeX-1.zip'
trying URL 'https://yihui.org/tinytex/TinyTeX-1.zip'
Error in xfun::download_file(..., quiet = Sys.getenv("APPVEYOR") != "") :
No download method works (auto/wininet/wget/curl/lynx)
In addition: Warning messages:
1: In download.file(url, output, ..., method = method) :
InternetOpenUrl failed: 'A connection with the server could not be established'
2: In download.file(url, output, ..., method = method) :
URL 'https://appveyorcidatav2.blob.core.windows.net/yihui-27038/tinytex/1-0-1628/31j2ygh3xv2sk7xd/TinyTeX-1.zip?sv=2015-12-11&sr=c&sig=HJOnYMwO2zT2iFAlwT859FH53nzIHB0oV2RslIq990g%3D&st=2021-08-05T14%3A40%3A04Z&se=2021-08-05T14%3A46%3A04Z&sp=r': status was 'SSL connect error'
3: In download.file(url, output, ..., method = method) :
InternetOpenUrl failed: 'A connection with the server could not be established'
I am not sure to understand the error message, should I ask for whitelisting another websites?
Thanks in advance for any assistance on that.
Mhd

Terraform azurerm_virtual_machine_extension error "extension operations are disallowed"

I have written a Terraform template that creates an Azure Windows VM. I need to configure the VM to Enable PowerShell Remoting for the release pipeline to be able to execute Powershell scripts. After the VM is created I can RDP to the VM and do everything I need to do to enable Powershell remoting, however, it would be ideal if I could script all of that so it could be executed in a Release pipeline. There are two things that prevent that.
The first, and the topic of this question is, that I have to run "WinRM quickconfig". I have the template working such that when I do RDP to the VM, after creation, that when I run "WinRM quickconfig" I receive the following responses:
WinRM service is already running on this machine.
WinRM is not set up to allow remote access to this machine for management.
The following changes must be made:
Configure LocalAccountTokenFilterPolicy to grant administrative rights remotely to local users.
Make these changes [y/n]?
I want to configure the VM in Terraform so LocalAccountTokenFilterPolicy is set and it becomes unnecessary to RDP to the VM to run "WinRM quickconfig". After some research it appeared I might be able to do that using the resource azure_virtual_machine_extension. I add this to my template:
resource "azurerm_virtual_machine_extension" "vmx" {
name = "hostname"
location = "${var.location}"
resource_group_name = "${var.vm-resource-group-name}"
virtual_machine_name = "${azurerm_virtual_machine.vm.name}"
publisher = "Microsoft.Azure.Extensions"
type = "CustomScript"
type_handler_version = "2.0"
settings = <<SETTINGS
{
# "commandToExecute": "powershell Set-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System' -Name 'LocalAccountTokenFilterPolicy' -Value 1 -Force"
}
SETTINGS
}
When I apply this, I get the error:
Error: compute.VirtualMachineExtensionsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="OperationNotAllowed" Message="This operation cannot be performed when extension operations are disallowed. To allow, please ensure VM Agent is installed on the VM and the osProfile.allowExtensionOperations property is true."
I couldn't find any Terraform documentation that addresses how to set the allowExtensionOperations property to true. On a whim, I tried adding the property "allow_extension_operations" to the os_profile block in the azurerm_virtual_machine resource but it is rejected as an invalid property. I also tried adding it to the os_profile_windows_config block and isn't valid there either.
I found a statement on Microsoft's documentation regarding the osProfile.allowExtensionOperations property that says:
"This may only be set to False when no extensions are present on the virtual machine."
https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.management.compute.models.osprofile.allowextensionoperations?view=azure-dotnet
This implies to me that the property is True by default but it doesn't actually say that and it certainly isn't acting like that. Is there a way in Terraform to set osProfile.alowExtensionOperations to true?
Running into the same issue adding extensions using Terraform, i created a Windows 2016 custom image,
provider "azurerm" version ="2.0.0"
Terraform 0.12.24
Terraform apply error:
compute.VirtualMachineExtensionsClient#CreateOrUpdate: Failure sending request: StatusCode=0
-- Original Error: autorest/azure: Service returned an error.
Status=<nil>
Code="OperationNotAllowed"
Message="This operation cannot be performed when extension operations are disallowed. To allow, please ensure VM Agent is installed on the VM and the osProfile.allowExtensionOperations property is true."
I ran into same error, possible solution depends on 2 things here.
You have to pass provider "azurerm" version ="2.5.0 and you have to pass os_profile_windows_config (see below) parameter in virtual machine resource as well. So, that terraform will consider the extensions that your are passing. This fixed my errors.
os_profile_windows_config {
provision_vm_agent = true
}

HBaseTestingUtility failing on Windows 10 with UnsatisfiedLinkError

I'm trying to get the HBaseTestingUtility running on Windows 10.
I'm using hbase-client and hbase-testing-util with version 1.4.2.
When running:
HBaseTestingUtility hbaseUtility = new HBaseTestingUtility();
hbaseUtility.startMiniCluster(); //<- error thrown on this line
I get the below error:
java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z
at org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Native Method)
at org.apache.hadoop.io.nativeio.NativeIO$Windows.access(NativeIO.java:609)
at org.apache.hadoop.fs.FileUtil.canWrite(FileUtil.java:996)
...
I have downloaded winutils, and have set the following user variables:
hadoop.home.dir=C:\Users\bwatson\apps\hadoop-2.8.3
HADOOP_HOME=C:\Users\bwatson\apps\hadoop-2.8.3
but this does not make a difference.
The official documentation for the HBaseTestingUtility says that Cygwin is needed on Windows, but I cannot install that due to the admin restrictions on my work machine. Is there any other solution?
After some digging, I found a solution in https://stackoverflow.com/a/43484457/729819. I %HADOOP_HOME%/bin to PATH. Now I get another error but will raise another question for that.

Install tomcat 7 on windows server 2008 using puppet ( master is ubuntu )

Has anyone installed tomcat and jdk7 packages on windows server 2008 using puppet.
puppet master is (Ubuntu)
puppet agent is (windows server 2008)
node 'puppetwindows' {
package {'jdk7 v7.0.79.1':
ensure => present,
source => 'puppet:///modules/jdk//jdk-7u79-windows-x64.exe',
path => “C:\jdk-7u79-windows-x64.exe”
install_options => ['/VERYSILENT'],
below is the output;
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could
not parse for environment production: invalid byte sequence in US-ASCII at /etc
/puppet/manifests/site.pp:1 on node puppetwindows.pramati.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Your file is using UTF-8 with BOM. Convert it to UTF-8 w/out BOM.
You should also use puppet parser validate path\to\manifest.pp so you can get an idea of whether the file contains good Puppet code and as a byproduct whether Puppet can read the file (are the encodings usable?).
I just restarted the puppet master and it worked fine.
installed chocolatey(package manager for windows same as apt-get on Ubuntu) on both Ubuntu(puppet master) windows(puppet agent)
and with the below code I was able to install tomcat successfully.
node 'puppetwindows.XXXX.com' {
package { 'tomcat':
provider => 'chocolatey',
ensure => 'latest',
}
}

Vagrant Error on Windows 10 with Hyper-V

After upgrading to windows 10 then running:
$ vagrant up
We get the following error message
An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please
report a bug.
Script: get_vm_status.ps1
Error:
C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\providers\hyperv\scripts\get_vm_status.ps1 : Unable to
find type [Microsoft.HyperV.PowerShell.VirtualizationOperationFailedException].
At line:1 char:1
+ &('C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\prov ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Hyper...FailedException:TypeName) [get_vm_status.ps1], Ru
ntimeException
+ FullyQualifiedErrorId : TypeNotFound,get_vm_status.ps1
With Vagrant 1.7.4.
Any ideas?
I had the same problem on a fresh install of Vagrant 1.7.4 on Windows 10 Enteprise (first time using Vagrant).
It looks like the type VirtualizationOperationFailedException has been replaced with VirtualizationException in the latest version of PowerShell.
I changed line 15 of C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\providers\hyperv\scripts\get_vm_status.ps1 from:
} catch [Microsoft.HyperV.PowerShell.VirtualizationOperationFailedException] {
to
} catch [Microsoft.HyperV.PowerShell.VirtualizationException] {
Now I'm able to use vagrant up and vagrant status without errors. This is obviously not a long term solution but got things working again. There may be other scripts that are broken as well but I haven't run in to them yet.
I had the same error after destroying then recreating a VM.
I removed the .vagrant/machines/hyperv folder and all went ok.
If a solution by #jeff-r doesn't work for you, you can try changing:
} catch [Microsoft.HyperV.PowerShell.VirtualizationOperationFailedException] {
to:
} catch [Exception] {
Be careful, it may also cause some side-effects.
on win 10 you must disable "Hyper-V" to run vagrant/virtualbox

Resources