Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Invalid signature" appears at random from different commands #26

Open
beaugunderson opened this issue Mar 26, 2013 · 12 comments
Open

"Invalid signature" appears at random from different commands #26

beaugunderson opened this issue Mar 26, 2013 · 12 comments

Comments

@beaugunderson
Copy link

I'm on Ubuntu 12.10 and hitting this very often which makes scripting the tools a huge pain.

Here's my simple repro:

#!/bin/bash

while true; do
  sdc-listmachines --limit 100 --offset 0

  EXIT_CODE=$?

  echo "Exit code: $EXIT_CODE"

  if [[ $EXIT_CODE -ne 0 ]]; then
    exit $EXIT_CODE
  fi
done
@mcavage
Copy link
Contributor

mcavage commented Mar 27, 2013

Hi Beau,

Can you dump your node version and the version of this library you're using?

@beaugunderson
Copy link
Author

◼ reginald/root ~ node -v
v0.8.22
◼ reginald/root ~ npm -g ls smartdc
/usr/local/lib
└── [email protected]

@mcavage
Copy link
Contributor

mcavage commented Mar 27, 2013

Ok, I'm getting an ubuntu machine up to see if I can repro; anecdotally I couldn't on smartos or mac.

@mcavage
Copy link
Contributor

mcavage commented Mar 27, 2013

Oh, and I should have asked - are you using SSH keys locally or with the agent, and is your key DSA or RSA (and either way, what size)?

@beaugunderson
Copy link
Author

Here's env | grep SDC:

SDC_CLI_ACCOUNT=singlyinc
SDC_CLI_IDENTITY=/root/.ssh/id_rsa
SDC_CLI_URL=https://us-east-1.api.joyentcloud.com/
SDC_CLI_KEY_ID=id_rsa

I should note that this morning it took ~50 iterations of that repro before I saw the issue.

If you have logging on the Joyent end the IP I'm coming from is 173.255.212.44.

On Wednesday, March 27, 2013 at 12:59 PM, Mark Cavage wrote:

Oh, and I should have asked - are you using SSH keys locally or with the agent, and is your key DSA or RSA (and either way, what size)?


Reply to this email directly or view it on GitHub (#26 (comment)).

@mcavage
Copy link
Contributor

mcavage commented Mar 27, 2013

Ok - I was able to get this to happen from an ubuntu client - I'm looking
into it.

On Wed, Mar 27, 2013 at 1:31 PM, Beau Gunderson [email protected]:

Here's env | grep SDC:

SDC_CLI_ACCOUNT=singlyinc
SDC_CLI_IDENTITY=/root/.ssh/id_rsa
SDC_CLI_URL=https://us-east-1.api.joyentcloud.com/
SDC_CLI_KEY_ID=id_rsa

I should note that this morning it took ~50 iterations of that repro
before I saw the issue.

If you have logging on the Joyent end the IP I'm coming from is
173.255.212.44.

On Wednesday, March 27, 2013 at 12:59 PM, Mark Cavage wrote:

Oh, and I should have asked - are you using SSH keys locally or with the
agent, and is your key DSA or RSA (and either way, what size)?


Reply to this email directly or view it on GitHub (
#26 (comment)).


Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-15551212
.

@mcavage
Copy link
Contributor

mcavage commented Mar 27, 2013

Hi Beau,

Just to confirm, I can repro this, but I need some debug logs from production to diagnose further - which currently requires a restart, so this will take a little bit to get to the bottom of - I'm sorry for the trouble this is causing you; this is definitely not expected.

m

@beaugunderson
Copy link
Author

Glad you were able to confirm, thanks for looking into this! :)

I have some code in place to retry if an sdc- command fails with Invalid signature so I'm OK for the short-term.

On Wednesday, March 27, 2013 at 3:34 PM, Mark Cavage wrote:

Hi Beau,
Just to confirm, I can repro this, but I need some debug logs from production to diagnose further - which currently requires a restart, so this will take a little bit to get to the bottom of - I'm sorry for the trouble this is causing you; this is definitely not expected.
m


Reply to this email directly or view it on GitHub (#26 (comment)).

@mcavage
Copy link
Contributor

mcavage commented Mar 29, 2013

Hi Beau,

Just as an update, since it's been a couple days, I confirmed there's something where the client is signing a date header that is sometimes different than the one the server receives (i.e., it's off by exactly 1 second every time). I'm not sure yet whether the problem is node-smartdc, restify, or node itself yet - this is definitely a new regression though that didn't used to happen. I'll update the ticket again when I have a code fix.

m

mcavage pushed a commit that referenced this issue Mar 29, 2013
mcavage pushed a commit that referenced this issue Mar 29, 2013
@mcavage
Copy link
Contributor

mcavage commented Mar 29, 2013

Hey Beau,

Ok, that took less time to track down than I thought -- can you try using it out of the #v6.5 branch and let me know if it fixes your cases? It should - the problem was that the Date header was getting dropped as the restify client was looking for date. I'll put a better fix into restify to take it case-insensitive, but for now I just made smartdc send what's expected. I suspect this broke when smartdc moved onto a newer restify, as the old one didn't try to do this.

@beaugunderson
Copy link
Author

It's done 800 iterations without failing, seems like it's fixed to me! Thanks for the quick work. :)

@mcavage
Copy link
Contributor

mcavage commented Mar 30, 2013

Great!

On Fri, Mar 29, 2013 at 4:19 PM, Beau Gunderson [email protected]:

It's done 800 iterations without failing, seems like it's fixed to me!
Thanks for the quick work. :)


Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-15665195
.

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

No branches or pull requests

2 participants