Build hangs when building Azure Function project (hangs on GenerateFunctions task) - build

run “dotnet build” - build hangs
here are the last lines from the build log file
Task "GenerateFunctions" (TaskId:106)
Task Parameter:TargetPath=C:\xxxxx\xxxx\xxxx\bin\Debug\netcoreapp3.1\bin\StoresLicenses.dll (TaskId:106)
Task Parameter:TaskAssemblyDirectory=C:\Users\XXXXX\.nuget\packages\microsoft.net.sdk.functions\3.0.11\build\..\tools\netcoreapp3.1\ (TaskId:106)
Task Parameter:OutputPath=C:\XXXXX\StoresLicenses\StoresLicenses\StoresLicenses\bin\Debug\netcoreapp3.1\ (TaskId:106)
Function generator path: 'C:\Program Files\dotnet\dotnet.exe' (TaskId:106)
Microsoft.NET.Sdk.Functions.Generator.dll "C:\XXXXX\bin\Debug\netcoreapp3.1\ " "False " (TaskId:106)
Any ideas on how to troubleshoot it?

this problem is caused by setting the environment variable COREHOST_TRACING to 1
Set COREHOST_TRACING=0 and build will be executed correctly

Related

mlUnitTest throws a java.nio.file.NoSuchFileException at the end of the tests

I try to use mlunitTest with ml-gradle 3.17.1 and Marklogic marklogic-unit-test-client:1.0.0
All the tests are OK, I test with my test user on the UI and with ml-gradle.
But when ml-gradle wants to access the results in a directory [build\test-results\marklogic-unit-test\TEST-{test-name}], java throws an error because the file isn't there.
Just before there is a comment who precises that it clears the directory.
Does anyone use the mlunitTest without this problem?
it's the same if i give the name of the result directory with the parameter : -PunitTestResultsPath=testML
Here are the traces of this part of execution :
Done running all suites; time: 82ms
4 tests completed, 0 failed
Deleted existing results directory: build\test-results\marklogic-unit-test
Releasing connection
:mlUnitTest (Thread[Execution worker for ':',5,main]) completed. Took 0.093 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mlUnitTest'.
> java.nio.file.NoSuchFileException: build\test-results\marklogic-unit-test\TEST-historicId.xml
Try release 4.3.0 - it includes the following fix - https://github.com/marklogic-community/ml-gradle/issues/599

Pass command's stderr from a build task into Azure DevOps

I have a VSTS (Azure DevOps) build which contains a PowerShell or a Command line task. This task is running some program: program.exe. When program.exe returns a non-zero exit code, the build is failed as expected. program.exe also prints a detailed error message to the stderr stream in case of an error.
The problem is that the content of the stderr stream is not passed to the build. The task is always returning the following error message which is also displayed as a build failure message on the build summary tab:
Process completed with exit code 1.
Which is useless. The user has to look for a failed task, open its output and search for an error message there. That's not very convenient.
How to easily pass the content of stderr to the build?
Do I have to manually capture stderr and then send it to the build using PowerShell or is there a setting to change the build behaviour to work as I expect?
I just added "2>&1 | Write-Host" to the command so that the stderr stream will be routed to the Write-Host stream. Reference this thread: VSTS build fails with "Process completed with exit code 0 and had 3 error(s) written to the error stream." even though I set my PowerShell script to ignore errors
You can also try uncheck the Fail on Standard Error in your PowerShell script configuration and write the lastexitcode to pass the task:
Fail on Standard Error
If this is true, this task will fail if any errors are written to the
error pipeline, or if any data is written to the Standard Error
stream. Otherwise the task will rely solely on $LASTEXITCODE and the
exit code to determine failure.
Then you can output the error or warning by using PowerShell or VSTS task commands.
Write-Warning “warning”
Write-Error “error”
Write-Host " ##vso[task.logissue type=warning;]this is the waring"
Write-Host " ##vso[task.logissue type=error;sourcepath=consoleapp/main.cs;linenumber=1;columnnumber=1;code=100;]this is an error "
More information about the VSTS task command, you can refer to: Logging Commands

SonarQube C++ build-wrapper produce empty build-wrapper-dump.json

