source parameter not specified cake - azure

using azure devops to build a pipeline. pipeline uses cake scripts to build and publish. facing issue with publish package. below is the diagnostic of publish of nu get step.
2019-09-16T10:00:32.8150943Z NuGet
2019-09-16T10:00:32.8151140Z ========================================
2019-09-16T10:00:32.8151688Z Executing task: NuGet
2019-09-16T10:00:32.8195231Z PushNuGet
2019-09-16T10:00:32.8283167Z Pushing NuGet file C:/__w/2/a/build/A.SDK.TestLibrary/nuget/A.TestLibrary.SDK.1.4.2-abranch-15524.nupkg
2019-09-16T10:00:32.8331210Z No Source property has been set. Depending on your configuration, this may cause problems.
2019-09-16T10:00:32.8620102Z Executing: "C:/__w/2/a/build/tools/NuGet.exe" push "C:/__w/2/a/build/A.SDK.TestLibrary/nuget/A.TestLibrary.SDK.1.4.2-abranch-15524.nupkg" -NonInteractive
2019-09-16T10:00:33.3578097Z Source parameter was not specified.
2019-09-16T10:00:33.3864258Z An error occurred when executing task 'NuGet'.
2019-09-16T10:00:33.3996249Z Error: System.AggregateException: One or more errors occurred. ---> Cake.Core.CakeException: NuGet: Process returned an error (exit code 1).

source parameter not specified cake
Just like the error message shows,
Source parameter was not specified
And your nuget command line is:
"C:/__w/2/a/build/tools/NuGet.exe" push "C:/__w/2/a/build/A.SDK.TestLibrary/nuget/A.TestLibrary.SDK.1.4.2-abranch-15524.nupkg"
Indeed, it does not specify the source of the push command.
To resolve this issue, you should specify the source in that command:
nuget.exe push "YourPackageHere" -source "xxxx"
Check the document push command (NuGet CLI) for some more details.
Hope this helps.

Related

GenerateEFSQLScripts fails when trying to publish to IIS using Web Deploy from TeamCity

Running into a total dead-end here.
I've created a Publish Profile for a .net6 application that we want to publish to IIS with Web Deploy. In the Entity Framework Migration section, the option to "Apply this migration on publish" is selected.
When manually clicking publish, everything works. However, we want to automate this in TeamCity using the .NET build runner. The publish step fails at:
Generating Entity Framework SQL Scripts...
Executing command: dotnet ef migrations script --no-build --idempotent --configuration Release --output "C:\TeamCity\buildAgent\work\cbf95cc2b4413601\MySolution.Api\obj\Release\net6.0\PubTmp\EFSQLScripts\MySolution.Data.MyContext.sql" --context MySolution.Data.MyContext
C:\Program Files\dotnet\sdk\6.0.400\Sdks\Microsoft.NET.Sdk.Publish\targets\TransformTargets\Microsoft.NET.Sdk.Publish.TransformFiles.targets(221,5): error : Entity Framework SQL Script generation failed
Internal error message details: BuildMessage1 0 Text DefaultMessage ERROR 400682522803500 tags:'tc:parseServiceMessagesInside'
Error message is logged
Build FAILED.
I cannot find any specific error messages anywhere in any log. Looking in the Microsoft.NET.Sdk.Publish.TransformFiles.targets file shows that it's failing on GenerateEFSQLScripts - an MSBuild command that executes dotnet ef under the covers.
I thought this might be a case of dotnet ef not being installed on the build agent. But when I manually run the command myself from C:\TeamCity\buildAgent\work\cbf95cc2b4413601\MySolution.Api, it succeeds, and the SQL scripts are successfully created.
I also thought it might just be a case of the command being run in the wrong directory (i.e. in the root MySolution folder rather than the MySolution.Api folder), but explicitly setting the working directly fails at the same point, with the same error.
Has anyone seen this before? Or could point me to where an actual error might be located?

What means Range error on my Release pipelines?

When the release pipeline run end up with this error
RangeError [ERR_INVALID_OPT_VALUE]: The value "4294967295" is invalid for option "size".
I don't know what means this error
task failed
Log of the task failed when release run
Same issue for me using Web Deploy to a nodejs app service.
Web Deploy worked at first, until we added some packages in our package.json (e.g. "#fortawesome/free-brands-svg-icons")
Then our release pipeline suddenly outputs "64-bit = +" in the deployment log.
If we remove the packages, the "64-bit = +" is gone, and our Web Deploy works again.
Image of log from Release pipeline
Not sure how to resolve it, but in our case we used Zip Deploy instead like #Ari Gunawan recommended.
I had the same issue when trying to deploy a node app to Azure App Service from release pipeline. Not sure what the error means as there are no further details about it but I resolved it by using "Zip Deploy" deployment method and "Continue on error"

How to configure package-file path for Azure release pipeline?

