Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] vastbase cluster create failed on vke and aks: could not create directory /var/lib/vastbase/log: Permission denied #8764

Open
JashBook opened this issue Jan 8, 2025 · 0 comments
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@JashBook
Copy link
Collaborator

JashBook commented Jan 8, 2025

Describe the bug

kbcli version
Kubernetes: v1.28.15-vke.18
KubeBlocks: 0.9.3-beta.18
kbcli: 0.9.2

To Reproduce
Steps to reproduce the behavior:

  1. create cluster
    helm template vastbase-cluster addons-cluster/vastbase-cluster
# Source: vastbase-cluster/templates/cluster.yaml
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
  name: vastbase-cluster
  namespace: default
  labels: 
    helm.sh/chart: vastbase-cluster-0.9.0
    app.kubernetes.io/version: "1.16.0"
    app.kubernetes.io/instance: vastbase-cluster
  annotations:
    kubeblocks.io/host-network: "vastbase"
spec:
  terminationPolicy: Delete  
  affinity:
    podAntiAffinity: Preferred
    topologyKeys:
      - kubernetes.io/hostname
    tenancy: SharedNode
  clusterDefinitionRef: vastbase
  componentSpecs:
    - name: vastbase
      replicas: 3
      componentDef: vastbase-2.2
      serviceVersion: 
      #      
      monitor: false
      disableExporter: false
    #   serviceAccountName:       
      resources:
        limits:
          cpu: "4"
          memory: "8Gi"
        requests:
          cpu: "0.1"
          memory: "0.1Gi"      
      volumeClaimTemplates:
        - name: data # ref clusterDefinition components.containers.volumeMounts.name
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi
  1. See error
kubectl get cluster vastbase-cluster 
NAME               CLUSTER-DEFINITION   VERSION   TERMINATION-POLICY   STATUS   AGE
vastbase-cluster   vastbase                       Delete               Failed   2m45s
➜  ~ 
➜  ~ kubectl get pod -l app.kubernetes.io/instance=vastbase-cluster                       
NAME                          READY   STATUS             RESTARTS      AGE
vastbase-cluster-vastbase-0   3/4     CrashLoopBackOff   4 (73s ago)   2m57s
vastbase-cluster-vastbase-1   3/4     CrashLoopBackOff   4 (68s ago)   2m57s
vastbase-cluster-vastbase-2   3/4     CrashLoopBackOff   4 (70s ago)   2m57s
➜  ~ 
➜  ~ kubectl logs vastbase-cluster-vastbase-0
Defaulted container "vastbase" out of: vastbase, exporter, lorry, config-manager, init-lorry (init)
+ CONFIG_VOLUME=/etc/vastbase
+ VASTBASE_CM_SERVER_PORT=1173
+ VASTBASE_DB_PORT=1170
+ VASTBASE_DB_REPL_PORT=1171
+ VASTBASE_DB_HEARTBEAT_PORT=1172
+ db_conn_str=postgres://%2Ftmp:1170
+ pwd
/
+ id
uid=1000(vastbase) gid=1000(vastbase) groups=1000(vastbase)
+ hostname=vastbase-cluster-vastbase-0
+ hostname_underscore=vastbase_cluster_vastbase_0
++ echo vastbase-cluster-vastbase-0
++ awk -F - '{print $(NF)}'
+ ordinal=0
+ export NODE_ID=1
+ NODE_ID=1
+ export DB_DIR=/var/lib/vastbase/dn
+ DB_DIR=/var/lib/vastbase/dn
+ export GAUSSLOG=/var/lib/vastbase/log
+ GAUSSLOG=/var/lib/vastbase/log
+ echo 'export GAUSSLOG="/var/lib/vastbase/log"'
+ mkdir -p /tmp
++ ls -A /var/lib/vastbase/dn
ls: cannot access /var/lib/vastbase/dn: No such file or directory
+ '[' -z '' ']'
data dir empty, initializing
+ echo 'data dir empty, initializing'
+ vb_initdb -D /var/lib/vastbase/dn --nodename vastbase_cluster_vastbase_0 -w 2K23Y4B20XObf92T --dbcompatibility=PG
The files belonging to this database system will be owned by user "vastbase".
This user must also own the server process.

The database cluster will be initialized with locale "C".
The default database encoding has accordingly been set to "SQL_ASCII".
The default text search configuration will be set to "english".

