mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-08-27 05:35:03 -05:00
[GH-ISSUE #309] Error When Updating Secret on Mac Client: "Couldn't Parse JSON body: Error("missing field Key", line: 1, column: XXXX)"
#8981
Reference in New Issue
Block a user
Originally created by @AndrewPaglusch on GitHub (Dec 24, 2018).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/309
Environment Information
Docker Image: mprasil/bitwarden:latest (Fully up-to-date. Image ID: 68111df54627)
Bitwarden Mac Client: v1.11.2 on macOS High Sierra
Bitwarden Android Client: v1.21.0 on Android 9 (Path Level Dec 5, 2018)
Docker Compose Configuration
Nginx Configuration
Problem
When trying to save a specific entry on the Mac client, the following error is logged in the docker container:
The following is logged in the Nginx access log:
Nothing is logged to the Nginx error log.
The client displays the following message. The entry is never saved.
This seems similar to this issue: #253
What Works
So far, I have only experienced this issue with this one entry.
What I've Already Tried:
@AndrewPaglusch commented on GitHub (Dec 24, 2018):
I just found something interesting. This secret had a
.jsonfile attached to it. I removed the JSON attachment, re-synced the vault, and then was able to edit the secret without any problems. If I re-add the attachment and then save and re-sync the vault, I am no longer able to make changes to the secret again.Is it possible that the JSON attachment is being parsed? I've just verified that it's valid JSON, if that makes any difference.
@dani-garcia commented on GitHub (Dec 24, 2018):
The file format shouldn't matter, as it would be sent already encrypted, so I imagine it would happen with any file type. Can you check what data is sent from the developer tools (View > Toggle Dev Tools > Network > Select XHR Only)?
I don't have a Mac to test, but when I try to update a cipher with an attachment from the web vault, it sends something like this:
It should be the same for the mac client. Does it work for you from the web vault?
The error seems to imply that the
keyinsideattachments2is not being sent for some reason. The individual keys per attachment is a recent change, so I can see how an old attachment that hasn't been migrated to the new model might fail here, but if you re-addded the attachment in the new version then I don't know why it's breaking.@AndrewPaglusch commented on GitHub (Dec 24, 2018):
Editing this secret fails in the web vault. I get a message saying "An error has occurred. Attachment doesn't exist"
Mac Client JSON Request
I'm not sure what portions of this are sensitive (if any), so I've redacted portions of it. I hope this doesn't make it difficult for you to debug.
Mac Client JSON Reply
@dani-garcia commented on GitHub (Dec 24, 2018):
Strange that it can't seem to find the attachment, does the clip icon appear next to the cipher name, and does the filename appear correctly in the attachments list?
Do you get any error when uploading the attachment?
Also, I just noticed that you use the server admin feature, can you try disabling it? We've had problems with it in the past, the next version will come with a proper admin panel.
@AndrewPaglusch commented on GitHub (Dec 24, 2018):
Yes, the paperclip icon is shown next to the entry. The attachment can be downloaded without any problems and the name of the attachment is also displayed correctly. I've just tried uploading a new attachment (web vault) and received no issues/errors.
I'll go ahead and disable that server admin line. Thanks for that info!
@mprasil commented on GitHub (Dec 26, 2018):
Did that help? I suspect the usage of admin was the root cause here. This is not recommended and will break stuff in strange ways.
@AndrewPaglusch commented on GitHub (Dec 26, 2018):
I removed that line and re-created the container. Now I'm getting an error on the Mac client that says "An error has occurred. Attachment doesn't exist" when I try to save this secret.
On the server, the following is logged:
@mprasil commented on GitHub (Dec 26, 2018):
Can you try and re-add attachment?
@AndrewPaglusch commented on GitHub (Dec 26, 2018):
After removing the attachment and syncing the vault, I was able to save edits to the secret without any issues. After re-adding the attachment, the problem came back.
@dani-garcia commented on GitHub (Jan 11, 2019):
Hey, @AndrewPaglusch, I just pushed a change to fix your last error (
Attachment doesn't exist) in6f52104324. Can you test it?@AndrewPaglusch commented on GitHub (Jan 11, 2019):
This resolved my issue. Thank you very much!