Chain psexec and nunit is not working (psexec exit with code 1 and nunit is crashed) - nunit

Sorry for unclear subject but i really don't understand where problem.
I use a system for autotests c#+webdriver for chrome + nunit (2.6) + cc.net ( 1.6.7981.1)
And my tests is run on remote machine (Windows XP SP 2 x86)via psexec which start bat file on remote machine
bat file includes 2 commands:
run msbuild
run nunit-console
Well, psexec has next arguments
/accepteula \MachineName -u Login -p Pass -s Path\start.bat
Bat file has next command
nunit-console-x86.exe "%PROJECT_FOLDER%\Path\Tests.dll" "/xml=%TEST_RESULT_PATH%"
When cc.net launch psexec tests is started and the tests work during some time. Unexpected, psexec exit with code 1
message level="Error">Path\start.bat exited on MachineName with error code 1. message
But nunit-console on remote machine is continue working
And after some time console is crashed with error
szAppName : nunit-console-x86.exe szAppVer : 2.6.0.12051
szModName : kernel32.dll szModVer : 5.1.2600.2180 offset :
0001eb33
Message from Event log
Application: nunit-console-x86.exe Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.IOException Stack: at
System.IO._Error.WinIOError(Int32, System.String) at
System.IO._ConsoleStream.Write(Byte[], Int32, Int32) at
System.IO.StreamWriter.Flush(Boolean, Boolean) at
System.IO.StreamWriter.Write(Char[], Int32, Int32) at
System.IO.TextWriter.WriteLine(System.String) at
System.IO.TextWriter.WriteLine(System.String, System.Object) at
System.IO.TextWriter+SyncTextWriter.WriteLine(System.String,
System.Object) at System.Console.WriteLine(System.String,
System.Object) at NUnit.ConsoleRunner.Runner.Main(System.String[])
at NUnit.ConsoleRunner.Class1.Main(System.String[])
If run nunit locally than no problem(nunit-console works fun).
Some time ago system worked, and i don't know what is changed (This is most bad case)
How can i resolve this problem?
Thanks!

This problem is resolved!
Now system is working

Related

Problems with running webdriver-manager start --standalone on Azure Devops

