I have gotten poshgit to work in plain vanilla powershell with no problems. When I run a:
git pull origin master
I get the following good message:
From github.com:bmccord/WebShot * branch master ->
FETCH_HEAD Already up-to-date.
I have also set poshgit up to run form the NuGet Package Manager Console (since it is just a powershell inside of studio). However, when I run the same command, I get:
git.cmd : From github.com:bmccord/WebShot At line:1 char:4
+ git <<<< pull origin master
+ CategoryInfo : NotSpecified: (From github.com:bmccord/WebShot:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError * branch master -> FETCH_HEAD
It looks like it is working, but I also get what looks like an error.
Has anyone seen this before?
You are getting the same message, except that the Package manager console is wrapping the error ( the message that you classify as "good" message, must have been in the standard error)
Related
Failed to run Flutter Doctor in windows over corporate proxy.
I set proxy setting using below commands,
set http_proxy=USER:PWD#PROXY_URL:PORT
set https_proxy=USER:PWD#PROXY_URL:PORT
But still it gives error.
Error Code:
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine b6b54fd60631a3828c2e2c9b079b5d1d2d8c8c37...
Downloading the Dart SDK using the BITS service failed, retrying with WebRequest...
Invoke-WebRequest :
Access Denied (authentication_failed)
Your credentials could not be authenticated: "Credentials are missing.". You will not be permitted access until your
credentials can be verified.
This is typically caused by an incorrect username and/or password, but could also be caused by network problems.
At D:\RAHUL_1647164\flutter_dev\flutter\bin\internal\update_dart_sdk.ps1:68 char:5
+ Invoke-WebRequest -Uri $dartSdkUrl -OutFile $dartSdkZip
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Error: Unable to update Dart SDK. Retrying...
For the past few days, I’ve been playing around with the docker registry API and writing a small tool that scopes down its interaction with the Microsoft container registry (mcr.microsoft.com). My ultimate goal is to be able to download an image from MCR without having a direct dependency on docker pull nor any docker tool whatsoever.
Reading through the documentation of the Docker Registry API, specifically the section on how to pull a layer, it states that the URL is built as /v2/<name>/blobs/<digest>. Then, it mentions how clients should be prepared to get a redirect response from such URL.
I’ve been trying to pull image mcr.microsoft.com/windows/servercore:ltsc2019-amd64, but I don’t seem able to achieve this successfully.
From docker, this seems to be working fine:
PS C:\> docker pull mcr.microsoft.com/windows/servercore:ltsc2019-amd64 ltsc2019-amd64: Pulling from windows/servercore
65014b3c3121: Pull complete b16cfeeaf4b3: Pull complete Digest: sha256:481b0eb967cee61ce09dd81ece5effc5c327c170d11cc73c307c88a80017c9eb
Status: Downloaded newer image for mcr.microsoft.com/windows/servercore:ltsc2019-amd64
mcr.microsoft.com/windows/servercore:ltsc2019-amd64
However, I’m unable to get to the individual blobs for this image using the docker registry API directly:
PS C:\> (Invoke-RestMethod -Method Get -Uri "https://mcr.microsoft.com/v2/windows/servercore/manifests/ltsc2019-amd64").fsLayers
blobSum
-------
sha256:b16cfeeaf4b37af9fc146f7043ceb629c1bc50ace967227817e50e47f4a71529
sha256:65014b3c312172f10bd6701a063f9b5aaf9a916c2d2cb843d406a6f77ded3f8d
PS C:\> Invoke-RestMethod -Method Get -Uri "https://mcr.microsoft.com/v2/windows/servercore/blobs/sha256:b16cfeeaf4b37af9fc146f7043ceb629c1bc50ace967227817e50e47f4a71529" Invoke-RestMethod : {"errors":[{"code":"BLOB_UNKNOWN","message":"blob unknown to
registry","detail":"sha256:b16cfeeaf4b37af9fc146f7043ceb629c1bc50ace967227817e50e47f4a71529"}]}
At line:1 char:1
+ Invoke-RestMethod -Method Get -Uri "https://mcr.microsoft.com/v2/wind ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
PS C:\> Invoke-RestMethod -Method Get -Uri "https://mcr.microsoft.com/v2/windows/servercore/blobs/sha256:65014b3c312172f10bd6701a063f9b5aaf9a916c2d2cb843d406a6f77ded3f8d" Invoke-RestMethod : {"errors":[{"code":"BLOB_UNKNOWN","message":"blob unknown to
registry","detail":"sha256:65014b3c312172f10bd6701a063f9b5aaf9a916c2d2cb843d406a6f77ded3f8d"}]}
At line:1 char:1
+ Invoke-RestMethod -Method Get -Uri "https://mcr.microsoft.com/v2/wind ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
The returned error seems to be a "not found" rather than a "redirect". How is docker pull figuring out the right link from where to download the layers?
I tried reading through the docker distribution codebase, but I can’t seem to piece together the puzzle. From https://github.com/docker/distribution/blob/master/registry/storage/paths.go, there is some mention on the storage for blobs, which I believe is from where I layers download path are constructed. However, I don’t fully understand how it’s figuring out the real path since it just tries a few of them until one is valid.
What could possibly be wrong here? Am I doing something wrong? Am I missing something?
If you check the docker manifest spec, it says about the foreign layer:
https://docs.docker.com/registry/spec/manifest-v2-2/
Layers of type application/vnd.docker.image.rootfs.foreign.diff.tar.gzip may be pulled from a remote location but they should never be pushed.
This mostly applies to Windows base layers which are normally hosted separatly from outside of registry. This is currently the same for MCR. If you look at the manifest of the image, you can see layers with URLs. When server returns 404, you should follow the URLs in the manifest to download the layer blob
"layers": [
{
"mediaType": "application/vnd.docker.image.rootfs.foreign.diff.tar.gzip",
"size": 1534685324,
"digest": "sha256:65014b3c312172f10bd6701a063f9b5aaf9a916c2d2cb843d406a6f77ded3f8d",
"urls": [
"https://go.microsoft.com/fwlink/?linkid=2041275"
]
}
I am trying to push a symbol package to the nuget symbol server. The API key has been set and the regular package has uploaded just fine. However, when I try to push the symbol package it fails saying the following:
PM> nuget push .\Tanneryd.BulkInsert.1.0.1-alfa.symbols.nupkg -source https://nuget.smbsrc.net/ Pushing Tanneryd.BulkInsert.1.0.1-alfa.symbols.nupkg to the symbol server (https://nuget.smbsrc.net/)... PUT https://nuget.smbsrc.net/api/v2/package/ PUT https://nuget.smbsrc.net/api/v2/package/ PUT https://nuget.smbsrc.net/api/v2/package/ nuget : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. At line:1 char:1
+ nuget push .\Tanneryd.BulkInsert.1.0.1-alfa.symbols.nupkg -source htt ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (The underlying ...secure channel.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
The remote certificate is invalid according to the validation procedure.
It appears that https://nuget.smbsrc.net/ currently has a certificate error (e.g. expired certificate). When I go here from IE I see:
This site is not secure
This might mean that someone’s trying to fool you or steal any info you send to the server. You should close this site immediately.
Update
I was able to publish by specifying HTTP rather than secure. Example:
nuget push dist/MyPackage.1.0.0.symbols.nupkg -Source http://nuget.smbsrc.net -ApiKey [my key]
I'm using vagrant on windows 8, with the hyper-v provider starting a windows server 2012 box.
Before I updated to vagrant 1.7.4 I was on version 1.7.2, and everything worked.
But after updating I am getting an error when it is trying to mount the shared folder:
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
cmdkey /add:xxx.xxx.xxx.xxx /user:DOMAIN\user /pass:Password
Stdout from the command:
Stderr from the command:
Exception calling "RegisterTaskDefinition" with "7" argument(s): "The user
name or password is incorrect. (Exception from HRESULT: 0x8007052E)"
At C:\tmp\vagrant-elevated-shell.ps1:58 char:1
+ $folder.RegisterTaskDefinition($task_name, $task, 6, $username, $password,
1, $n ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation
I have replaced the details from the line:
cmdkey /add:xxx.xxx.xxx.xxx /user:DOMAIN\user /pass:Password
With placeholders for obvious reasons. I did try and run the command above in the VM and I get the following output:
CMDKEY: Credential added successfully.
So I assume it is working correctly. Has something changed or broken in 1.7.4?
I have figured out a fix for this.
Our password contained dollar signs ($), these were being stripped out in the vagrant-elevated-shell.ps1 script.
I have forked the vagrant repo and made the change and made a pull request - https://github.com/mitchellh/vagrant/pull/6452
To patch your local environment, you can find the communicator.rb file on your local machine at:
C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\communicators\winrm\communicator.rb
(provided you used the default setting in the installer)
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