I have a TFS Build definition using the default template. The build completes on it's own but when I include a post deployment script I get the following error.
Exception Message: The directory name is invalid (type Win32Exception)
Exception Stack Trace:
Server stack trace:
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at Microsoft.TeamFoundation.Build.Workflow.Activities.InvokeProcess.ProcessWrapper. Start()
at Microsoft.TeamFoundation.Build.Workflow.Activities.InvokeProcess.InvokeProcessIn ternal.RunCommand(AsyncState state)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
at System.Func`2.EndInvoke(IAsyncResult result)
at System.Activities.AsyncCodeActivity`1.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncC odeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
The script itself is a powershell script that is included in the solution I'm trying to build and it only calls write-host messages. (for testing at this point)
The build definition has all the defaults selected with only the solution, post build arguments and post build script path changed. The script is checked into source control in the solution.
This is a POC environment so I have everything installed on the one server, so the TFS Server and Build Agents are on the same machine.
I've tried several workaround for this but none of them seem to be rooted around this particular error. Any help is much appreciated, thanks.
(Coming from someone who recently encountered this issue themselves)
Check your "Source Settings" in the build definition.
Make sure you haven't cloaked the path to your script. That is, if you have your script in utilities/configuration, make sure you haven't cloaked utilities/
Your Build Agent folder should not use $(BuildDir), it should use $(SourceDir). Bear in mind this might change some paths in your script.
There is apparently a bug in the latest version of TFS that causes this hair-pulling issue. All the stuff about setting %WINDIR% in your Start-in directory for Powershell/Cmd etc. didn't work, but this did.
Related
I have developed the Azure Function App One year back and published successfully and it's running. Now I have made a changes on functionality which is build succeed.
When I am publishing it's throwing error unable to publish.
I went through the path which showing screen shot showing below error.
14-09-2020 10.49.31 PM
System.AggregateException: One or more errors occurred. --->
System.Exception: Publish has encountered an error. We were unable to
determine the cause of the error. Check the output log for more
details. --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Exception: Publish has encountered an error. We were unable to determine the cause of the error. Check the
output log for more details. <---
System.Exception: Publish has encountered an error. We were unable to
determine the cause of the error. Check the output log for more
details.
===================
I am unable to figure out the error here. Any one help on this?
I think you shouldn't stop because of this. And for the error you give us we can not get anything useful from it.
You just need to use another way to deploy. And it will give you the details error if it has any error.(Although I say it is another way, in fact they are essentially the same. VS Studio is actually performing packaging and running commands when you try to publish the azure function.)
Just do the following steps:
1, create the function app on azure.
2, build your function app on local.
3, Go to the compiled folder on local, and zip the content:
4, install the Azure CLI, then run az login.
5, cd to the compiled folder, then run below command:
az webapp deployment source config-zip --resource-group yourresourcegroupnameonazure --name yourfunctionappnameonazure --src xxx.zip
After above steps, everything will be ok. This is the offcial doc:
https://learn.microsoft.com/en-us/azure/app-service/deploy-zip
I've seen similar errors in two cases: locked files and previously deployment executed by DevOps pipelines. I don't know if it applies in your case. In both cases, you have to modify your Azure Functions settings on portal:
case 1 : add MSDEPLOY_RENAME_LOCKED_FILES = 1
case 2 : remove WEBSITE_RUN_FROM_PACKAGE = 1
I have created Azure Batch pool with Linux Machine and specified Application Package for the Pool.
My command line is
command='python $AZ_BATCH_APP_PACKAGE_scriptv1_1/tasks/XXX/get_XXXXX_data.py',
python3: can't open file '$AZ_BATCH_APP_PACKAGE_scriptv1_1/tasks/XXX/get_XXXXX_data.py':
[Errno 2] No such file or directory
when i connect to node and look at working directory non of the Application Package files are present there.
How do i make sure that files from Application Package are available in working directory or I can invoke/execute files under Application Package from command line ?
Make sure that your async operation have proper await in place before you start using the package in your code.
Also please share your design \ pseudo-code scenario and how you are approaching it as a design?
Further to add:
Seems like this one is pool level package.
The error seems like that the application env variable is either incorrectly used or there is some other user level issue. Please checkout linmk below and specially the section where use of env variable is mentioned.
This seems like user level issue because In case of downloading the package resource, if there will be an error it will be visible to you via exception handler or at the tool level is you are using batch explorer \ Batch-labs or code level exception handling.
https://learn.microsoft.com/en-us/azure/batch/batch-application-packages
Reason \ Rationale:
If the pool level or the task application has error, an error-list will come back if there was an error in the application package then it will be returned as the UserError or and AppPackageError which will be visible in the exception handle of the code.
Key you can always RDP into your node and checkout the package availability: information here: https://learn.microsoft.com/en-us/azure/batch/batch-api-basics#connecting-to-compute-nodes
I once created a small sample to help peeps around so this resource might help you to checkeout the use here.
Hope rest helps.
On Linux, the application package with version string is formatted as:
AZ_BATCH_APP_PACKAGE_{0}_{1}
On Windows it is formatted as:
AZ_BATCH_APP_PACKAGE_APPLICATIONID#version
Where 0 is the application name and 1 is the version.
$AZ_BATCH_APP_PACKAGE_scriptv1_1 will take you to the root folder where the application was unzipped.
Does this "exact" path exist in that location?
tasks/XXX/get_XXXXX_data.py
You can see more information here:
https://learn.microsoft.com/en-us/azure/batch/batch-application-packages
Edit: Just saw this question: "or can I invoke/execute files under Application Package from command line"
Yes you can invoke and execute files from the application package directory with the environment variable above.
If you type env on the node you will see the environment variables that have been set.
I was trying to get the Side by side workflow services to work ( followed the MSDN article.. http://msdn.microsoft.com/en-us/library/hh314045%28v=vs.110%29.aspx). Unfortunately my persisted workflows broke.. It has thrown very generic exception, given below..
System.ServiceModel.FaultException: The workflow has been aborted.
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Activities.Dispatcher.ControlOperationInvoker.InvokeEnd(Object instance, Object[]& outputs, IAsyncResult result)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeEnd(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage7(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
Below are the steps..
I have developed the sample workflow service using framework 4.5 ( set the Definition Identity too )
named CusotmerService.xamlx.
Hosted in App fabric
Updated the persistence store schema too (SqlWorkflowInstanceStoreSchemaUpgrade.sql)
Before start making the changes to the existing workflow definition , done the following changes
Created the App_Code folder -> Moved the existing work defintion(CustomerService.Xamlx) to this folder.
And also renamed it to CustomerServiceV1.xamlx.
Then after that I have made changes to CustomerService.xamlx ( Added one extra Assign Activity)
Modified the Defintion Identity ( changed the version to 2.0.0.0)
Then I published my changes to IIS ( Publish) ( restarted the IIS too after published..)
As soon as I published my changes to IIS then the persisted workflows broke. New instances worked without any issues..
I'm not sure why it broke.. Is there any way to publish the side by side workflow services in IIS / Appfabric? Am I doing anything wrong here... Please advice me..
Appreciate your quick response..
Thanks
Deepa
a) Reading through the MS documentation suggests that moving the XAMLX to the AppCode folder is not correct. It should be moved to a subfolder with the same name as the service:
create a new folder in the App_Code folder that has the same name as the service file. If the service’s xamlx file is named MortgageWorkflow.xamlx, then the folder must be named MortgageWorkflow. Place a copy of the original service’s xamlx file into this folder and rename it to a new name, such as MortgageWorkflowV1.xamlx
b) To diagnose the aborted exception, typically you go to AppFabric service configuration and enable verbose tracing on both WCF and WF. You will see the root cause there.
when I use the -register option in Opencover I get a unhandled exception
C:\hudson\jobs\SPIN.Accounts.AccountNode\workspace>"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -target:"C:\Program Files (x86)\NUnit 2.5.10\bin\net-2.0\nunit-console.exe" -targetargs:"/noshadow mydll.dll" -output:"coverage-result.xml" -filter:"+[myNamespace]*" -register:user
An exception occured: Object reference not set to an instance of an object.
stack: at OpenCover.Framework.ProfilerRegistration.ExecuteRegsvr32(Boolean userRegistration, Boolean register, Boolean is64)
at OpenCover.Framework.ProfilerRegistration.ExecuteRegsvr32(Boolean userRegistration, Boolean register)
at OpenCover.Console.Program.Main(String[] args)
I've tried -register and -register:user and both give me the same error. This only happens when I run the it in Jenkins.
So can some one explain what is the significance of the -register parameter and also how can I can get this to work in Jenkins? Thanks.
Update: I am not sure why the -register parameter didn't work in Jenkins but I ended up registering the profilers outside of Jenkins and it works now. Not ideal but at least there's a work around. Would still like to find a proper solution to this though. I'm not sure if anybody else has this problem but maybe it's worth a little wiki entry on GitHub.
Is jenkins running under a service account?
If so does it have permission to register a COM object?
The -register:user option is for accounts that don't have permissions to register a service for all users however AFAIK this won't work when running as a service.
Registering the profilers under an account with the correct permissions is the correct way to go and is the same for other CI systems such as TeamCity.
I am trying to set up Report Server 2008 on a separate machine to the Reporting Services databases which are on a SQL Server 2008 R2 machine.
I configure everything in the Reporting Services Configuration Manager (identical to a set up we have working on a different pair of servers). The database connection test works fine, and the final "Progress and Finish" and screen shows "Success". However when I browse to the report server I get the error:
"The report server installation is not initialized. (rsReportServerNotActivated)"
I have seen a number of solutions online for this but they suggest using the Initialization tab on the Reporting Services Configuration Manager to initialize it. Or alternatively to use the rsactivate command. Now in 2008 I can't seem to find either of these so I'm a bit stuck.
When I use the Reporting Services Configuration Manager I get the following errors in the Event Viewer:
The application domain
WindowsService_1 failed to initialize.
Error:
Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerNotActivatedException:
The report server installation is not
initialized. at
Microsoft.ReportingServices.Library.ConnectionManager.b_2()
at
Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.<>c_DisplayClass1.b__0(Object
state) at
System.Security.SecurityContext.Run(SecurityContext
securityContext, ContextCallback
callback, Object state) at
Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.Run(ContextBody
callback) at
Microsoft.ReportingServices.Library.ConnectionManager.GetEncryptionKey()
at
Microsoft.ReportingServices.Library.ConnectionManager.ConnectStorage()
at
Microsoft.ReportingServices.Library.ServiceController.ServiceStartThread(Object
firstStart).
followed by:
The application domain
WindowsService_1 failed to initialize.
Error:
Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerNotActivatedException:
The report server installation is not
initialized. at
Microsoft.ReportingServices.Library.ConnectionManager.b_2()
at
Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.<>c_DisplayClass1.b__0(Object
state) at
System.Security.SecurityContext.Run(SecurityContext
securityContext, ContextCallback
callback, Object state) at
Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.Run(ContextBody
callback) at
Microsoft.ReportingServices.Library.ConnectionManager.GetEncryptionKey()
at
Microsoft.ReportingServices.Library.ConnectionManager.ConnectStorage()
at
Microsoft.ReportingServices.Library.ServiceController.ServiceStartThread(Object
firstStart).
Is there another way I can initialize the report server installation?
I finally managed to get this working by going to the Reporting Services Configuration Manager > Encryption Keys > Delete Encrypted Content > Delete.
Not sure why this worked, but it did.
Just for completeness I have noticed that I still the get the following error in the Application Log, which luckily doesn't seem to cause any obvious problems for me, but remains nonetheless.
Failed to unload app domain DefaultDomain. The following exception occurred: Error while unloading appdomain. (Exception from HRESULT: 0x80131015).
If I find anything else I'll post back.