osctrl icon indicating copy to clipboard operation
osctrl copied to clipboard

Fresh install: users.go:60 ERROR: duplicate key value violates unique constraint "pg_class_relname_nsp_index" (SQLSTATE 23505)

Open Rodasa opened this issue 10 months ago • 1 comments

Hello. Installing in Ubuntu 22.04 fresh install, i have this error in some part of the installation. Thanks for help!


./deploy/provision.sh -m prod -t self --nginx --postgres -E -R --tls-hostname "xx.xx.xx.xx" --admin-hostname "xx.xx.xx.xx" --password "admin"

[Install] WantedBy=multi-user.target Created symlink /etc/systemd/system/multi-user.target.wants/osctrl-api.service → /lib/systemd/system/osctrl-api.service. [+] Creating environment prod

2024/04/15 15:47:18 /home/xxxxxxx/osctrl/users/users.go:60 ERROR: duplicate key value violates unique constraint "pg_class_relname_nsp_index" (SQLSTATE 23505) [74.764ms] [rows:0] CREATE INDEX IF NOT EXISTS "idx_admin_users_deleted_at" ON "admin_users" ("deleted_at") 2024/04/15 15:47:18 Failed to AutoMigrate table (admin_users): ERROR: duplicate key value violates unique constraint "pg_class_relname_nsp_index" (SQLSTATE 23505) rsabella@s1b1osquery1:~/osctrl$ users.go:60 ERROR: duplicate key value violates unique constraint "pg_class_relname_nsp_index" (SQLSTATE 23505)

Rodasa avatar Apr 15 '24 15:04 Rodasa

Update. There´s a problem with 22.04. I tested multiple times with fresh install, and there´s a problem with the use of posgres user.

Rodasa avatar Apr 19 '24 02:04 Rodasa

Just added some checks for user and database, before creating them. I have just deployed in a fresh Ubuntu 22.04 and it works. I will migrate the provision.sh script to Ubuntu 24.04 soon, as the only supported system. Let me know if that helped, thank you!

javuto avatar Oct 14 '24 23:10 javuto

https://github.com/jmpsec/osctrl/pull/535

javuto avatar Oct 14 '24 23:10 javuto