Solution

The Lemmy server appears to have a database limit of 255 characters [2]; however, individual instances appear to put their own limits on username length though the frontend [3] and/or the API [4.1][4.2].

Original Post

If you know, please also provide relevant documentation.

UPDATE (2025-02-02T06:06Z): I did some brute-force testing, and, at least for sh.itjust.works, it seems that the maximum username length is 50, and the maximum password length is 60 [1].


References
  1. “Sign Up”. sh.itjust.works. Lemmy. Accessed: 2025-02-02T08:49Z. https://sh.itjust.works/signup.
    • When creating an account on sh.itjust.works, the sign-up form will throw this error if the provided password is greater than 60 characters in length.
  2. @[email protected] To: [“[SOLVED] What is the maximum username length for a Lemmy account?”. “Kalcifer” @[email protected]. “Lemmy Support” [email protected]. sh.itjust.works. Lemmy. Published: 2025-02-03T00:54:51Z. https://sh.itjust.works/post/32085936.]. Published: 2025-02-02T05:57:26Z. Accessed: 2025-02-03T00:44Z. https://sh.itjust.works/post/32085936/16442382.

    It might be 255 characters? […]

    • They pointed to code on GitHub for the Lemmy server which outlines the length of the username data in the SQL database.
  3. “[SOLVED] What is the maximum username length for a Lemmy account?”. “Kalcifer” @[email protected]. “Lemmy Support” [email protected]. sh.itjust.works. Lemmy. Published: 2025-02-03T00:54:51Z. Accessed: 2025-02-03T00:46Z. https://sh.itjust.works/post/32085936.
    • §“Original Post”. ¶2.

      […] I did some brute-force testing, and, at least for sh.itjust.works, it seems that the maximum username length is 50 […]

      • The maximum username length for sh.itjust.works was found to be 50 characters by brute-force testing the length limit.
  4. “Andrew” @[email protected] To [“[SOLVED] What is the maximum username length for a Lemmy account?”. “Kalcifer” @[email protected]. “Lemmy Support” [email protected]. sh.itjust.works. Lemmy. Published: 2025-02-03T00:54:51Z. https://sh.itjust.works/post/32085936.] Published: 2025-02-02T19:57:49Z. Accessed: 2025-02-03T00:59Z. https://sh.itjust.works/post/32085936/16453656.
    1. curl -L http://lemmy.world/api/v3/site | jq -r .site_view.local_site.actor_name_max_length (26)

      • The maximum username length for Lemmy.world was found to be 26 characters via an API request.
    2. curl -L http://sh.itjust.works/api/v3/site | jq -r .site_view.local_site.actor_name_max_length (50)

      • The maximum username length for sh.itjust.works was found to be 50 characters via an API request.
  • Andrew@piefed.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    4 days ago

    I’m not used to this level of rigour to be honest. You’ve accepted your own unscientific prodding of one particular instance as an answer, and one link to a years-old migration as a answer, but I give you reproducible command-line instructions, which match up with your own findings, and it’s apparently not good enough.

    Anyway, as that migration shows, Lemmy distinguishes between ‘name’ for username, and ‘display_name’ for the display name. A better link for this is arguably https://github.com/LemmyNet/lemmy/blob/main/crates/db_schema/src/schema.rs#L735 but whatever. It’s these fields that are relevant to Lemmy’s API, not the terminology that ActivityPub uses. A client might reasonably want to know the limit for a username (as provided in the Site response), because it’s this that’s used for Signup and Login. Display name is set elsewhere, once that’s done, so it doesn’t make sense for actor_name_max_length to refer to this.

    Within ActivityPub, the distinction between username and display name is ‘preferredUsername’ and ‘name’, but AP also uses ‘name’ for a bunch of other things (including but not limited to what becomes a post title, a choice in a poll, or the alt-text for an image). There’s some overlap with how Lemmy’s API refers to stuff (e.g. a post title is a post name), but it not a 1:1 match.

    I hope this is enough. I don’t even use Lemmy, so - in my opinion - you’re asking the wrong question to the wrong person. What you should be asking, is - “How come when I post a question to Lemmy’s support community, on the instance owned by Lemmy devs, it looks like they just ignore it?”. You shouldn’t have to be relying on guesswork by amateurs, irrespective of how many ‘references’ they can quote.

    • KalciferOP
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      […] It’s these fields that are relevant to Lemmy’s API, not the terminology that ActivityPub uses. […]

      Fair point! I was incorrectly assuming that Lemmy’s terminology directly matched that of ActivityPub.

    • KalciferOP
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      3 days ago

      […] Lemmy distinguishes between ‘name’ for username, and ‘display_name’ for the display name. A better link for this is arguably https://github.com/LemmyNet/lemmy/blob/main/crates/db_schema/src/schema.rs#L735 but whatever. It’s these fields that are relevant to Lemmy’s API, not the terminology that ActivityPub uses. A client might reasonably want to know the limit for a username (as provided in the Site response), because it’s this that’s used for Signup and Login. Display name is set elsewhere, once that’s done, so it doesn’t make sense for actor_name_max_length to refer to this.

      Within ActivityPub, the distinction between username and display name is ‘preferredUsername’ and ‘name’, but AP also uses ‘name’ for a bunch of other things (including but not limited to what becomes a post title, a choice in a poll, or the alt-text for an image). There’s some overlap with how Lemmy’s API refers to stuff (e.g. a post title is a post name), but it not a 1:1 match. […]

      Thank you for providing this information.

    • KalciferOP
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      […] You shouldn’t have to be relying on guesswork by amateurs, irrespective of how many ‘references’ they can quote.

      I think you are misunderstanding how I am using references. They are only being used to point to the origin of a bit of knowledge. Their existence does not guarantee any level of accuracy.

      • Andrew@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 days ago

        I think the way you were using references started to wind me up. It gave some academic veneer to a format that usually more conversational. They’re just links to what some people reckon, but dressed up with ‘accessed’ and ‘published’ in a footnote format that in other other contexts would suggest a level of credibility that they don’t have. Either something is solved or it isn’t, but it shouldn’t be marked ‘solved’ with links to answers of questionable accuracy.

        • KalciferOP
          link
          fedilink
          arrow-up
          1
          ·
          2 days ago

          […] Either something is solved or it isn’t, but it shouldn’t be marked ‘solved’ with links to answers of questionable accuracy.

          This is a fair point, I think. Do you propose an alternative word? At what point would you say that it is justified to use “solved”? I used “solved” because, for my purposes, the question is answered (I know now that SJW has a max username length of 50, which is the only information that I personally needed).

          • Andrew@piefed.social
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 days ago

            I don’t know. I’m still hung up about this ‘references’ thing, I think. It reads like you intend for your post to be an objective resource for others to use, but then fall back to it being good enough for your subjective purpose when questioned about it.

            It feels like wanting to have your cake and eat it - a authoritative-looking post that isn’t authoritative.

            • KalciferOP
              link
              fedilink
              arrow-up
              1
              ·
              18 hours ago

              […] a authoritative-looking post […]

              What do you mean by this exactly? Is it synonymous with your usage of “objective resource”?

            • KalciferOP
              link
              fedilink
              arrow-up
              1
              ·
              edit-2
              18 hours ago

              It reads like you intend for your post to be an objective resource for others to use, but then fall back to it being good enough for your subjective purpose when questioned about it.

              First, what do you exactly mean by “objective resource”? Second, what makes you think that it’s intended to be an “objective resource”? Are you saying that my use of citations gives you that impression?

        • KalciferOP
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          2 days ago

          […] They’re just links to what some people reckon, but dressed up with ‘accessed’ and ‘published’ in a footnote format that in other other contexts would suggest a level of credibility that they don’t have. […]

          This may be how you are interpreting it, but I assure you that isn’t how I am using it. I personally try to make that clear through the language that I pair with it. For example my usage of the word “appears” in the post suggests, imo, that something is likely, but not necessarily factual given the current body of evidence (as provided by sources), but it carries potential of being incorrect. I recognize that my understanding of things may be flawed, so I leave a sort of “trail of breadcrumbs” to where I found information for others (like yourself) to verify and/or dispute.

        • KalciferOP
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          2 days ago

          […] It gave some academic veneer to a format that usually more conversational. […]

          I would argue that this is argument is moot given that this community, or at the very least this post, isn’t exactly the place for casual conversation, as it is a support community.

    • KalciferOP
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      […] What you should be asking, is - “How come when I post a question to Lemmy’s support community, on the instance owned by Lemmy devs, it looks like they just ignore it?”. […]

      I have no reason to expect any obligatory answer from anybody. IMO, it would be very entitled of me, or anyone else, to expect otherwise.

      • Andrew@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 days ago

        Is it? Maybe. If I was using software, and asked a question that the developers of it could easily answer, and they didn’t, I might think about using something else. It certainly would’ve helped though, if you’d got an answer from someone you were more ready to believe.

        • KalciferOP
          link
          fedilink
          arrow-up
          1
          ·
          2 days ago

          […] It certainly would’ve helped though, if you’d got an answer from someone you were more ready to believe.

          Believing a Lemmy developer’s claim simply because they are a developer of Lemmy is an appeal to authority, imo. I would still ask for some documentation as proof, or for them to point to functionality within the code, or similar.

        • KalciferOP
          link
          fedilink
          arrow-up
          1
          ·
          2 days ago

          […] If I was using software, and asked a question that the developers of it could easily answer, and they didn’t, I might think about using something else. […]

          There is no contractual obligation for the Lemmy developers to provide me with any service [1]. I would agree insofar that I think that there is some level of advertisement provided by their behavior towards their base, but I personally don’t feel entitled to anything. Of course, this is just my personal opinion.

          References
          1. File: “LICENSE”. LemmyNet/Lemmy. GitHub. Commit: 8ece275. Published: 2019-02-14T17:17:18.000Z. Accessed: 2025-02-05T02:26Z. URI: https://github.com/LemmyNet/lemmy/blob/main/LICENSE.
    • KalciferOP
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      […] I don’t even use Lemmy, so - in my opinion - you’re asking the wrong question to the wrong person. […]

      I don’t know you, so how would I know what your level of expertise is regarding Lemmy? You are the one that commented on my post…

      • Andrew@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 days ago

        I think you can be an outsider to a particular system, and still be able to provide valuable information about it. Enough to be able to satisfy your own curiosity, and hopefully someone else’s too. I can imagine a version of this post where you asked what the max username length was, I gave you a means to find out, and we both went on our way. So you can be ‘right person’ to comment on a post, but the ‘wrong person’ when it turns out that your answer isn’t going to be fully accepted without digging into someone else’s source code. As for who the right person is in that case, there’s some overlap with your comment about ‘entitlement’, so I’ll continue there.

        • KalciferOP
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          2 days ago

          I think you can be an outsider to a particular system, and still be able to provide valuable information about it. […]

          I completely agree! It is also illogical to argue otherwise ­— sort of an appeal to authority, imo.

          For clarity, I wasn’t claiming that you were incorrect due to your self-professed insufficient level of expertise. I was simply responding to your argument that “it’s silly to ask you for advice because you don’t use Lemmy” by arguing that your premise is unjustified — your argument is valid; however, I don’t think that it’s sound. I interpret your logic as follows:

          1. (By your argument) If one is inexperienced with Lemmy, then it is unwise to ask their opinion.
          2. You claimed that you are inexperienced with Lemmy.
          3. Therefore, it is unwise to ask you for your opinion.

          This is a valid argument, as it follows by modus ponens; however, it is unsound, as the premise is not epistemologically justified, as I cannot know, pior to you telling me, what your experience is with Lemmy. Hence why I said:

          I don’t know you, so how would I know what your level of expertise is regarding Lemmy?

          • Andrew@piefed.social
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 days ago

            it’s silly to ask you for advice because you don’t use Lemmy

            That was never my argument. I think you know this.

            Being reluctant to answer any more questions about a topic doesn’t mean I was wrong to provide an initial answer. It just means my bandwidth has been exceeded. If Lemmy was a project I was invested in, and I didn’t think your second follow-up question was disingenuous, then it would’ve been different, but as things were, I resented being given homework about it.

            • KalciferOP
              link
              fedilink
              arrow-up
              1
              ·
              19 hours ago

              If […] I didn’t think your second follow-up question was disingenuous […]

              For clarity, it wasn’t intended to be disingenuous. I apologize if I gave you that impression. I’m always trying to improve how I interact with others.

            • KalciferOP
              link
              fedilink
              arrow-up
              1
              ·
              edit-2
              19 hours ago

              That was never my argument. I think you know this. […] Being reluctant to answer any more questions about a topic doesn’t mean I was wrong to provide an initial answer. It just means my bandwidth has been exceeded. […]

              Perhaps I misunderstood you. When I read this:

              I don’t even use Lemmy, so - in my opinion - you’re asking the wrong question to the wrong person.

              I interpreted it to litterally mean that I shouldn’t ask you questions about Lemmy because you don’t use it. I interpret your statement that you don’t use Lemmy to mean that you are less likely to have knowledge about Lemmy because you don’t use it.

              At any rate, this is moot, as I mentioned above that I cannot know, prior to you telling me, what your experience is. And furthermore, I didn’t ask you anything. You volunteered an answer.

    • KalciferOP
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      […] I give you reproducible command-line instructions, which match up with your own findings, and it’s apparently not good enough. […]

      Did you perhaps not see that I cited your comment’s findings as a source for the solution…? Or is it that you can’t believe that I would dare to exhibit any amount of skepticism of your claim?

      • Andrew@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 days ago

        I saw your edit, yeah. I’m not some precious person who thinks no-one should dare question their claims. To my mind, though, what I said wasn’t a claim. A claim would be if I’d said “lemmy.world is 26, sh.itjustworks is 50” with no further info. Instead, I gave command-line instructions for you to run yourself, so you could get the answers for those instances (and any other instances) from Lemmy’s backend itself. If I wasn’t reasonably sure that the backend was giving you the numbers you were looking for, I wouldn’t have mentioned it.

        I wasn’t reacting to being questioned, though, I was reacting to being singled-out for being questioned. You marked this as “Solved” based - also - on a test from you, and an answer from TootSweet, but it didn’t look like to me that you ever questioned whether those answers deserved a follow-up. Neither of those, in my opinion, are really good enough, but I’ll say why in the answers to your individual comments about them.

        • KalciferOP
          link
          fedilink
          arrow-up
          1
          ·
          2 days ago

          […] I wasn’t reacting to being questioned, though, I was reacting to being singled-out for being questioned. You marked this as “Solved” based - also - on a test from you, and an answer from TootSweet, but it didn’t look like to me that you ever questioned whether those answers deserved a follow-up. Neither of those, in my opinion, are really good enough, but I’ll say why in the answers to your individual comments about them.

          This isn’t to discredit how you have internalized the exchange, so I apologize if I made you feel this way, but I want to assure you that it wasn’t my intent to single you out. I was simply looking for clarification because I felt that I might’ve found a potential ambiguity that I personally wasn’t sure of.

        • KalciferOP
          link
          fedilink
          arrow-up
          1
          ·
          2 days ago

          […] To my mind, though, what I said wasn’t a claim. A claim would be if I’d said “lemmy.world is 26, sh.itjustworks is 50” with no further info. Instead, I gave command-line instructions for you to run yourself, so you could get the answers for those instances (and any other instances) from Lemmy’s backend itself. […]

          Eh, this is becoming rather pedantic, imo. I’m not sure what point you are trying to make.

          • Andrew@piefed.social
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 days ago

            I made one arsey comment, and you replied to it 9 times. It was only ever going to get pedantic. It’s too late to complain about it now.

            • KalciferOP
              link
              fedilink
              arrow-up
              1
              ·
              18 hours ago

              […] you replied to it 9 times. […]

              I personally try to keep my responses atomic to the topic.

            • KalciferOP
              link
              fedilink
              arrow-up
              1
              ·
              18 hours ago

              […] It’s too late to complain about it now.

              I’m not complaining, I just didn’t understand what the point was that you were trying to make.

        • KalciferOP
          link
          fedilink
          arrow-up
          1
          ·
          2 days ago

          I saw your edit, yeah. […]

          Then what is it about me using your comment as a source makes you think that I viewed your response as “not good enough”?

          • Andrew@piefed.social
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 days ago

            Nothing. It wasn’t about the edit.

            I’ve said elsewhere that I thought your second follow-up question was disingenuous, so I’ll expand on that here. That’s the thing that annoyed me. Not because I think no-one should question me, or because no-one should inquire further, but because the more questions you want to ask about a particular thing, the more informed those questions need to be. Otherwise it just gets tedious, explaining why irrelevant things are irrelevant. User display names aren’t relevant to an API’s ‘/site’ response; ActivityPub isn’t relevant at all, and ‘name’ is such a generic, widely-used word, that reaching for it as evidence that I might be confused is such a stretch, I don’t know why you’d go for it. It made me question your motive, given that the likelihood of you being correct - after fishing a word out from something you don’t seem that experienced with - is so low. It stops reading as a well-intentioned question, and starts reading as scepticism for scepticism’s sake.

            • KalciferOP
              link
              fedilink
              arrow-up
              1
              ·
              18 hours ago

              […] reaching for it as evidence that I might be confused is such a stretch […]

              I suspect this statement is the source of all of this. When I sent this comment, I wasn’t trying to do some “gotcha”. I thought we were, in a sense, investigating together through documentation to try an find the right answer to the question. From my perspective, you provided an idea of what it could be, and I was trying to work with you to narrow down if that was for sure what we were looking for by providing some documentation that I came across. I wasn’t trying to insult your intelligence, or belittle you or your help. I simply thought we were brainstorming together.

    • KalciferOP
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      3 days ago

      You’ve accepted […] one link to a years-old migration as [an] answer,

      […] as that migration shows […]

      I’m not sure what you are referring by “migration”. Could you clarify?

    • KalciferOP
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      […] You’ve accepted your own unscientific prodding of one particular instance as an answer […]

      What exactly do you think is unscientific about it?

      • Andrew@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 days ago

        I used ‘unscientific’ because it would be a pain in the arse for someone else to reproduce, it only applies to one instance, it’s a test on someone else’s in-production system that you have no control over, and the error that returns isn’t necessarily from the backend. It looks more like a Form Validation error (i.e. from the frontend). It’s perfectly possible to create a frontend that puts it’s own limits on username length, and there’s some that no doubt already exist, so a brute-force test of those limits isn’t telling you anything reliable about what Lemmy’s internal limits are.

        • KalciferOP
          link
          fedilink
          arrow-up
          1
          ·
          2 days ago

          […] It’s perfectly possible to create a frontend that puts it’s own limits on username length, and there’s some that no doubt already exist, so a brute-force test of those limits isn’t telling you anything reliable about what Lemmy’s internal limits are.

          I don’t dispute your concern; however, for my needs, in all practical purposes, if the frontend did place its own unique restrictions on the username length, it wouldn’t matter, as the uncertainty of the length of the username when creating an account through the frontend is why I created this post.

          That being said, I think it’s worth distinguishing between the two (API and frontend) in the solution section of my post. I will update it.

        • KalciferOP
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          2 days ago

          I used ‘unscientific’ because it would be a pain in the arse for someone else to reproduce […]

          This is obviously an argument of definitions, but, at any rate, I disagree that a qualification for something to be scientific is that it must be easily reproducible; for something to be scientific it simply simply must be reproducible [1[2[3]]].

          References
          1. Word: “scientific”. Merriam-Webster. Accessed: 2025-02-06T03:48Z. URI: https://www.merriam-webster.com/dictionary/scientific.
            • §“adjective”

          2. Word: “science”. Merriam-Webster. Accessed: 2025-02-06T03-50Z. URI: https://www.merriam-webster.com/dictionary/science.
            • §“noun”

          3. Word: “scientific method”. Merriam-Webster. Accessed: 2025-02-06T03:51Z. URI: https://www.merriam-webster.com/dictionary/scientific method.
            • §“noun”

              • The scientific method simply requires an experiment. It doesn’t state that the experiment must be “easy” to conduct.
        • KalciferOP
          link
          fedilink
          arrow-up
          1
          ·
          2 days ago

          Hm, I think what’s confusing things a bit in this conversation is that my original question is a bit of an XY problem — I asked about the maximum username length of a Lemmy account, yet I was, in reality, looking for the username length limits imposed by my instance (the answer for one instance may or may not apply to other instances). So that’s my fault for not being accurate/clear enough in my initial question.

    • KalciferOP
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      I’m not used to this level of rigour to be honest. […]

      In my opinion, one should always be open to scrutiny of their claims. One should strive to be precise in their communication — ie one should seek to rectify any uncertainties, ambiguities etc.