could not create directory /var/lib/vastbase/log: Permission denied
vb_initdb: could not create directory "/var/lib/vastbase/dn": Permission denied
creating directory /var/lib/vastbase/dn ... %                                                                                                                                                             ➜  ~ 
➜  ~ kubectl logs vastbase-cluster-vastbase-1
Defaulted container "vastbase" out of: vastbase, exporter, lorry, config-manager, init-lorry (init)
+ CONFIG_VOLUME=/etc/vastbase
+ VASTBASE_CM_SERVER_PORT=1173
+ VASTBASE_DB_PORT=1170
+ VASTBASE_DB_REPL_PORT=1171
+ VASTBASE_DB_HEARTBEAT_PORT=1172
+ db_conn_str=postgres://%2Ftmp:1170
+ pwd
/
+ id
uid=1000(vastbase) gid=1000(vastbase) groups=1000(vastbase)
+ hostname=vastbase-cluster-vastbase-1
+ hostname_underscore=vastbase_cluster_vastbase_1
++ echo vastbase-cluster-vastbase-1
++ awk -F - '{print $(NF)}'
+ ordinal=1
+ export NODE_ID=2
+ NODE_ID=2
+ export DB_DIR=/var/lib/vastbase/dn
+ DB_DIR=/var/lib/vastbase/dn
+ export GAUSSLOG=/var/lib/vastbase/log
+ GAUSSLOG=/var/lib/vastbase/log
+ echo 'export GAUSSLOG="/var/lib/vastbase/log"'
+ mkdir -p /tmp
++ ls -A /var/lib/vastbase/dn
ls: cannot access /var/lib/vastbase/dn: No such file or directory
data dir empty, initializing
+ '[' -z '' ']'
+ echo 'data dir empty, initializing'
+ vb_initdb -D /var/lib/vastbase/dn --nodename vastbase_cluster_vastbase_1 -w 2K23Y4B20XObf92T --dbcompatibility=PG
vb_initdb: could not create directory "/var/lib/vastbase/dn": Permission denied
The files belonging to this database system will be owned by user "vastbase".
This user must also own the server process.

The database cluster will be initialized with locale "C".
The default database encoding has accordingly been set to "SQL_ASCII".
The default text search configuration will be set to "english".

could not create directory /var/lib/vastbase/log: Permission denied
creating directory /var/lib/vastbase/dn ... %                                                                                                                                                             ➜  ~ 
➜  ~ kubectl logs vastbase-cluster-vastbase-2
Defaulted container "vastbase" out of: vastbase, exporter, lorry, config-manager, init-lorry (init)
/
+ CONFIG_VOLUME=/etc/vastbase
+ VASTBASE_CM_SERVER_PORT=1173
+ VASTBASE_DB_PORT=1170
+ VASTBASE_DB_REPL_PORT=1171
+ VASTBASE_DB_HEARTBEAT_PORT=1172
+ db_conn_str=postgres://%2Ftmp:1170
+ pwd
+ id
uid=1000(vastbase) gid=1000(vastbase) groups=1000(vastbase)
+ hostname=vastbase-cluster-vastbase-2
+ hostname_underscore=vastbase_cluster_vastbase_2
++ echo vastbase-cluster-vastbase-2
++ awk -F - '{print $(NF)}'
+ ordinal=2
+ export NODE_ID=3
+ NODE_ID=3
+ export DB_DIR=/var/lib/vastbase/dn
+ DB_DIR=/var/lib/vastbase/dn
+ export GAUSSLOG=/var/lib/vastbase/log
+ GAUSSLOG=/var/lib/vastbase/log
+ echo 'export GAUSSLOG="/var/lib/vastbase/log"'
+ mkdir -p /tmp
++ ls -A /var/lib/vastbase/dn
ls: cannot access /var/lib/vastbase/dn: No such file or directory
+ '[' -z '' ']'
+ echo 'data dir empty, initializing'
data dir empty, initializing
+ vb_initdb -D /var/lib/vastbase/dn --nodename vastbase_cluster_vastbase_2 -w 2K23Y4B20XObf92T --dbcompatibility=PG
The files belonging to this database system will be owned by user "vastbase".
This user must also own the server process.

The database cluster will be initialized with locale "C".
The default database encoding has accordingly been set to "SQL_ASCII".
The default text search configuration will be set to "english".

could not create directory /var/lib/vastbase/log: Permission denied
vb_initdb: could not create directory "/var/lib/vastbase/dn": Permission denied
creating directory /var/lib/vastbase/dn ... %   

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@JashBook JashBook added the kind/bug Something isn't working label Jan 8, 2025
@JashBook JashBook added this to the Release 1.0.0 milestone Jan 8, 2025
@github-actions github-actions bot modified the milestones: Release 1.0.0, Release 0.9.3 Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants