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

Bookstack give "Unable to create or change a table without a primary key" error #2612

Closed
dharmendrakariya opened this issue Mar 5, 2021 · 1 comment

Comments

@dharmendrakariya
Copy link

Describe the bug
When we used Digital Ocean managed mysql DB, Bookstack is throwing "Unable to create or change a table without a primary key" error because cache, password_resets, and sessions tables don't have primary key.

Steps To Reproduce
Steps to reproduce the behavior:

  1. I am using Helm Release, Apply the below helm release values
values:
    image:
      # repository: linuxserver/bookstack
      # tag: version-v0.31.1
      repository: solidnerd/bookstack
      tag: 0.29.3
    env: 
      APP_DEBUG: true
    externalDatabase:
      ## Database host
      host: private-mysql-1-do-user-**-0.b.db.ondigitalocean.com:25060   # DO
      # host: mysql:3306
      
      ## Database user
      user: bookstack   # DO
     
      ## Database password
      password: fo**c5***auqq  # DO
     
      ## Database name
      database: bookstack  # DO
     

    mariadb:
      ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters
      enabled: false
    ingress:
      enabled: true
      # annotations: 
      #   kubernetes.io/ingress.class: nginx
      #   kubernetes.io/tls-acme: "true"
      path: /
      #backend:
        #serviceName: {{ $fullName }}
        #servicePort: 80
      hosts:
        - wiki.dnskladn

    resources: 
      # We usually recommend not to specify default resources and to leave this as a conscious
      # choice for the user. This also increases chances charts run on environments with little
      # resources, such as Minikube. If you do want to specify resources, uncomment the following
      # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
      limits:
       cpu: 200m
       memory: 256Mi
      requests:
       cpu: 150m
       memory: 128Mi

Expected behavior
Bookstack should be up and running.

Screenshots
bookstack-error

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): BookStack v0.29.3
  • Hosting Method (Nginx/Apache/Docker): Docker/Kubernetes

Additional context
Add any other context about the problem here.

@ssddanbrown
Copy link
Member

Thanks for providing the detail @dharmendrakariya.

A related issue for the framework we use can be seen here: laravel/framework#33238

I'd be somewhat hesitant to change our database migration files or add workarounds within the core project just because of the enforced limitations from a single cloud provider. I don't mind adding primary keys to the relevant rows but we can't do that in a nice progressive manner since it would still create errors for you, we'd have to alter old migrations which has its own implications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants