Build failure "Command exited with code 259"

Vinney Kelly's Avatar

Vinney Kelly

01 Sep, 2014 05:40 PM

I'm looking for some help interpreting an error in our project's CI build. The process completes unit tests (with all tests passing) and the very next line is the error, "Command exited with code 259" (screenshot attached). There is no exception information displayed on the console or anywhere else I can find. We are using a SQL Server instance for our testing environment. Any help would be gratefully appreciated.

Best,
Vinney

  1. Support Staff 1 Posted by Feodor Fitsner on 01 Sep, 2014 06:00 PM

    Feodor Fitsner's Avatar

    Is it NUnit?

    -Feodor

  2. 2 Posted by Vinney Kelly on 01 Sep, 2014 07:11 PM

    Vinney Kelly's Avatar

    Yes. We're using nunit and SpecFlow.

    Sent from my Windows Phone
    ________________________________

  3. Support Staff 3 Posted by Feodor Fitsner on 01 Sep, 2014 07:57 PM

    Feodor Fitsner's Avatar

    This is something within nunit runner. NUnit returns either one of standard negative exit codes or the number of failed tests: http://stackoverflow.com/questions/3889577/does-anyone-know-where-t... The footer in your build log shows there are no failed tests.

    To make sure it's not AV console runner try running your tests using vanilla NUnit runner which can be installed from NuGet:

    nuget install NUnit.Runners
    

    and then ...

    NUnit.Runners.2.6.3\tools\nunit-console path\to\your-assembly.dll
    
  4. 4 Posted by Vinney Kelly on 01 Sep, 2014 09:43 PM

    Vinney Kelly's Avatar

    Thanks for the suggestion, Feodor. I have a test running now which uses the Script Test option rather than Auto. I've added both lines of script to the PowerShell script textbox. Based on the console output, I'm not expecting this will make any difference as both are very similar (screenshots attached). Additionally, I'm not finding this error code in any NUnit documentation which leads me to think the error is in the cleanup process and actually an NUnit response. I did find this bit of information regarding error code 259:

    Windows system error code 259 is a software-specific error, especially common with applications that use Filestream to create or update SQL databases.
    

    Is there any way you can check the error logs? If there's an exception being thrown, it's being swallowed before bubbling to the console.

  5. Support Staff 5 Posted by Feodor Fitsner on 01 Sep, 2014 09:57 PM

    Feodor Fitsner's Avatar

    Right, most probably there is a problem with [TearDown] method in some of the tests.

    AppVeyor shouldn't swallow anything, both StdOut and StdErr are being collected, specially in PowerShell mode where output is collected by PowerShell.

    In that post they mention some permissions. How do you create the database? Is it MDF file attached or CREATE DATABASE and then filling it with schema/data?

  6. 6 Posted by Vinney Kelly on 01 Sep, 2014 10:02 PM

    Vinney Kelly's Avatar

    We're using EF Migrations to create the database. Tests build up their own data and subsequently clear all data. We don't have any code making any attempts to teardown the database.

  7. Support Staff 7 Posted by Feodor Fitsner on 01 Sep, 2014 10:06 PM

    Feodor Fitsner's Avatar

    So, you don't have an error when calling runner from NuGet package?

  8. 8 Posted by Vinney Kelly on 01 Sep, 2014 10:12 PM

    Vinney Kelly's Avatar

    Test is still running. Still has about 30 minutes left. I'll report back with the result of the test.

  9. 9 Posted by Vinney Kelly on 01 Sep, 2014 11:45 PM

    Vinney Kelly's Avatar

    I had my doubts but it seems you were right! Executing the Nunit runner from the script worked finished without errors. Of course, this takes a dependency on the Nunit runner version number which will break on the next version release if left as is...

  10. Support Staff 10 Posted by Feodor Fitsner on 03 Sep, 2014 03:17 AM

    Feodor Fitsner's Avatar

    Well, that's interesting. Might be something with AppVeyor add-in pushing test results in a real-time.

    Could you help me with a proof-of-concept please? Enable tests "Auto" back to use NUnit runner provided by AppVeyor and add this in before build or install section to delete add-ins folder with AppVeyor reporter:

    rd /s /q C:\Tools\NUnit\bin\addins
    

    Btw, you can specify version number while installing NUnit with Nuget:

    nuget install NUnit.Runners -Version 2.6.3
    
  11. 11 Posted by Vinney Kelly on 03 Sep, 2014 02:57 PM

    Vinney Kelly's Avatar

    I'm attempting to initiate this test for you. However, I'm getting a new error regarding failure to resolve remote name 'www.nuget.org'. I can't imagine that adding the rd command in the pre-build script would have caused this. Furthermore, I've reverted the settings changes and the issue persists. I have no problems browsing nuget packages from within VS. Screenshot from console attached.

  12. Support Staff 12 Posted by Feodor Fitsner on 03 Sep, 2014 03:36 PM

    Feodor Fitsner's Avatar

    It's not related. Might be a sporadic Azure DNS issue or maybe something was updated on nuget side.

    Give it another try.

    -Feodor

  13. 13 Posted by Vinney Kelly on 03 Sep, 2014 05:34 PM

    Vinney Kelly's Avatar

    Yeah, whatever that hiccup was, it's cleared up now. One thing which might shed some light on the situation, we're not explicitly installing Nunit.Runners. Perhaps I need to include that command in the environment script.

    Test is running with the rd command as suggested. I'll report back with the results when it's completed.

    BTW, you rock the support line, Feodor :)

  14. 14 Posted by Vinney Kelly on 03 Sep, 2014 05:37 PM

    Vinney Kelly's Avatar
    Remove-Item : A positional parameter cannot be found that accepts argument '/q'.
    At line:1 char:1
    + rd /s /q C:\Tools\NUnit\bin\addins
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Remove-Item], ParameterBindingException
        + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
    
  15. 15 Posted by Vinney Kelly on 03 Sep, 2014 05:40 PM

    Vinney Kelly's Avatar

    rd /s /q C:\Tools\NUnit\bin\addins

    Is that supposed to be PS or CMD script? It's currently residing in the PS script block. If it needs to be CMD, can we have both script types side-by-side? We have some necessary PS script without which tests will not run.

  16. Support Staff 16 Posted by Feodor Fitsner on 03 Sep, 2014 05:42 PM

    Feodor Fitsner's Avatar

    It's CMD. For PS you can use:

    rd C:\Tools\NUnit\bin\addins -Recurse -Force
    

    It's possible to have CMD and PS side-by-side in appveyor.yml.

  17. 17 Posted by Vinney Kelly on 03 Sep, 2014 05:57 PM

    Vinney Kelly's Avatar

    Fixed and re-running tests. Would you like to see the results of this test with the addition of the nuget install NUnit.Runners command?

  18. Support Staff 18 Posted by Feodor Fitsner on 03 Sep, 2014 06:01 PM

    Feodor Fitsner's Avatar

    Sure, and also post the result of running with our runner but with add-ins deleted.

  19. 19 Posted by Vinney Kelly on 03 Sep, 2014 10:25 PM

    Vinney Kelly's Avatar

    Well, deleting the add-ins without installing the NUnit.Runners yields the same 259 error code. Deleting the add-ins AND installing NUnit.Runners results in 259 as well... Any other ideas?

    -Vinney

  20. Support Staff 20 Posted by Feodor Fitsner on 03 Sep, 2014 10:26 PM

    Feodor Fitsner's Avatar

    So, when running with NUnit-console installed from nuget it works without 259 error?

    -Feodor

  21. 21 Posted by Vinney Kelly on 03 Sep, 2014 10:37 PM

    Vinney Kelly's Avatar

    The only way I've been able to get it working w/o error is to use the script you prescribed (not Auto):

    nuget install NUnit.Runners
    NUnit.Runners.2.6.3\tools\nunit-console path\assembly.dll
    
  22. 22 Posted by Vinney Kelly on 03 Sep, 2014 10:41 PM

    Vinney Kelly's Avatar

    Attached is a screenshot of NUnit running from the Auto configuration with the NUnit.Runners package installed and the rd C:\Tools\NUnit\bin\addins -Recurse -Force command executing pre-build.

  23. 23 Posted by Vinney Kelly on 03 Sep, 2014 11:57 PM

    Vinney Kelly's Avatar

    Maybe you already know this, but when I run tests using the above mentioned script, we don't get any test logs. That's no fun and essentially makes that a non-acceptable fix.

  24. Support Staff 24 Posted by Feodor Fitsner on 04 Sep, 2014 12:10 AM

    Feodor Fitsner's Avatar

    You can generate XML test results and then upload them to AppVeyor: http://www.appveyor.com/docs/running-tests#test-results

  25. 25 Posted by Vinney Kelly on 04 Sep, 2014 04:18 PM

    Vinney Kelly's Avatar

    Hm. Well, that's certainly less than ideal. Automation is the goal after all. Are you saying that our project is just not going to work with the Auto test functionality? If so, do you know what might be causing this issue?

  26. Support Staff 26 Posted by Feodor Fitsner on 04 Sep, 2014 04:28 PM

    Feodor Fitsner's Avatar

    Is there any way to reproduce the issue with a simpler/smaller tests (ideally, one test)? We'd like to work on the issue.

  27. 27 Posted by Vinney Kelly on 08 Sep, 2014 08:38 PM

    Vinney Kelly's Avatar

    We'll try to get that test set up for you this week.

  28. Support Staff 28 Posted by Feodor Fitsner on 08 Sep, 2014 09:01 PM

    Feodor Fitsner's Avatar

    Cool! In the meantime, I'm in the process of re-working communication layer between build agent and nunit/xunit. Will be interesting to see if it makes a difference.

  29. Support Staff 29 Posted by Feodor Fitsner on 12 Sep, 2014 04:25 AM

    Feodor Fitsner's Avatar

    Hi Vinney,

    We've deployed an update to AppVeyor with slightly different communication layer between NUnit and AV agent. I'm wondering if you are still able to reproduce "259" issue with an update?

  30. 30 Posted by Vinney Kelly on 12 Sep, 2014 09:15 PM

    Vinney Kelly's Avatar

    Feodor, we've introduced a bug in our latest build. I'll let you know how your update affects the 259 issue Monday after we have our bug fixed.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

26 Sep, 2024 03:49 PM
26 Sep, 2024 09:02 AM
25 Sep, 2024 07:07 PM
24 Sep, 2024 08:39 PM
24 Sep, 2024 06:47 AM
20 Sep, 2024 05:50 PM