codefactoryhu / manifest

Alternative User Interface for Conjur OSS
Apache License 2.0
13 stars 1 forks source link

[Bug]: syntax error at or near "TRIGGER" #7

Closed KarlisK-D8 closed 3 weeks ago

KarlisK-D8 commented 3 weeks ago

πŸ“œ What happened?

Followed the instructions pointed out in Readme but the setup is incomplete.

πŸ‘ Expected behavior

I don't know... never used this solution before

πŸ‘Ž Actual Behavior

cyberark/conjur container keeps restarting, viewing docker compose logs points to this issue:

conjur_server      | Caused by:
conjur_server      | PG::SyntaxError: ERROR:  syntax error at or near "TRIGGER"
conjur_server      | LINE 45:         CREATE OR REPLACE TRIGGER policy_log
conjur_server      |                                    ^
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/adapters/postgres.rb:171:in `exec'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/adapters/postgres.rb:171:in `block in execute_query'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-rails-1.2.0/lib/sequel_rails/sequel/database/active_support_notification.rb:17:in `block in log_connection_yield'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/activesupport-6.1.7.8/lib/active_support/notifications.rb:203:in `block in instrument'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/activesupport-6.1.7.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/activesupport-6.1.7.8/lib/active_support/notifications.rb:203:in `instrument'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-rails-1.2.0/lib/sequel_rails/sequel/database/active_support_notification.rb:11:in `log_connection_yield'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/adapters/postgres.rb:171:in `execute_query'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/adapters/postgres.rb:159:in `block in execute'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/adapters/postgres.rb:136:in `check_disconnect_errors'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/adapters/postgres.rb:159:in `execute'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/adapters/postgres.rb:532:in `_execute'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/adapters/postgres.rb:348:in `block (2 levels) in execute'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/adapters/postgres.rb:555:in `check_database_errors'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/adapters/postgres.rb:348:in `block in execute'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/connection_pool/threaded.rb:88:in `hold'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/database/connecting.rb:293:in `synchronize'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/adapters/postgres.rb:348:in `execute'
conjur_server      | /opt/conjur-server/db/migrate/202403221318214_policy_log_trigger_each_statement.rb:11:in `block (3 levels) in <top (required)>'
conjur_server      | /opt/conjur-server/db/migrate/202403221318214_policy_log_trigger_each_statement.rb:7:in `each'
conjur_server      | /opt/conjur-server/db/migrate/202403221318214_policy_log_trigger_each_statement.rb:7:in `block (2 levels) in <top (required)>'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/extensions/migration.rb:110:in `instance_exec'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/extensions/migration.rb:110:in `apply'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/extensions/migration.rb:695:in `block (2 levels) in run'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/database/transactions.rb:258:in `_transaction'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/database/transactions.rb:233:in `block in transaction'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/connection_pool/threaded.rb:92:in `hold'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/database/connecting.rb:293:in `synchronize'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/database/transactions.rb:195:in `transaction'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/extensions/migration.rb:482:in `checked_transaction'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/extensions/migration.rb:694:in `block in run'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/extensions/migration.rb:691:in `each'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/extensions/migration.rb:691:in `run'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-5.69.0/lib/sequel/extensions/migration.rb:409:in `run'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-rails-1.2.0/lib/sequel_rails/migrations.rb:12:in `migrate'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/sequel-rails-1.2.0/lib/sequel_rails/railties/database.rake:172:in `block (2 levels) in <top (required)>'
conjur_server      | /opt/conjur-server/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
conjur_server      | Tasks: TOP => db:migrate
conjur_server      | (See full trace by running task with --trace)
conjur_server      | error: exit
❯ docker compose ps
WARN[0000] docker-compose.yaml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
NAME                IMAGE                   COMMAND                  SERVICE    CREATED          STATUS                          PORTS
conjur-pgadmin-1    dpage/pgadmin4          "/entrypoint.sh"         pgadmin    12 minutes ago   Up 12 minutes                   443/tcp, 0.0.0.0:8081->80/tcp, :::8081->80/tcp
conjur_client       cyberark/conjur-cli:8   "sleep infinity"         client     12 minutes ago   Up 12 minutes                   
conjur_server       cyberark/conjur         "conjurctl server"       conjur     12 minutes ago   Restarting (1) 53 seconds ago   
nginx_proxy         nginx:1.13.6-alpine     "nginx -g 'daemon of…"   proxy      12 minutes ago   Up 12 minutes                   80/tcp, 0.0.0.0:8443->443/tcp, :::8443->443/tcp
postgres_database   postgres:10.16          "docker-entrypoint.s…"   database   12 minutes ago   Up 12 minutes                   0.0.0.0:8432->5432/tcp, :::8432->5432/tcp

πŸ‘Ÿ Reproduction steps or Relevant log output

git clone https://github.com/codefactoryhu/manifest.git
cd manifest/conjur-tooling
docker compose up -d

Application Version

No response

Chart Version

No response

🧱 Your Environment

❯ docker version
Client: Docker Engine - Community
 Version:           27.2.1
 API version:       1.47
 Go version:        go1.22.7
 Git commit:        9e34c9b
 Built:             Fri Sep  6 12:09:48 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.2.1
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.7
  Git commit:       8b539b8
  Built:            Fri Sep  6 12:08:08 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.22
  GitCommit:        7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
 runc:
  Version:          1.1.14
  GitCommit:        v1.1.14-0-g2c9f560
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

❯ docker compose version
Docker Compose version v2.29.2

πŸ‘€ Have you spent some time to check if this issue has been raised before?

🏒 Have you read the Code of Conduct?

fulopdenes commented 3 weeks ago

Hi KarlisK-D8,

Thank you for your feedback! It seems there is an issue with the database connection during the build stage. We have tested the current configuration on Linux, macOS, and Windows, but the problem didn’t appear on those platforms.

To help resolve the issue, we've updated our docker-compose.yaml file as a precaution. Please try the build process again using the updated version of the manifest.

Before logging in, please follow these steps:

  1. Complete the User Creation Process,
  2. Change the file name from .env.example to.env.
  3. After running pnpm install, make sure the task is executed as a task (not just a regular terminal command). See the pictures below:

image image

We hope this helps! Please let me know if everything works as expected. I’ll be waiting for your feedback to ensure everything runs smoothly.

KarlisK-D8 commented 3 weeks ago

Thanks for the fix! I ran the same steps again as I listed in reproduction steps section and now it's working - previously conjur_server container was stuck restarting, now it's working.

fulopdenes commented 3 weeks ago

Good, if you will find any other issue, I'm here to help!