"1st argument: not an atom": How do I begin diagnosing?

Hi, I’m currently trying to setup Pleroma.Upload.Filter.Mogrify with ["strip" "auto-orient"] and Pleroma.Upload filters with ["Pleroma.Upload.Filter.Mogrify"] and just ["Mogrify"] but when I try to upload anything I get:

[error] #PID<0.18072.0> running Pleroma.Web.Endpoint (connection #PID<0.18071.0>, stream id 1) terminat>
Server: 81.130.227.124:80 (http)
Request: POST /api/v1/media
** (exit) an exception was raised:
    ** (ArgumentError) errors were found at the given arguments:

  * 1st argument: not an atom

        :erlang.apply("Pleroma.Upload.Filter.Mogrify", :filter, [%Pleroma.Upload{id: "ed005034-58e3-41ed-a3ee-91aef835bef4", name: "test.jpg", tempfile: "/tmp/plug-1717-6f-v/multipart-1717892282-29213380708-2", content_type: "image/jpeg", width: nil, height: nil, blurhash: nil, description: nil, path: "ed005034-58e3-41ed-a3ee-91aef835bef4/test.jpg"}])
        (pleroma 3.13.2) lib/pleroma/upload/filter.ex:31: Pleroma.Upload.Filter.filter/2
        (pleroma 3.13.2) lib/pleroma/upload.ex:87: Pleroma.Upload.store/2
        (pleroma 3.13.2) lib/pleroma/web/activity_pub/activity_pub.ex:1506: Pleroma.Web.ActivityPub.ActivityPub.upload/2
        (pleroma 3.13.2) lib/pleroma/web/mastodon_api/controllers/media_controller.ex:26: Pleroma.Web.MastodonAPI.MediaController.create/2
        (pleroma 3.13.2) lib/pleroma/web/mastodon_api/controllers/media_controller.ex:5: Pleroma.Web.MastodonAPI.MediaController.action/2
        (pleroma 3.13.2) lib/pleroma/web/mastodon_api/controllers/media_controller.ex:5: Pleroma.Web.MastodonAPI.MediaController.phoenix_controller_pipeline/2
        (phoenix 1.7.12) lib/phoenix/router.ex:484: Phoenix.Router.__call__/5

Any suggestions on what I could do to find out what’s causing the error? This is a brand instance I just started working on.

Edit: The version I’m using is v3.13.2, which I believe is the latest.

While trying to use Pleroma.Upload.Filter.Exiftool.StripMetadata I get the same error when uploading

The error message tells you the wrong type is used. In your config you’re using strings where a module is expected; i.e. use [Pleroma.Upload.Filter.Mogrify] instead of ["Pleroma.Upload.Filter.Mogrify"].
Look at an example config generated with the setup task

# For from source (in repo root):
MIX_ENV=prod mix pleroma.instance gen

# For OTP installs (as akkoma user; in akkoma user’s home):
./bin/pleroma_ctl instance gen
1 Like

Like any silly error I feel so stupid after it finally being fixed! :sweat_smile: Thanks!

Since I hadn’t worked with any other Elixir tooling before I did google what a atom was but I wasn’t really able to puzzle it together in the end by mysef. I don’t think configuring this in Nix really helped either, made it harder to realize the different possible outputs.

1 Like