Error Creating Namespace in OpenBao: "unsupported path" When Attempting to Create Namespace #486
Closed
Description
Describe the bug
I am trying to create a namespace using OpenBao, but I am encountering an error during the process.
To Reproduce
Steps to reproduce the behavior:
- Run
bao namespace create ns1
- See the error message.
Expected behavior
The namespace should be created without errors, and the system should return a success message confirming the creation of the namespace.
Environment:
- OpenBao Server Version:
Key Value
--- -----
Seal Type shamir
Initialized true
Sealed false
Total Shares 16
Threshold 5
Version 2.0.0-HEAD
Build Date 2024-08-22T11:31:40Z
Storage Type file
Cluster Name vault-cluster-3574c2b2
Cluster ID a4a2d0a1-5964-4792-1719-86b74e6b132b
HA Enabled false
- OpenBao CLI Version: OpenBao v2.0.0-HEAD ('d6eeec8f06bab2f03fe51ff348082d6200415b78+CHANGES')
OpenBao dockerfile configuration file:
FROM debian:bullseye-slim
ENV BAO_ADDR=http://0.0.0.0:8200
ENV BAO_API_ADDR=http://0.0.0.0:8201
# Set the working directory
WORKDIR /openbao
# Install necessary dependencies
RUN apt-get update && apt-get install -y \
curl \
git \
wget \
gnupg \
openssl \
jq
# Install Node.js and npm from NodeSource
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get install -y nodejs
# Install Yarn from its official repository
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install -y yarn
# Install the latest version of Go (2024)
RUN wget https://golang.org/dl/go1.22.4.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.22.4.linux-amd64.tar.gz && \
rm go1.22.4.linux-amd64.tar.gz
# Set environment variables for Go
ENV PATH="/usr/local/go/bin:${PATH}"
# Install make
RUN apt-get update && apt-get install -y make
# Clone the OpenBao repository
RUN git clone https://github.com/openbao/openbao.git .
# Update Ember.js dependencies
RUN npm install --save-dev ember-cli@latest
RUN npx ember-cli-update
# Update Browserslist
RUN npx browserslist@latest --update-db
# Make
RUN make
RUN make static-dist 2> /dev/null || true
RUN make static-dist dev-ui 2> /dev/null || true
RUN mkdir /server
COPY ./bao/config/config.hcl /vault/config.hcl
RUN alias bao=/openbao/bin/bao
# Add Bao configuration file
ADD ./bao/config/config.hcl /bao/config/
Additional context
I followed the instructions for managing namespaces:
-
Created a new namespace:
bao namespace create ns1
However, when I run bao namespace create ns1
, I receive the following error:
Error creating namespace: Error making API request.
URL: PUT http://0.0.0.0:8200/v1/sys/namespaces/ns1
Code: 404. Errors:
* 1 error occurred:
* unsupported path
I don't understand why this error occurs, especially since I have logged in as the root user:
$ bao login
Token (will be hidden):
Success! You are now authenticated. The token information displayed below is
already stored in the token helper. You do NOT need to run "bao login" again.
Future OpenBao requests will automatically use this token.
Key Value
--- -----
token s.3ZtPM5zCC7YpIz0yEOtKGW4J
token_accessor 0J0b3WgjmF8GZRmSvv2gOkWt
token_duration ∞
token_renewable false
token_policies ["root"]
identity_policies []
policies ["root"]
Please advise on what might be causing this issue and how to resolve it.