这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@callahad
Copy link
Contributor

@callahad callahad commented Nov 6, 2015

Let's see if this passes CI...

(it should, but there are some subtleties in curl vs wget that I'm going to double-check while CI runs)

@josegonzalez
Copy link
Member

Nice! I'm in the middle of making a release, but this will go into 0.4.5 :)

@callahad
Copy link
Contributor Author

callahad commented Nov 6, 2015

Heh. You're presuming it won't Break Everything. Waiting for 0.4.5 is a good idea :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The english here was always solid :P

@callahad
Copy link
Contributor Author

callahad commented Nov 6, 2015

So, one potential issue with this is that both wget --quiet and curl --silent are both completely silent, and we still want to see log entries when something fails.

Curl has --show-error, to still print when something blows up, but wget doesn't have anything like it. The closest wget has is --no-verbose, which prints a single status line for all requests, in addition to any errors:

# curl -sS is silent, but still prints errors
$ curl -sSL 'http://httpbin.org/status/200'
$ curl -sSL 'http://httpbin.org/status/404'
$ curl -sSL 'http://httpbin.org/status/500'
$ curl -sSL 'http://example.invalid'
curl: (6) Could not resolve host: example.invalid

# wget -q is completely silent
$ wget -qO- 'http://httpbin.org/status/200'
$ wget -qO- 'http://httpbin.org/status/404'
$ wget -qO- 'http://httpbin.org/status/500'
$ wget -qO- 'http://example.invalid'

# wget -nv is almost silent, but prints on every request
$ wget -nv -O- 'http://httpbin.org/status/200'
2015-11-06 08:17:57 URL:http://httpbin.org/status/200 [0/0] -> "-" [1]
$ wget -nv -O- 'http://httpbin.org/status/400'
http://httpbin.org/status/404:
2015-11-06 08:18:00 ERROR 404: NOT FOUND.
$ wget -nv -O- 'http://httpbin.org/status/500'
http://httpbin.org/status/500:
2015-11-06 08:18:05 ERROR 500: INTERNAL SERVER ERROR.
$ wget -nv -O- 'http://example.invalid'
wget: unable to resolve host address 'example.invalid'

We can either:

  • lose printing on errors with wget -q
  • get a print on every request with wget -nv
  • try to emulate curl's behavior with wget -nv ... 2>&1 | grep '^wget: '

@callahad
Copy link
Contributor Author

callahad commented Nov 6, 2015

And, if we need to be able to pass the output along, we can send stderr into a subshell, and stdout wherever

$ wget -nv -O - 'http://example.invalid' 2> >(grep '^wget: ') > /dev/null
wget: unable to resolve host address 'example.invalid'

@josegonzalez
Copy link
Member

I do a trick where I redirect all output to a temporary file, and if there is an error, I dump the contents of that file. See here and here.

@callahad
Copy link
Contributor Author

callahad commented Nov 6, 2015

Yeah, I need to revisit things, especially around what output goes where in the bats tests.

@callahad
Copy link
Contributor Author

Dropping this PR's scope. We could probably make wget to work everywhere, but curl is way more developer friendly for us, especially its --show-error flag. Instead of excising it completely, let's just avoid using curl during bootstrapping, and keep the .deb package dependency on curl, so that we can use it once Dokku is installed.

josegonzalez added a commit that referenced this pull request Nov 10, 2015
@josegonzalez josegonzalez merged commit cd633d4 into dokku:master Nov 10, 2015
pmvieira pushed a commit to pmvieira/dokku that referenced this pull request Nov 18, 2015
pmvieira pushed a commit to pmvieira/dokku that referenced this pull request Nov 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants