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

Attachments not working, can't upload #58

Closed
laxmanpradhan opened this issue Jul 6, 2018 · 4 comments
Closed

Attachments not working, can't upload #58

laxmanpradhan opened this issue Jul 6, 2018 · 4 comments

Comments

@laxmanpradhan
Copy link
Contributor

laxmanpradhan commented Jul 6, 2018

Trying to upload an attachment to a vault item by creating a test vault item called attachment, then click on the gear button next to it and select attachment. I have tried various photos and text files, large, small and even a 0 byte text file. The save button just spins and the file never gets attached. I have to cancel the dialogue after 5 minutes.

I am running v1.27.0 in an unraid docker. I did not set a different path for the attachments, instead I have the default path as described here: https://hub.docker.com/r/mprasil/bitwarden/ .

The bitwarden sqlite file as well as the key files are all correctly in the data folder as configured.

Docker settings in unraid:
screen

Is there a log or something I can upload? The docker container log doesn't show any indication that a file upload was attempted and I can't find any other log files.

Note, I am doing this over the local lan (http://192.168.1.31:90), the connection is unencrypted and there is no reverse proxy that may be interfering.

@dani-garcia
Copy link
Owner

That's strange, I use attachments with the docker image and they work for me.

The logs are simply printed to the console, so they should appear in the docker container log. If successful it would show something like this (with different IDs):

POST /api/ciphers/0ba6d1c1-c4a9-4290-b982-9975516f4a8a/attachment multipart/form-data; boundary=---------------------------162202440916601:
    => Matched: POST /api/ciphers/<uuid>/attachment multipart/form-data
Multipart::with_boundary(_, "---------------------------162202440916601"
    => Outcome: Success
    => Response succeeded.

If the request is made but there is an error, an error message or a panic should appear after the POST line instead. I've pushed some changes to log more posible errors, in case your problem wasn't covered.

If there aren't any logs mentioning attachments, that may mean the web-vault is not making the requests for some reason. In that case the web browser's network view (in development tools) might tell us why.

@laxmanpradhan
Copy link
Contributor Author

laxmanpradhan commented Jul 6, 2018

As I was going through the logs, I noticed that it works correctly from firefox and chrome on my Windows machine (I was trying on my Linux machine before). I updated to the latest versions on linux and restarted and now it works correctly. Thanks for your help.

As a side note, it would be nice to have the logs sent to a file rather than the console, that would make it easier to debug and also allow people to use a logging system like ELK to potentially track metrics.

This issue is closed unless you want to leave it open to potentially add a log file feature.

@dani-garcia
Copy link
Owner

The current logging is due to the web framework we use, Rocket. At the moment Rocket doen't support configuring the logging, but I know it's in the roadmap for future versions.

I'll close this issue now, and open another one for the log-to-file feature.

@mprasil
Copy link
Contributor

mprasil commented Jul 8, 2018

As a side note and perhaps workaround for @laxmanpradhan you can obviously redirect the standard output to file.

In linux the usual bitwarden_rs > logfile.log will work, I'm sure you can figure out something similar for Windows.

If you're running the server as service using systemd, (which is probably the most common init system on many recent distributions) you have the logs collected and accessible via journalctl and I'm sure other init systems can do something similar.

Last but not least, if you're running this in a docker container, you can configure docker to send the stdout to a file or even to ELK if you want.

Hopefully one of the solutions work for you.

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

3 participants