I'm using sonarQube C/C++ on WIN10 machine on a vxworks (arm) cross compile project.
After running:
build-wrapper-win-x86-64 --out-dir bw_output make MyProject.make
Build succeeded, but I get empty build-wrapper-dump.json file.
looking at the build-wrapper.log file I see:
process created with pid: 25256
image path name: <C:\WindRiver_6.9\gnu\4.3.3-vxworks-6.9\x86-win32\bin\ccarm.exe>
command line: <ccarm ...long line... MwInterfaceService.cpp >
working directory: <CommonLib\>
isWow64: 1
skipping process C:\WindRiver_6.9\gnu\4.3.3-vxworks-6.9\x86-win32\bin\ccarm.exe with pid: 25256
Is there a way to make build-wrapper to fill build-wrapper-dump.json file correctly?
thanks,
Mr. G

Which unit test is currently running?

This question is related to the problem where my unit test procedure is crashing but I don't know on which unit test.
I realise this question is a duplicate of How can I find out which test method in a batch of test methods fails to run? but I need to try anyway:
I'm running some unit tests (about 118 of them), but one of them seems to make the Visual Studio unit test environment crash. This is what I see in the "output" window's "Tests" tab:
[5/02/2018 11:13:18 Informational] ------ Run test started ------
[5/02/2018 11:13:38 Error] The active Test Run was aborted because the execution process exited unexpectedly. The test execution process crashed while running the tests. To investigate further, open file:///C:/Users/DominiqueDS/AppData/Local/CrashDumps/vstest.executionengine.x86.exe.19136.dmp file in Visual Studio and choose "Debug in mixed mode".
[5/02/2018 11:13:38 Informational] ========== Run test finished: 65 run (0:00:19,6926824) ==========
The reason that I have that dump file is thanks to my Windows configuration which automatically creates such dumpfiles in case of a crashing application. (The procedure for this configuration is found under this URL)
Examining the dump file gives me more information on the test, which is failing: I have a hunch where I can find it, and in another thread, I find a function, calling a method which seems to contain the name of the unit test I'm running.
Although I know which test is failing, it's based on hunches and on dumpfiles I should even not generate, so I'm looking for another solution:
In the function TEST_METHOD in the file "c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\VS\UnitTest\include\CppUnitTest.h", I've tried to add the following lines:
cout << "Test : ";\
cout << methodName;\
cout << "\n";\
I was hoping that this would show every test I wanted to run, but instead I get the error message that this is wrong (also using std::cout and OutputDebugString() function seems not to be allowed).
Hence my question: does anybody know a way to find out, in case one of my unit tests makes my test environment crash, how can I find out which test this is, without needing to generate and debug the Visual Studio dumpfile?
For your information: looking in the "Test Explorer" is not helping: I have a list of disabled tests, a list of successful ones, and a list of some which are not finished, and my failing test is not the first of the "not finished" ones.
Found it: I've added the following line in the definition of TEST_METHOD():
Microsoft::VisualStudio::CppUnitTestFramework::Logger::WriteMessage(L#methodName);\

Startup Multichain in WIndows Task Scheduler

I run command:
multichaind mychain -deamon
to start up the multichain program.
As per: https://www.multichain.com/developers/creating-connecting/
I'm running on Win 2012. I have tried putting this in a startup script using Windows Task Scheduler so that when the machine reboots, it will restart.
The task scheduler history shows it ran successfully, but it's not running. When I run the command
multichain-cli mychain getinfo
it says it cannot connect to the server.
And of course, that same command works when I start up multichain in a separate command prompt window.
My theory is that the command runs, but then the command windows is closed, but needs to remain open. Is there any way to do this, or debug what is going on?
I tried adding the parms as:
mychain -daemon >>d:\Software\Multichain\log.txt
hoping that it would write to the file so I could read it. But no file was created.
Update: I tried the .cmd file approach as recommended in the comment:
multichaind mychain -daemon
pause
That doesn't make sense to me because the first line should never finish.
It did create the log.txt file, but the whole thing still ran and quit in a few seconds:
d:\Software\Multichain>multichaind mychain -daemon 1>>d:\Software\Multichain\log.txt
d:\Software\Multichain>pause
Press any key to continue . . .