[GH-ISSUE #933] [BUG] bootstrap.sh user creation fails when id is a substring of another id #342

Closed
opened 2026-02-27 08:16:45 +03:00 by kerem · 1 comment
Owner

Originally created by @tbnguyen1407 on GitHub (Jul 16, 2024).
Original GitHub issue: https://github.com/lldap/lldap/issues/933

Describe the bug

Bootstrapping users fails when one user's id contains another user's id.

To Reproduce

  1. Prepare 2 users under "user-configs"
$ cat user-configs/1.json
{
  "id": "johndoe",
  "email": "johndoe@example.com"
}
$ cat user-configs/2.json
{
  "id": "john",
  "email": "john@example.com"
}
  1. Execute bootstrap.sh
  2. See error
--- johndoe ---
User "johndoe" successfully created
--- johndoe ---

--- john ---
Database error: `None of the records are updated`
jq: error (at <stdin>:0): Cannot iterate over null (null)

Expected behavior

Both users created successfully.

Logs

N/A

Additional context

Changing the order of the files ("john" before "johndoe") works.

--- john ---
User "john" successfully created
--- john ---

--- johndoe ---
User "johndoe" successfully created
--- johndoe ---
Originally created by @tbnguyen1407 on GitHub (Jul 16, 2024). Original GitHub issue: https://github.com/lldap/lldap/issues/933 **Describe the bug** Bootstrapping users fails when one user's id contains another user's id. **To Reproduce** 1. Prepare 2 users under "user-configs" ```shell $ cat user-configs/1.json { "id": "johndoe", "email": "johndoe@example.com" } $ cat user-configs/2.json { "id": "john", "email": "john@example.com" } ``` 2. Execute bootstrap.sh 3. See error ``` --- johndoe --- User "johndoe" successfully created --- johndoe --- --- john --- Database error: `None of the records are updated` jq: error (at <stdin>:0): Cannot iterate over null (null) ``` **Expected behavior** Both users created successfully. **Logs** N/A **Additional context** Changing the order of the files ("john" before "johndoe") works. ``` --- john --- User "john" successfully created --- john --- --- johndoe --- User "johndoe" successfully created --- johndoe --- ```
kerem 2026-02-27 08:16:45 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@nitnelave commented on GitHub (Jul 17, 2024):

Note that bootstrap.sh is a user-contributed script, I don't claim to understand how it works.

I would welcome a PR fixing it, though. It's just bash, so even if you can't write rust it should be doable.

<!-- gh-comment-id:2234216931 --> @nitnelave commented on GitHub (Jul 17, 2024): Note that bootstrap.sh is a user-contributed script, I don't claim to understand how it works. I would welcome a PR fixing it, though. It's just bash, so even if you can't write rust it should be doable.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/lldap-lldap#342
No description provided.