You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "pvsnraju (via GitHub)" <gi...@apache.org> on 2025/04/17 11:58:28 UTC

[D] Pulsar Manager Login Issue [pulsar]

GitHub user pvsnraju created a discussion: Pulsar Manager Login Issue

I'm experiencing an issue logging into Apache Pulsar Manager. Here's a summary of the problem and troubleshooting steps taken:

**Environment**
Running Pulsar Manager v0.4.0 in Docker
Container name: pulsar-manager
Accessing via http://localhost:9527/

**Issue**
Cannot log in to Pulsar Manager web interface. When attempting to log in with the default credentials (admin/apachepulsar), I get a 403 Forbidden error.

**Troubleshooting Steps Taken**
```
Tried creating a superuser account using the API:
docker exec -it pulsar-manager curl \
  -H "X-XSRF-TOKEN: $CSRF_TOKEN" \
  -H "Cookie: XSRF-TOKEN=$CSRF_TOKEN;" \
  -H "Content-Type: application/json" \
  -X PUT http://localhost:9527/pulsar-manager/users/superuser \
  -d '{"name": "admin", "password": "apachepulsar", "description": "test", "email": "admin@example.com"}'
```

**Checked configuration files:**

Examined /pulsar-manager/pulsar-manager/application.properties
Found that user management is enabled (user.management.enable=true)
The database is configured to use HerdDB with data stored in /pulsar-manager/pulsar-manager/dbdata/


**Attempted to access the user database directly:**
SQLite is not installed by default in the container
After installing SQLite, no database was found at the expected location /data/pulsar_manager.db
Checked the HerdDB data directory (/pulsar-manager/pulsar-manager/dbdata/) but couldn't directly query it


Examined the entrypoint script (/pulsar-manager/entrypoint.sh) but found no initialization for user accounts

**Key Observations**
The application.properties file shows the default credentials as pulsar/pulsar (not admin/apachepulsar)
The container is configured to use HerdDB, not SQLite
The login API returns 403 Forbidden when attempting to log in
The container appears to be properly running, with the web interface available

**Questions for the Community**
1. What are the default credentials for Pulsar Manager v0.4.0?
2. Is there a specific initialization step for the superuser account that I'm missing?
3. How can I reset the admin password if the web interface is inaccessible?
4. Is there a way to directly query the HerdDB database to check or reset user credentials?

**Note :** Tried with multiple versions and with multiple ports [-p 9527:9527 -p 7750:7750]
Any help or guidance would be greatly appreciated! Thank you.


GitHub link: https://github.com/apache/pulsar/discussions/24183

----
This is an automatically sent email for commits@pulsar.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@pulsar.apache.org


Re: [D] Pulsar Manager Login Issue [pulsar]

Posted by "pvsnraju (via GitHub)" <gi...@apache.org>.
GitHub user pvsnraju closed a discussion: Pulsar Manager Login Issue

I'm experiencing an issue logging into Apache Pulsar Manager. Here's a summary of the problem and troubleshooting steps taken:

**Environment**
Running Pulsar Manager v0.4.0 in Docker
Container name: pulsar-manager
Accessing via http://localhost:9527/

**Issue**
Cannot log in to Pulsar Manager web interface. When attempting to log in with the default credentials (admin/apachepulsar), I get a 403 Forbidden error.

**Troubleshooting Steps Taken**
```
Tried creating a superuser account using the API:
docker exec -it pulsar-manager curl \
  -H "X-XSRF-TOKEN: $CSRF_TOKEN" \
  -H "Cookie: XSRF-TOKEN=$CSRF_TOKEN;" \
  -H "Content-Type: application/json" \
  -X PUT http://localhost:9527/pulsar-manager/users/superuser \
  -d '{"name": "admin", "password": "apachepulsar", "description": "test", "email": "admin@example.com"}'
```

**Checked configuration files:**

Examined /pulsar-manager/pulsar-manager/application.properties
Found that user management is enabled (user.management.enable=true)
The database is configured to use HerdDB with data stored in /pulsar-manager/pulsar-manager/dbdata/


**Attempted to access the user database directly:**
SQLite is not installed by default in the container
After installing SQLite, no database was found at the expected location /data/pulsar_manager.db
Checked the HerdDB data directory (/pulsar-manager/pulsar-manager/dbdata/) but couldn't directly query it


Examined the entrypoint script (/pulsar-manager/entrypoint.sh) but found no initialization for user accounts

**Key Observations**
The application.properties file shows the default credentials as pulsar/pulsar (not admin/apachepulsar)
The container is configured to use HerdDB, not SQLite
The login API returns 403 Forbidden when attempting to log in
The container appears to be properly running, with the web interface available

**Questions for the Community**
1. What are the default credentials for Pulsar Manager v0.4.0?
2. Is there a specific initialization step for the superuser account that I'm missing?
3. How can I reset the admin password if the web interface is inaccessible?
4. Is there a way to directly query the HerdDB database to check or reset user credentials?

**Note :**
 Tried with multiple versions 
 Tried with multiple ports [-p 9527:9527 -p 7750:7750]
Trying in windows docker environment
 
