Skip to content

S3 uploads fail with Elixir 1.11

Originally reported by @kunimi53chi:

I'm facing a similar problem (#2308 (closed)). Even with the default filter settings, I got a 500 error.

Nov 16 22:18:24 ip-172-31-17-182 mix[3018]: 22:18:24.725 [info] POST /api/v1/media
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]: FIXING EXTENSION [subtype_as_extension: false, append: false, fix_extension: true, pool: Pleroma.MajicPool]
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]: 22:18:24.739 request_id=Fkf_fQx5BrjqkeMAABGi [error] Internal server error: %ArgumentError{message: "expected a keyword list, but an entry in the list is not a two-element tuple with an atom as its first element, got: {\"conten
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]: 22:18:24.740 request_id=Fkf_fQx5BrjqkeMAABGi [info] Sent 500 in 14ms
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]: 22:18:24.740 [error] #PID<0.3733.0> running Pleroma.Web.Endpoint (connection #PID<0.3732.0>, stream id 1) terminated
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]: Server: pl.komittee.net:80 (http)
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]: Request: POST /api/v1/media
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]: ** (exit) an exception was raised:
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]:     ** (ArgumentError) expected a keyword list, but an entry in the list is not a two-element tuple with an atom as its first element, got: {"content-length", 0}
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]:         (elixir 1.11.2) lib/keyword.ex:475: Keyword.keys/1
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]:         (ex_aws 2.1.3) lib/ex_aws/auth.ex:162: ExAws.Auth.build_canonical_request/5
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]:         (ex_aws 2.1.3) lib/ex_aws/auth.ex:145: ExAws.Auth.signature/8
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]:         (ex_aws 2.1.3) lib/ex_aws/auth.ex:128: ExAws.Auth.auth_header/7
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]:         (ex_aws 2.1.3) lib/ex_aws/auth.ex:46: ExAws.Auth.headers/6
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]:         (ex_aws 2.1.3) lib/ex_aws/request.ex:29: ExAws.Request.request_and_retry/7
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]:         (ex_aws 2.1.3) lib/ex_aws/operation/s3.ex:39: ExAws.Operation.ExAws.Operation.S3.perform/2
Nov 16 22:18:24 ip-172-31-17-182 mix[3018]:         (ex_aws_s3 2.0.2) lib/ex_aws/s3/upload.ex:40: ExAws.S3.Upload.initialize/2

related config?

config :pleroma, :media_proxy,
  enabled: false,
  redirect_on_failure: true

config :pleroma, Pleroma.Upload,
  uploader: Pleroma.Uploaders.S3,
  link_name: false

config :pleroma, Pleroma.Uploaders.S3,
  bucket: "media.pl.komittee.net",
  streaming_enabled: true,
  public_endpoint: "https://media.pl.komittee.net",
  truncated_namespace: ""

# Configure S3 credentials:
config :ex_aws, :s3,
  access_key_id: "*******",
  secret_access_key: "*******",
  region: "ap-northeast-1",
  scheme: "https://"
Edited by feld