Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

uploads_path not being used for in-progress uploads #6567

Closed
typokign opened this issue Dec 18, 2019 · 1 comment
Closed

uploads_path not being used for in-progress uploads #6567

typokign opened this issue Dec 18, 2019 · 1 comment
Assignees

Comments

@typokign
Copy link

Description

Despite what homeserver.yaml implies, Synapse is not storing in-progress uploads in uploads_path.

For reference, the comment in the sample homeserver.yaml reads: # Directory where in-progress uploads are stored.

I am running Synapse in a read-only root filesystem with writes allowed in /data/uploads. I have set uploads_path: "/data/uploads" in my homeserver.yaml. When attempting to upload an image to Synapse, the upload fails and Synapse logs:

2019-12-18 21:27:07,667 - synapse.http.site - 203 - WARNING - - Error processing request <XForwardedForRequest at 0x7f99e3fb8c90 method='(no method yet)' uri='(no uri yet)' clientproto='(no clientproto yet)' site=8008>: <class 'FileNotFoundError'> [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']

(note that /data/uploads is not listed as a candidate for temporary uploads in the list at the end of the log)

Steps to reproduce

  • Configure Synapse in a docker container or other host, run as a user without write permissions on /
  • Allow write access to /data/uploads
  • Configure homeserver.yaml with: uploads_path: "/data/uploads"
  • Start Synapse, join a room, and upload any image via Riot (or any other client)

The image will fail to upload and a message similar to this will be logged:

2019-12-18 21:27:07,667 - synapse.http.site - 203 - WARNING - - Error processing request <XForwardedForRequest at 0x7f99e3fb8c90 method='(no method yet)' uri='(no uri yet)' clientproto='(no clientproto yet)' site=8008>: <class 'FileNotFoundError'> [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']

/data/uploads is not listed as a candidate temporary directory in the error message

Version information

  • Homeserver:

In a Docker image of Synapse, not a public homeserver

  • Version: 1.7.0

  • Install method: matrixdotorg/synapse Docker image

  • Platform: Linux (Docker)
@richvdh
Copy link
Member

richvdh commented Jan 3, 2020

well, indeed.

Apparently, uploads_path is only used to serve content from an undocumented /_matrix/content API. As far as I can tell, this is a vestige of an API that was removed back in 2016: #888

so certainly the documentation for uploads_path is completely bogus... but really it needs to just go away.

richvdh added a commit that referenced this issue Jan 3, 2020
This looks like it got half-killed back in #888.

Fixes #6567.
richvdh added a commit that referenced this issue Jan 3, 2020
This looks like it got half-killed back in #888.

Fixes #6567.
@richvdh richvdh closed this as completed Jan 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants