I’m working on an idea to improve comment sorting and I need to be able to get Lemmy running from source so I can implement and test it.

Right now I’m stuck on a fairly basic (I hope) problem.

I’m mostly following https://join-lemmy.org/docs/administration/from_scratch.html I’m running it on Debian instead of Ubuntu but I don’t think that’s the problem. (specifically a t2.small with the AWS Debian image). I’m also using 0.18.4 instead of 0.18.2. I also haven’t (yet) done the possibly optional step of editing postgres config to allow password authentication instead of peer authentication.

Everything seems fine until I start Lemmy. After I run

systemctl enable lemmy; systemctl start lemmy

I try

curl -I localhost:8536/api/0.18.4/site

But I get:

HTTP/1.1 404 Not Found
content-length: 0
vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers
date: Wed, 27 Sep 2023 17:51:51 GMT

When I check

journalctl -u lemmy

It does contain:

Starting http server at 127.0.0.1:8536

There are still a bunch of things I’ll be trying but I wanted to check if this is a well known problem with a simple solution.

  • aprentic@lemm.eeOP
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Thank you. I tried that and got:

    curl: (7) Failed to connect to localhost port 80 after 0 ms: Couldn’t connect to server

    When I put the port number back in:

    curl -I http://localhost:8536/api/v3/site

    I get the same 404 errors, with different time stamps.

    journalctl -u lemmy

    shows the same thing. Entries like:

    Sep 27 20:26:04 ip-172-31-44-10 lemmy_server[12299]: 2023-09-27T20:26:04.726387Z INFO actix_web::middleware::logger: 127.0.0.1 ‘HEAD /api/v3/site HTTP/1.1’ 404 0 ‘-’ ‘curl/7.88.1’ 0.000054

    I assume that /ap/v3/site is dynamically generated and there isn’t a location I can look at in the file system to make sure that everything is correct there, right?
    The instructions have you create /usr/bin/lemmy, /etc/lemmy/lemmy.hjson (outside of stuff you download to the user directory) so I don’t think there is.

    • Rikudou_Sage@lemmings.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 year ago

      Sorry, forgot to include the port. Don’t use the -I option with curl - it sends a HEAD request instead of a GET one and Lemmy doesn’t support HEAD requests (at least the site endpoint doesn’t).

      If you want to see the headers, you can use curl http://localhost:8536/api/v3/site -v (the -v means verbose).

      I assume that /ap/v3/site is dynamically generated

      Yes.

      • aprentic@lemm.eeOP
        link
        fedilink
        arrow-up
        3
        ·
        1 year ago

        Well hot damn. It worked!

        Thanks.

        Now I’m off to follow the rest of the steps. Wish me luck.