himynameisdave / git-labelmaker

:flags: Manage your GitHub labels from the command line!
MIT License
575 stars 33 forks source link

Error: Encrypted content has been tampered with #32

Closed anbinh closed 8 years ago

anbinh commented 8 years ago

I got this error when running the program

capture d ecran 2016-02-22 a 12 21 17
➜ ~/www/veldto.com (master) git-labelmaker
? What is your master password? *********
Failed opening archive: Error: Encrypted content has been tampered with
{ id: 'TOKEN',
  err: 'Failed opening archive: Error: Encrypted content has been tampered with' }
himynameisdave commented 8 years ago

@anbinh not cool... thanks for reporting, what version of node are you currently running (node -v)?

jaimeeee commented 8 years ago

The same thing is happening to me, my node version is 5.6.0.

kevmoo commented 8 years ago

Ditto, with git-labelmaker 0.7.0

himynameisdave commented 8 years ago

Tested on node v5.5.0and it works, something about v5.6.0... Still investigating

jaredmichaelwilliams commented 8 years ago

@himynameisdave I'm on v5.5.0 and I'm getting that error

Jared@Jared-Williams-iMac /git/artbinder/ArtbinderMobile [master *]
± % node -v                                                                                                                                                                                                                                                                                                                                                                                            !39096
v5.5.0

Jared@Jared-Williams-iMac /git/artbinder/ArtbinderMobile [master *]
± % git-labelmaker                                                                                                                                                                                                                                                                                                                                                                                     !39097
? What is your master password? ****************************************
Failed opening archive: Error: Encrypted content has been tampered with
{ id: 'TOKEN',
  err: 'Failed opening archive: Error: Encrypted content has been tampered with' }
himynameisdave commented 8 years ago

Thanks still looking into this...

alchenist commented 8 years ago

node v5.4.1 and also getting this error. Got prompted for master password without passing in token or an initial password.

C:\Users\AC\Projects\test>node -v
v5.4.1

C:\Users\AC\Projects\test>git-labelmaker
? What is your master password?
Failed opening archive: Error: Encrypted content has been tampered with
{ id: 'TOKEN',
  err: 'Failed opening archive: Error: Encrypted content has been tampered with' }
jaredmichaelwilliams commented 8 years ago

@himynameisdave Hey, so i reverted back to

commit 2be40beaacc90a6e4b11d629da0704a0ac2e23ca
Author: dlunny <dlunny@parka.ca>
Date:   Sun Feb 21 21:40:59 2016 -0500

    Readme cleanup

and rebuilt and now its working on 5.6.0

himynameisdave commented 8 years ago

@Jameskmonger any ideas what's going on here?

Jameskmonger commented 8 years ago

@himynameisdave

I believe that error is actually the "invalid password" error... Are you guys putting in the wrong password?

jaredmichaelwilliams commented 8 years ago

@Jameskmonger this is the first time i tried to use it, i never even got to put in a token or password.

himynameisdave commented 8 years ago

Yeah @Jameskmonger you're right about it being an invalid password error, but the real problem is that it's expecting a password before the user has even set it, like @jaredmichaelwilliams is saying... hmmmm... (╯°□°)╯︵ ┻━┻

Jameskmonger commented 8 years ago

@jaredmichaelwilliams ah okay, in that case I think I might know what the issue is. @himynameisdave could you assign this to me please?

himynameisdave commented 8 years ago

@Jameskmonger it's all you man! I'm still l:eyes:king into this though...

Jameskmonger commented 8 years ago

This is now ready for code review in #32.

@jaredmichaelwilliams if you wouldn't mind, could you clone the branch 32-fix and run sudo npm install -g ./ in the directory? This will install the version 0.7.1-alpha which should fix this issue. Please let me know.

Jameskmonger commented 8 years ago

Issue still persisting in 0.7.1-alpha, node 5.6.0

himynameisdave commented 8 years ago

Damn. Can we isolate it to just that version of node? If so, then maybe we can see if there was some change that might have caused this...?

Maybe it's an issue with buttercup?

Jameskmonger commented 8 years ago

Issue is also appearing on node 5.0.0 @himynameisdave

Jameskmonger commented 8 years ago

Oddly enough @himynameisdave the issue doesn't seem to appear when running locally with either of the following two commands:

sudo npm install -g ./ && git-labelmaker

(install the local version of the package and run the global git-labelmaker command)

npm install && node bin/index.js

(install all dependencies and then run the local index.js file)

However the following installation process does introduce the error:

sudo npm install -g git-labelmaker@0.7.1-alpha && git-labelmaker

This makes me think there is possibly an issue in the publishing process between what is being published and what is being downloaded through npm...

Jameskmonger commented 8 years ago

@himynameisdave I've done a fresh clone of the repo's master branch as it is at the moment, and then I published it to npm under the name git-labelmaker-32fix. I then ran the following commands:

$ sudo npm install -g git-labelmaker-32fix
$ git-labelmaker

And the command works correctly, detecting that I have not yet chosen a token and prompting me as intended. There appears to be some kind of issue with the release that has been uploaded onto npm as git-labelmaker.

If you're willing to add me as a collaborator on npm I will be able to take a look at it in the morning!

Good luck :beers:

himynameisdave commented 8 years ago

@Jameskmonger will do, meantime still trying to get to the bottom of this...

Jameskmonger commented 8 years ago

No problem @himynameisdave. I've tested git-labelmaker-32fix on node v5.6.0 and v5.0.0 and it's behaving as expected, while git-labelmaker@0.7.1-alpha is encountering the bug on the same versions. It's very odd, not sure how or why that could have happened.

Potentially your local git repo had some kind of issue before you ran npm publish? Seems a bit of a stretch, though...

alchenist commented 8 years ago

On a fresh install of git-labelmaker@0.7.0 from npm, noticed that there was an existing .git-labelmaker.bcup archive in the node_modules\git-labelmaker directory. Deleted this and everything worked fine. Somewhere along the line, an existing credentials archive is being included in the version published to npm.

Jameskmonger commented 8 years ago

That makes perfect sense @alchenist!

@himynameisdave, we will need to add .git-labelmaker.bcup to .npmignore and republish on npm (probably best to publish as 0.7.2)

totobest commented 8 years ago

Thank you @alchenist, I executed this command to delete the .git-labelmaker.bcup in the global packages of node and everything worked fine. rm -f /usr/local/lib/node_modules/git-labelmaker/.git-labelmaker.bcup

himynameisdave commented 8 years ago

@alchenist @Jameskmonger You guys are awesome, thanks for getting to the bottom of this! :+1: :smile: :tada:

I should always create an .npmignore file when starting a new project, even if in my mind I don't think I'll need it.

Jameskmonger commented 8 years ago

No problem @himynameisdave! I've made a pull request which should solve this.

Jameskmonger commented 8 years ago

This is now solved in version 0.7.2.

Thanks for your help in diagnosing this issue: @anbinh, @jaimeeee, @kevmoo, @jaredmichaelwilliams, @alchenist, @mrbaguette :fireworks:

You can download the new version with the following command:

sudo npm install -g git-labelmaker