Closed knownasilya closed 9 years ago
Get the following error when connecting to docker tcp
Parse Error Error: Parse Error
at Socket.socketOnData (http.js:1583:20)
at TCP.onread (net.js:527:27)
cc @keyvanfatehi @davemackintosh
Sounds stupid but you're definitely running docker? Check your DOCKER_HOST
/DOCKER_PORT
envs?
Probably has something to do with the certs he's trying to use. That would be a completely separate PR and should be done in a common module so we dont have to do this again for strider-docker-runner or any other docker-related modules we write.
Agreed. Seems like mixed responsibilities in this PR.
that common module can be the option builder here https://github.com/keyvanfatehi/dockerode-optionator, so then you can keep these two lines as is:
var opt = require('dockerode-optionator');
var dOpts = opt.normalizeOptions({}, process.env);
but change dockerode-optionator to look fro DOCKER_CA, DOCKER_CERT, or whatever other envvars, document them appropriately, and have it build the dOpts
object appropriately for passing into Docker() dockerode constructor @knownasilya
Yup, the host is set and boot2docker is running. On Dec 17, 2014 3:30 PM, "Dave Mackintosh" notifications@github.com wrote:
Sounds stupid but you're definitely running docker? Check your DOCKER_HOST env?
— Reply to this email directly or view it on GitHub https://github.com/Strider-CD/strider-docker-build/pull/5#issuecomment-67388060 .
Hrmm, I wonder if this is the Content-Length
being set manually somewhere. I've had this issue before and it's a nightmare.
Could you run boot2docker upgrade
to make sure you have the latest image available as well (a new version was released yesterday.
@davemackintosh updated, but still no luck. It's pulling in the right settings and the certs, but still parse error.
@keyvanfatehi I'm going to submit a PR to dockerode-optionator, this is just temporary.
I'm also seeing the connection error with boot2docker. Can't seem to work out why, ip is right, port is right, all updated, can ssh into the docker image. Very strange.
Looks like it's time to submit an issue with dockerode On Dec 18, 2014 5:30 AM, "Dave Mackintosh" notifications@github.com wrote:
I'm also seeing the connection error with boot2docker. Can't seem to work out why, ip is right, port is right, all updated, can ssh into the docker image. Very strange.
— Reply to this email directly or view it on GitHub https://github.com/Strider-CD/strider-docker-build/pull/5#issuecomment-67467748 .
:+1:
@logankoester if you could test that would be awesome. Currently I'm getting a parse error, just want to see if others are getting it as well.
@knownasilya Sure, giving it a shot right now :-)
Is this the parse error you are looking for?
Strider-CD#master
:knownasilya#push
:With this on the console...
app.js:24121 Error: [$parse:lexerr] Lexer Error: Unterminated quote at columns 21-26 ['test] in expression [config.buildPhase == 'test].
http://errors.angularjs.org/1.2.23/$parse/lexerr?p0=Unterminated%20quote&p1=s%2021-26%20%5B'test%5D&p2=config.buildPhase%20%3D%3D%20'test
at VALIDITY_STATE_PROPERTY (http://ci.ldk.io/scripts/app.js:14138:12)
at Lexer.throwError (http://ci.ldk.io/scripts/app.js:24364:11)
at Lexer.readString (http://ci.ldk.io/scripts/app.js:24516:10)
at Lexer.lex (http://ci.ldk.io/scripts/app.js:24284:14)
at Parser.parse (http://ci.ldk.io/scripts/app.js:24542:30)
at $get (http://ci.ldk.io/scripts/app.js:25354:37)
at compileToFn (http://ci.ldk.io/scripts/app.js:27052:16)
at Scope.$get.Scope.$watch (http://ci.ldk.io/scripts/app.js:26254:19)
at ngAttributeAliasDirectives.(anonymous function).link (http://ci.ldk.io/scripts/app.js:30088:15)
at nodeLinkFn (http://ci.ldk.io/scripts/app.js:20764:13) <option value="test" ng-selected="config.buildPhase == 'test">app.js:24121 (anonymous function)app.js:21417 $getapp.js:20767 nodeLinkFnapp.js:20158 compositeLinkFnapp.js:20758 nodeLinkFnapp.js:20158 compositeLinkFnapp.js:20161 compositeLinkFnapp.js:20161 compositeLinkFnapp.js:20758 nodeLinkFnapp.js:20158 compositeLinkFnapp.js:20161 compositeLinkFnapp.js:20054 publicLinkFnapp.js:20178 $get.boundTranscludeFnapp.js:20785 controllersBoundTranscludeapp.js:35189 (anonymous function)app.js:14385 forEachapp.js:35186 ngSwitchWatchActionapp.js:26572 $get.Scope.$digestapp.js:26837 $get.Scope.$applyapp.js:15507 (anonymous function)app.js:18026 invokeapp.js:15505 doBootstrapapp.js:15519 bootstrapapp.js:15428 angularInitapp.js:36009 (anonymous function)app.js:40431 jQuery.Callbacks.fireapp.js:40543 jQuery.Callbacks.self.fireWithapp.js:40755 jQuery.extend.readyapp.js:40786 completed
@logankoester thanks. I've pulled in the changes from master, if you could give it another go.
Okay, going to actually try to run the thing now :-)
Submitted https://github.com/keyvanfatehi/dockerode-optionator/pull/2 since the certs overwrote the other options.
Ok, back to parse error.
Sorry guys, not sure why that happened but I've submitted a PR fixing that.
[edit] Actually, this might be a separate issue and unrelated to the parse issue.
The parse issue is to do with the piping of stdout from the container to event-stream
it needs to be structured like this (I can't remember where it pipes so I'm putting it here in-case you lot get there first)
{
type: 'stdout',
data: data.toString()
}
@davemackintosh was that not the issue?
The full error is:
{ [Error: Parse Error] bytesParsed: 0, code: 'HPE_INVALID_CONSTANT' }
It's the same issue as the PR tries to solve but I don't think that PR will work, it's definitely in the right direction but we need to convert strings into JSON before sending them to event-stream
Do please test that PR though, it might work (I ran out of time to test it properly)
@davemackintosh a string is actually valid json, so not sure if that's the issue.
That may be so but it fails the JSON.parse
function which event-stream
is passing all input to.
JSON.parse('hello')
VM212:2 Uncaught SyntaxError: Unexpected token h
Broken, waiting on solving issue in master