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

Sync failure due to secret fields #9

Closed
AndreasBackx opened this issue Jun 24, 2019 · 9 comments
Closed

Sync failure due to secret fields #9

AndreasBackx opened this issue Jun 24, 2019 · 9 comments

Comments

@AndreasBackx
Copy link

Running the bitw sync command for the first time results in an unauthorized error, though I am fairly certain that I got my password correct. I'd love to try and enter my password again, but I don't see how I would do that.

$ [email protected] bitw sync
Password: 
error: could not sync: Unauthorized: 

Then running the same command again results in a huge JSON dump (which I'm not going to share for obvious reasons) and the following error:

error: could not sync: json: cannot unmarshal object into Go struct field Cipher.Fields of type string

If you have any questions, let me know as I understand that you probably need the JSON dump for debugging. But I hope you understand that I cannot provide that, though I can answer the questions you have about it.

@mvdan
Copy link
Owner

mvdan commented Jun 25, 2019

You can always try to log in again via bitw login.

When you get the Cipher.Fields error, what's does your bitw/data.json file look like? That is, what kind of data is under that path? The directory is under UserConfigDir, as per golang/go#29960.

Finally, do you have two-factor auth enabled?

If you share your contact details I can give you the password for my dummy test account. If you can reproduce the issue with that, you can share all the data then, as it has no sensitive information.

@AndreasBackx
Copy link
Author

AndreasBackx commented Jun 25, 2019

You can always try to log in again via bitw login.

Logging in with bitw login seems to work, I don't get any error or output after the password prompt. It still results in the same json unmarshal error when using sync though.

When you get the Cipher.Fields error, what's does your bitw/data.json file look like? That is, what kind of data is under that path? The directory is under UserConfigDir, as per golang/go#29960.

{
	"DeviceID": "REDACTED",
	"AccessToken": "REDACTED",
	"TokenExpiry": "2019-06-25T23:40:19.257287492Z",
	"KDF": 0,
	"KDFIterations": 100000,
	"LastSync": "0001-01-01T00:00:00Z",
	"Sync": {
		"Profile": {
			"ID": "",
			"Name": "",
			"Email": "",
			"EmailVerified": false,
			"Premium": false,
			"MasterPasswordHint": "",
			"Culture": "",
			"TwoFactorEnabled": false,
			"Key": "",
			"PrivateKey": "",
			"SecurityStamp": "",
			"Organizations": null
		},
		"Folders": null,
		"Ciphers": null,
		"Domains": {
			"EquivalentDomains": null,
			"GlobalEquivalentDomains": null
		}
	}
}

Finally, do you have two-factor auth enabled?

I do not have 2FA enabled, I should though and I will. Does bitw support 2FA?

If you share your contact details I can give you the password for my dummy test account. If you can reproduce the issue with that, you can share all the data then, as it has no sensitive information.

I'll email you using the email address on your website.

@mvdan
Copy link
Owner

mvdan commented Jun 25, 2019

Hmm, sync is just failing entirely then.

I do not have 2FA enabled, I should though and I will. Does bitw support 2FA?

It does. There's a test for it, even.

I'll email you using the email address on your website.

I've emailed you the passwords for the dummy test accounts.

@AndreasBackx
Copy link
Author

Okay so I've tested it with the information you gave and the sync seems to run without any output/error. What would you like me to test next perhaps?

@mvdan
Copy link
Owner

mvdan commented Jun 25, 2019

Ah, I have an idea. None of my tests have any secret fields, so maybe I just got the decoding bit wrong. Let me give it a try.

@mvdan
Copy link
Owner

mvdan commented Jun 25, 2019

Yeah, that was it - I can reproduce now that I've added fancier secrets to my test account. Should be fixed soon.

@mvdan mvdan changed the title Unauthorized followed by unmarshal failure Sync failure due to secret fields Jun 25, 2019
@AndreasBackx
Copy link
Author

Sweet, thanks for being so quick to respond. Let me know when I can give it a shot.

@mvdan mvdan closed this as completed in dea7778 Jun 25, 2019
@mvdan
Copy link
Owner

mvdan commented Jun 25, 2019

I've fixed the error, though you can't use the custom fields in any way yet.

@AndreasBackx
Copy link
Author

Thanks once more, sync seems to work now. 😀

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