Any help or guidance would be greatly appreciated! Thank you.


GitHub link: https://github.com/apache/pulsar/discussions/24183

----
This is an automatically sent email for commits@pulsar.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@pulsar.apache.org


Re: [D] Pulsar Manager Login Issue [pulsar]

Posted by "pvsnraju (via GitHub)" <gi...@apache.org>.
GitHub user pvsnraju edited a discussion: Pulsar Manager Login Issue

I'm experiencing an issue logging into Apache Pulsar Manager. Here's a summary of the problem and troubleshooting steps taken:

**Environment**
Running Pulsar Manager v0.4.0 in Docker
Container name: pulsar-manager
Accessing via http://localhost:9527/

**Issue**
Cannot log in to Pulsar Manager web interface. When attempting to log in with the default credentials (admin/apachepulsar), I get a 403 Forbidden error.

**Troubleshooting Steps Taken**
```
Tried creating a superuser account using the API:
docker exec -it pulsar-manager curl \
  -H "X-XSRF-TOKEN: $CSRF_TOKEN" \
  -H "Cookie: XSRF-TOKEN=$CSRF_TOKEN;" \
  -H "Content-Type: application/json" \
  -X PUT http://localhost:9527/pulsar-manager/users/superuser \
  -d '{"name": "admin", "password": "apachepulsar", "description": "test", "email": "admin@example.com"}'
```

**Checked configuration files:**

Examined /pulsar-manager/pulsar-manager/application.properties
Found that user management is enabled (user.management.enable=true)
The database is configured to use HerdDB with data stored in /pulsar-manager/pulsar-manager/dbdata/


**Attempted to access the user database directly:**
SQLite is not installed by default in the container
After installing SQLite, no database was found at the expected location /data/pulsar_manager.db
Checked the HerdDB data directory (/pulsar-manager/pulsar-manager/dbdata/) but couldn't directly query it


Examined the entrypoint script (/pulsar-manager/entrypoint.sh) but found no initialization for user accounts

**Key Observations**
The application.properties file shows the default credentials as pulsar/pulsar (not admin/apachepulsar)
The container is configured to use HerdDB, not SQLite
The login API returns 403 Forbidden when attempting to log in
The container appears to be properly running, with the web interface available

**Questions for the Community**
1. What are the default credentials for Pulsar Manager v0.4.0?
2. Is there a specific initialization step for the superuser account that I'm missing?
3. How can I reset the admin password if the web interface is inaccessible?
4. Is there a way to directly query the HerdDB database to check or reset user credentials?

**Note :**
 Tried with multiple versions 
 Tried with multiple ports [-p 9527:9527 -p 7750:7750]
Trying in windows docker environment
 
Any help or guidance would be greatly appreciated! Thank you.


GitHub link: https://github.com/apache/pulsar/discussions/24183

----
This is an automatically sent email for commits@pulsar.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@pulsar.apache.org


Re: [D] Pulsar Manager Login Issue [pulsar]

Posted by "pvsnraju (via GitHub)" <gi...@apache.org>.
GitHub user pvsnraju closed the discussion with a comment: Pulsar Manager Login Issue

```
# Troubleshooting Pulsar Manager Login (v0.4.0 with HerdDB)

## 1. Problem Description

Users were unable to log into the Pulsar Manager web interface at `http://localhost:9527`. Attempts using common default credentials (`admin/apachepulsar`) and credentials potentially found in documentation or configuration (`pulsar/pulsar`) resulted in errors, initially `403 Forbidden` and later `{"error":"The user is not exist"}` after database reset attempts.

## 2. Environment

*   **Pulsar Manager Version:** 0.4.0 (Docker Image)
*   **Container Name:** `pulsar-manager`
*   **Host OS:** Windows (interacting via PowerShell)
*   **Database Backend:** HerdDB (as configured in `application.properties`)
*   **Access URL:** `http://localhost:9527`
*   **Internal Backend Port:** 7750 (from `application.properties`)

## 3. Troubleshooting Steps & Findings

### 3.1. Initial Login Attempts & Configuration Check

*   Tried logging in with `admin/apachepulsar` - Failed (likely 403).
*   Inspected `application.properties` inside the container:
    ```bash
    docker exec pulsar-manager cat /pulsar-manager/pulsar-manager/application.properties
    ```
*   **Key Findings from `application.properties`:**
    *   `user.management.enable=true`: Confirmed that Pulsar Manager was configured to use its internal user database (HerdDB).
    *   Default credentials listed as `pulsar.manager.account=pulsar` and `pulsar.manager.password=pulsar`. This suggested `pulsar`/`pulsar` *should* be the correct defaults *if* the internal database wasn't being used or if it was correctly initialized.
*   Tried logging in with `pulsar/pulsar` - Still failed.

### 3.2. Database Reset via Volume Removal