I was following this article from Microsoft to use Azure pipeline for build and release. Reached upto this section and confused about the following code:
az batch application package create --application-id $(batchApplicationId)
--name $(batchAccountName)
--resource-group $(resourceGroupName)
--version $(batchApplicationVersion)
--package-file=$(System.DefaultWorkingDirectory)/$(Release.Artifacts.{YourBuildArtifactSourceAlias}.BuildId).zip
I have configured the following in pipeline variables:
batchApplicationId
batchAccountName
resourceGroupName
batchApplicationVersion
The only thing remaning is configuring the package-file
As far as I understand, I just have to replace YourBuildArtifactSourceAlias with my artifact source alias, and I have done that. But when deploying the release pipeline, I get the following error:
.zip was unexpected at this time.
##[error]Script failed with exit code: 255
As we can see in this screenshot, the only failing part of this whole process is when uploading the package to the application created, which is the final step.
Can someone help me with this?

Unable to restore NuGet Package: "Failed to find api location for area: nuget id: 9D3A4E8E"

I am unable to publish new packages to (or restore packages from) my own NuGet Feed in Azure DevOps . It started a few days ago and, since I have created a brand new feed (out of curiosity). Still, it fails with the same error:
Failed to find api location for area: nuget id:
9D3A4E8E-2F8F-4AE1-ABC2-B461A51CB3B3
2019-05-27T22:09:46.8693807Z ##[section]Starting: dotnet push (Common)
2019-05-27T22:09:46.8802338Z ==============================================================================
2019-05-27T22:09:46.8802573Z Task : .NET Core
2019-05-27T22:09:46.8802607Z Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command. For package commands, supports NuGet.org and authenticated feeds like Package Management and MyGet.
2019-05-27T22:09:46.8802660Z Version : 2.151.1
2019-05-27T22:09:46.8802692Z Author : Microsoft Corporation
2019-05-27T22:09:46.8802724Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2019-05-27T22:09:46.8802931Z ==============================================================================
2019-05-27T22:09:47.4837790Z [command]C:\windows\system32\chcp.com 65001
2019-05-27T22:09:47.4924880Z Active code page: 65001
2019-05-27T22:09:47.4964761Z SYSTEMVSSCONNECTION exists true
2019-05-27T22:09:47.5770818Z SYSTEMVSSCONNECTION exists true
2019-05-27T22:09:50.7225430Z SYSTEMVSSCONNECTION exists true
2019-05-27T22:09:50.7673768Z ##[warning]Can\'t find loc string for key: Warning_SessionCreationFailed
2019-05-27T22:09:50.7683040Z ##[warning]Warning_SessionCreationFailed {}
2019-05-27T22:09:52.3193091Z ##[error]Error: Error: Failed to find api location for area: nuget id: 9D3A4E8E-2F8F-4AE1-ABC2-B461A51CB3B3
2019-05-27T22:09:52.3194182Z ##[error]Packages failed to publish
2019-05-27T22:09:52.3294148Z ##[section]Finishing: dotnet push (Common)
How can I fix this error?
Unable to restore NuGet Package: “Failed to find api location for area: nuget id: 9D3A4E8E”
The reason for the above error is a wrong specification of the URL of the service to use.
So, to resolve this issue, please try to double check if the source of nuget feed is correct.
If the source of nuget feed is correct and this issue is also occurred on the other nuget feed(which is worked before.), you can try to delete the brand new feed, then check if this issue is resolved.
If this issue only occurred on the brand new feed, please try to check if your feed configured correctly and check if the agent has any proxy setting.
Check the ticket VSTS - Cannot Push Nuget Package to VSTS Package Feed from Private Agent Behind Web Proxy
Hope this helps.

VSTS - Build a Docker Image

I have a .NET Core repo in VSTS. I'm trying to create a Build pipeline that builds a Docker image and adds it to my Azure Container Registry. My Build pipeline has a Docker task. This task has the "Build an image" action selected. This action relies on my Dockerfile, which looks like this:
FROM microsoft/dotnet:2.1.2-runtime-nanoserver-1803
# Install .NET Core
ENV DOTNET_VERSION 2.1.2
When my Build pipeline runs, I get an error that says:
failed to register layer: re-exec error: exit status 1: output: ProcessUtilityVMImage \\?\C:\ProgramData\docker\windowsfilter\82aba535faccd8bf0e5ce3c122247672fa671214000a12c5481972212c5e2ca0\UtilityVM: The system cannot find the path specified.
##[error]C:\Program Files\Docker\docker.exe failed with return code: 1
Why am I getting this error? How do I fix it?
It should be the same issue with this one : https://github.com/Microsoft/vsts-tasks/issues/6510
Seems it still have some issues with nanoserver-1803
Just try to setup and host a custom agent on Azure VM, then check it again.
https://github.com/Microsoft/vsts-tasks/issues/6510#issuecomment-370152300
I found maybe an explication about this error: VSTS agents seem not
support nanoserver-1709 actually. Maybe this will change with the next
version 1803.
See details here: Microsoft/vsts-agent#1393
When I setup and host a custom agent on a machine on Azure, it's
working. So it's not a bug with this task. I close this issue. Thanks!

Resources