I am configuring to run a Protractor test and below are the steps added in Azure devops
When I run this pipeline, it gets struck at webdriver-manager start --standalone. Not coming out of it so that it runs the next command to start test.
Error Log
2021-03-12T09:02:39.2180071Z ##[section]Starting: Run Test Cases
2021-03-12T09:02:39.3078252Z ==============================================================================
2021-03-12T09:02:39.3082840Z Task : Command line
2021-03-12T09:02:39.3085464Z Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2021-03-12T09:02:39.3086081Z Version : 2.182.0
2021-03-12T09:02:39.3086701Z Author : Microsoft Corporation
2021-03-12T09:02:39.3087524Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2021-03-12T09:02:39.3088140Z ==============================================================================
2021-03-12T09:02:40.7279581Z Generating script.
2021-03-12T09:02:40.7467500Z Script contents:
2021-03-12T09:02:40.7486434Z node node_modules/protractor/bin/protractor protractor.conf.js
2021-03-12T09:02:40.7928490Z ========================== Starting Command Output ===========================
2021-03-12T09:02:40.8274945Z ##[command]"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\91ab13f0-924e-4e63-a124-869764af15df.cmd""
2021-03-12T09:02:42.4610822Z [09:02:42] I/launcher - Running 1 instances of WebDriver
2021-03-12T09:02:42.4614093Z [09:02:42] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
2021-03-12T09:02:43.5634194Z [09:02:43] E/launcher - Error code: 135
2021-03-12T09:02:43.5635264Z [09:02:43] E/launcher - Error message: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
2021-03-12T09:02:43.5636368Z [09:02:43] E/launcher - Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
2021-03-12T09:02:43.5638525Z at ClientRequest.<anonymous> (D:\a\1\s\node_modules\selenium-webdriver\http\index.js:238:15)
2021-03-12T09:02:43.5640056Z at ClientRequest.emit (events.js:315:20)
2021-03-12T09:02:43.5642323Z at Socket.socketErrorListener (_http_client.js:469:9)
2021-03-12T09:02:43.5643094Z at Socket.emit (events.js:315:20)
2021-03-12T09:02:43.5643710Z at emitErrorNT (internal/streams/destroy.js:106:8)
2021-03-12T09:02:43.5644453Z at emitErrorCloseNT (internal/streams/destroy.js:74:3)
2021-03-12T09:02:43.5645162Z at processTicksAndRejections (internal/process/task_queues.js:80:21)
2021-03-12T09:02:43.5645806Z From: Task: WebDriver.createSession()
2021-03-12T09:02:43.5646642Z at Function.createSession (D:\a\1\s\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
2021-03-12T09:02:43.5648679Z at Function.createSession (D:\a\1\s\node_modules\selenium-webdriver\chrome.js:761:15)
2021-03-12T09:02:43.5649636Z at createDriver (D:\a\1\s\node_modules\selenium-webdriver\index.js:170:33)
2021-03-12T09:02:43.5650518Z at Builder.build (D:\a\1\s\node_modules\selenium-webdriver\index.js:626:16)
2021-03-12T09:02:43.5651614Z at Hosted.getNewDriver (D:\a\1\s\node_modules\protractor\built\driverProviders\driverProvider.js:53:33)
2021-03-12T09:02:43.5652586Z at Runner.createBrowser (D:\a\1\s\node_modules\protractor\built\runner.js:195:43)
2021-03-12T09:02:43.5653422Z at D:\a\1\s\node_modules\protractor\built\runner.js:339:29
2021-03-12T09:02:43.5654331Z at _fulfilled (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:834:54)
2021-03-12T09:02:43.5655184Z at D:\a\1\s\node_modules\protractor\node_modules\q\q.js:863:30
2021-03-12T09:02:43.5656122Z at Promise.promise.promiseDispatch (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:796:13)
2021-03-12T09:02:43.5658296Z [09:02:43] E/launcher - Process exited with error code 135
2021-03-12T09:02:43.6876129Z ##[error]Cmd.exe exited with code '135'.
2021-03-12T09:02:43.7575403Z ##[section]Finishing: Run Test Cases
Not coming out of it so that it runs the next command to start test.
The net command is the task Run Test Cases, right? If yes, we could click the task and expand the tab Control Options and ensure the field Run this task is set to Even if a previous task has failed, unless the build was canceled.
Then if the task Webdriver Start fails, the pipeline will continue to run the next task Run Test Cases.
Update1
Not coming out of it so that it runs the next command to start test.
The initial problem has been solved.
Since you have not started or webdriver not get started correctly, we could see the error issue: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444. If the previous task successfully runs Webdriver, we will not see the error message.
We need ensure the Webdriver start and then run the Protractor test.
I figured out the problem. We dont need an explict step to start Webdriver and also i had to comment a line in config.js

VSCode remote-ssh cant connect to win server 2019

I'm using VSCode remote-ssh extension for development on winserv2016 and it works as intended. We recently switched to winserv2019 and the extension does not work. the error I get in output is
Server failed to start. - Program 'icacls.exe' failed to run: Win32 internal err
> or "Access is denied" 0x5 occurred while reading the console output buffer. Cont
> act Microsoft Customer Support Services.At line:4 char:1
> + icacls $ai_ /reset /Q
I have and admin rights on this machine, does anyone encounter this issue? I've also tried nightly build of VScode and nightly extension. No Success so far.

Continue after a failing command in appveyor

In appveyor I use the statement:
- initexmf --admin --force --mklinks
but due to a problem it gives the message:
initexmf --admin --force --mklinks
Sorry, but "MiKTeX Configuration Utility" did not succeed for the following reason:
Script configuration file not found.
The log file hopefully contains the information to get MiKTeX going again:
C:\ProgramData\MiKTeX\2.9\miktex\log\initexmf_admin.log
The system cannot find the path specified.
Command exited with code 1
due to the error code the process terminates and I cannot type the C:\ProgramData\MiKTeX\2.9\miktex\log\initexmf_admin.log anymore, so a bit hard to debug ...
questions:
How to continue after an error
How to stop after the outputting the file (exit 1 ?)
To run a script on failure use on_failure section, for example to push initexmf_admin.log to artifacts:
on_failure:
- appveyor PushArtifact C:\ProgramData\MiKTeX\2.9\miktex\log\initexmf_admin.log

error on Teamcity running command line custom script

I'm trying to run command line -custom script on Teamcity and getting this error (127):
[02:22:25][Step 1/1] /mnt/teamcity/temp/agentTmp/custom_script8657691082445726475: 1: /mnt/teamcity/temp/agentTmp/custom_script8657691082445726475: ./run.sh: not found
[02:22:25][Step 1/1] Process exited with code 127
[02:22:26][Step 1/1] Step run protractor test (Command Line) failed
any ideas?
It looks like some dependency of your script is not found where it expects it:
./run.sh: not found
Is that the actual script you are running? or is your script trying to call that script?
what solved it was adding 'Agent Requirements' (under build Configuration Settings) saying that 'system.agent.name' equals to the name of the Agent we use.

Detect remote runcommand failed when running msdeploy

I am running msdeploy (in powershell, as part of a script) with a runcommand provider as a postsync step, which runs a batch file on the remote machine. The batch file just executes exit /b 1 which causes it to return a failure code.
I am using msdeploy v3, and have specified successReturnCodes=0 as a provider parameter.
I can see the batch file executing, I can see that msdeploy recognises that it's an error, and logs the fact:
Performing '-postSync'...
Info: Using ID '892ee111-27c1-458d-888d-ead28fcab742' for connections to the remote server.
Info: Using ID '49ee88fc-0e1d-4eff-8a75-bccf0e7d680a' for connections to the remote server.
Info: Updating runCommand (d:\testdeploy\test\test.bat).
Info:
Info: C:\Windows\system32>exit /b 1
Error: (13/06/2013 6:06:03 PM) An error occurred when the request was processed on the remote computer.
Error: The process 'C:\Windows\system32\cmd.exe' (command line '') exited with code '0x1'.
Error count: 1.
Error during '-postSync'.
Total changes: 1 (0 added, 0 deleted, 1 updated, 0 parameters changed, 6 bytes copied)
D:\TestDeploy> $LASTEXITCODE
0
However, msdeploy returns successfully, $LASTEXITCODE is 0.
Is there any way to tell that msdeploy has actually caught an error? (without resorting to capturing the output of msdeploy and checking for the presence of 'Error count:'? :)
It seems that if you remove successReturnsCodes, it will only report as a warnig but msdeploy will return the correct return code.
I'd recommend you file this as a bug on the MSDeploy forums.
It turns out it was due to a mix up in versions between msdeploy v2 and v3. The only combination that will return the exit code correctly is v3 client and v3 service. I was using the v3 client but mistakenly connecting with it to a v2 service.
Richard Szalay is correct, the successReturnCodes just changes the log of the return code from warning to info.