Giter Site home page Giter Site logo

Comments (1)

brentd avatar brentd commented on May 25, 2024

Thx for the report @masondesu !

I fiddled with this and couldn't reproduce your error. I tried the following:

>> Nstance.log.level = :debug
=> :debug
>> instance = Nstance.create(image: "ruby")
=> #<Nstance::Instance:0x00007ffc1ba18e88 @driver=#<Nstance::Drivers::DockerAPI::AttachDriver:0x00007ffc1ba192c0 @uuid="f900bbd6-ce44-4118-a386-15b940edc773", @image="ruby", @manager=#<Nstance::Drivers::DockerAPI::ContainerManager:0x00007ffc1ba18f78 @image="ruby", @container_opts={:Image=>"ruby", :Cmd=>["sh"], :Labels=>{"nstance"=>"f900bbd6-ce44-4118-a386-15b940edc773"}, :OpenStdin=>true, :StdinOnce=>true, "name"=>"nstance_f900bbd6-ce44-4118-a386-15b940edc773"}, @lock=#<Thread::Mutex:0x00007ffc1ba18f50>>, @parser=#<Nstance::Drivers::DockerAPI::AttachLogParser:0x00007ffc1ba18f28 @buffer="">, @lock=#<Thread::Mutex:0x00007ffc1ba18ed8>, @queue=[]>>
>> instance.run("ruby -e 'puts \"a\" * 300'", output_limit: 100)
D, [2019-10-31T20:47:55.309297 #28722] DEBUG -- nstance: Command 4b6933e9 scheduled: "ruby -e 'puts \"a\" * 300'"
D, [2019-10-31T20:47:55.309569 #28722] DEBUG -- nstance: Creating container: {:Image=>"ruby", :Cmd=>["sh"], :Labels=>{"nstance"=>"f900bbd6-ce44-4118-a386-15b940edc773"}, :OpenStdin=>true, :StdinOnce=>true, "name"=>"nstance_f900bbd6-ce44-4118-a386-15b940edc773"}
D, [2019-10-31T20:47:55.977992 #28722] DEBUG -- nstance: Command 4b6933e9 received data: [stdout] "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
D, [2019-10-31T20:47:55.978079 #28722] DEBUG -- nstance: Command 4b6933e9 event:chunk, payload:[:stdout, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"]
D, [2019-10-31T20:47:55.978114 #28722] DEBUG -- nstance: Command 4b6933e9 event:line, payload:[:stdout, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"]
D, [2019-10-31T20:47:55.978141 #28722] DEBUG -- nstance: Command 4b6933e9 event:complete, payload:[---
stdout | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
--- exit status: output_limit_exceeded]
D, [2019-10-31T20:47:55.978176 #28722] DEBUG -- nstance: Removing container: {:Image=>"ruby", :Cmd=>["sh"], :Labels=>{"nstance"=>"f900bbd6-ce44-4118-a386-15b940edc773"}, :OpenStdin=>true, :StdinOnce=>true}
=> ---
stdout | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
--- exit status: output_limit_exceeded
>> result = _
=> ---
stdout | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
--- exit status: output_limit_exceeded
>> result.status
=> :output_limit_exceeded
>> result.lines
=> [[:stdout, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"]]

However based on your stack trace it seems like the problem occurs in Result#inspect when lines is nil for some reason, so I pushed 6818722.

Give that sha a try please and let me know if this is fixed. It would be great to have a reproducing test case in the spec suite (that now passes if my commit works) if you have time and you're able to reproduce this consistently.

from nstance.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.