*   **Hypothesis:** The HerdDB database might be in an inconsistent state, corrupted, or wasn't initialized correctly with the default user.
*   **Solution:** Reset the database by removing the persistent Docker volume used by Pulsar Manager.
*   **Step 1: Identify the correct volume:**
    ```bash
    # List all docker volumes
    docker volume ls
    # Or filter for likely candidates (adjust findstr/grep for your shell)
    docker volume ls | findstr pulsar
    ```
    *   The volume associated with Pulsar Manager's HerdDB (`/pulsar-manager/pulsar-manager/dbdata/`) was identified as `pulsar-manager-data`.
*   **Step 2: Stop the Pulsar Manager container:**
    ```bash
    docker stop pulsar-manager
    ```
*   **Step 3: Remove the identified volume:**
    ```bash
    # Warning: This deletes all Pulsar Manager user data!
    docker volume rm pulsar-manager-data
    ```
    *   *Note: An attempt to remove `server-infra-a_pulsar_data` failed because it was in use by the `pulsar-standalone` broker container. This volume did **not** need to be removed for resetting Pulsar Manager.*
*   **Step 4: Restart the Pulsar Manager container:**
    ```bash
    docker start pulsar-manager
    # Or use docker-compose up -d pulsar-manager if managed by compose
    ```
*   **Step 5: Wait for initialization** (approx. 1 minute).
*   **Step 6: Re-test login:** Attempted login with `pulsar`/`pulsar` at `http://localhost:9527`.
    *   **Finding:** Login still failed, but the error changed. The browser network tools showed a `200 OK` response to the `/pulsar-manager/login` POST request, but the response body was `{"error":"The user is not exist"}`.
    *   **Conclusion:** The database was successfully reset (new empty HerdDB created), but the container startup **did not automatically create the default `pulsar` user** in the new database.

### 3.3. Manual Superuser Creation via API

*   **Hypothesis:** Since the database was empty, we needed to manually create the first (super)user using the Pulsar Manager API.
*   **Challenge:** API requests require a valid CSRF token.
*   **Step 1: Obtain CSRF Token:**
    *   Navigated to `http://localhost:9527` in the browser.
    *   Opened Developer Tools (F12).
    *   Went to Application/Storage -> Cookies -> `http://localhost:9527`.
    *   Copied the **value** of the `XSRF-TOKEN` cookie (e.g., `f1fa709e-10a1-48fb-9939-6c567ec1f20b`).
*   **Step 2: Execute API Call (Iterative Process):**
    *   **Initial Attempt (PowerShell Syntax Issues & Missing Fields):** Used `curl` via `docker exec`. Initial commands failed due to incorrect line continuation characters (`\` vs. `` ` `` in PowerShell) and later returned `400 Bad Request` because required fields were missing (`{"error":"User email cannot be empty"}`).
    *   **Corrected API Call (PowerShell):** Included the required `email` field and used PowerShell-safe JSON quoting (`\`"). The CSRF token value was inserted into both the `X-XSRF-TOKEN` header and the `Cookie` header. Targeted the internal backend port `7750`.
        ```powershell
        # Replace YOUR_CSRF_TOKEN_VALUE with the actual token copied from the browser
        $csrfToken = "YOUR_CSRF_TOKEN_VALUE" 

        docker exec -it pulsar-manager curl `
          -H "X-XSRF-TOKEN: $csrfToken" `
          -H "Cookie: XSRF-TOKEN=$csrfToken" `
          -H "Content-Type: application/json" `
          -X PUT http://127.0.0.1:7750/pulsar-manager/users/superuser `
          -d "{\`"name\`": \`"pulsar\`", \`"password\`": \`"pulsar\`", \`"email\`": \`"pulsar@example.com\`", \`"description\`": \`"Default Superuser\`"}" `
          -v
        ```
        *(Note: Simplified quoting used above for clarity; using `\`" for internal quotes within the single-quoted string might be necessary depending on the exact shell version.)*
    *   **Finding:** The corrected API call returned `HTTP/1.1 200 OK` with no error message in the response body, indicating the user was successfully created.
*   **Step 3: Final Login Test:**
    *   Navigated to `http://localhost:9527`.
    *   Logged in successfully using `pulsar` / `pulsar`.

## 4. Root Cause Summary

The primary issue was the failure of the Pulsar Manager v0.4.0 Docker container (using HerdDB) to automatically create the default superuser (`pulsar`) upon initializing a new, empty database after the data volume was removed. This left the system in a state where the configured user management required a user from the database, but no users existed.

## 5. Solution Summary

1.  Stop the `pulsar-manager` container.
2.  Remove the associated Docker data volume (`pulsar-manager-data`) to ensure a clean database state.
3.  Restart the `pulsar-manager` container.
4.  Obtain a valid `XSRF-TOKEN` value from the browser cookies for the Pulsar Manager UI.
5.  Execute the corrected `curl` command via `docker exec` to call the `/pulsar-manager/users/superuser` API endpoint, providing the `name`, `password`, `email`, and `description` fields in the JSON payload, along with the necessary CSRF headers (`X-XSRF-TOKEN` and `Cookie`).
6.  Log into the web interface using the newly created credentials (`pulsar`/`pulsar`). 
```

GitHub link: https://github.com/apache/pulsar/discussions/24183#discussioncomment-12878660

----
This is an automatically sent email for commits@pulsar.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@pulsar.apache.org