{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1914","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1914/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1914/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1914/events","html_url":"https://github.com/ManageIQ/manageiq/issues/1914","id":59246650,"number":1914,"title":"Latest builds have no database.","user":{"login":"seandst","id":441252,"avatar_url":"https://avatars.githubusercontent.com/u/441252?v=3","gravatar_id":"","url":"https://api.github.com/users/seandst","html_url":"https://github.com/seandst","followers_url":"https://api.github.com/users/seandst/followers","following_url":"https://api.github.com/users/seandst/following{/other_user}","gists_url":"https://api.github.com/users/seandst/gists{/gist_id}","starred_url":"https://api.github.com/users/seandst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seandst/subscriptions","organizations_url":"https://api.github.com/users/seandst/orgs","repos_url":"https://api.github.com/users/seandst/repos","events_url":"https://api.github.com/users/seandst/events{/privacy}","received_events_url":"https://api.github.com/users/seandst/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-27T14:59:41Z","updated_at":"2015-02-27T15:17:46Z","closed_at":null,"body":"Recent nightlies haven't had databases running on them.\r\n\r\nShort, short version:\r\n> ext4's lost+found dir in /opt/rh/postgresql92/root/var/lib/pgsql/data is making postgres's initdb mad. \r\n> Removing it makes initdb work.\r\n\r\nLonger version, with all the steps taken:\r\n\r\nPostgres isn't running, so start it\r\n```\r\n# service postgresql92-postgresql start\r\n/opt/rh/postgresql92/root/var/lib/pgsql/data is missing. Use \"service postgresql92-postgresql initdb\" to initialize the cluster first. [FAILED]\r\n```\r\n\r\nTry initdb\r\n```\r\n# service postgresql92-postgresql initdb\r\nInitializing database:                                     [FAILED]\r\n```\r\n\r\nTry initdb, this time *with feeling*\r\n```\r\n# sudo -u postgres /opt/rh/postgresql92/root/usr/bin/initdb /opt/rh/postgresql92/root/var/lib/pgsql/data\r\nThe files belonging to this database system will be owned by user \"postgres\".\r\nThis user must also own the server process.\r\n\r\nThe database cluster will be initialized with locale \"en_US.UTF-8\".\r\nThe default database encoding has accordingly been set to \"UTF8\".\r\nThe default text search configuration will be set to \"english\".\r\n\r\ninitdb: directory \"/opt/rh/postgresql92/root/var/lib/pgsql/data\" exists but is not empty\r\nIf you want to create a new database system, either remove or empty\r\nthe directory \"/opt/rh/postgresql92/root/var/lib/pgsql/data\" or run initdb\r\nwith an argument other than \"/opt/rh/postgresql92/root/var/lib/pgsql/data\".\r\n```\r\n\r\nSee what initdb is complaining about\r\n```\r\n# ls -al /opt/rh/postgresql92/root/var/lib/pgsql/data\r\ntotal 28\r\ndrwx------. 4 postgres postgres  4096 Feb 27 09:45 .\r\ndrwx------. 4 postgres postgres  4096 Feb 27 09:24 ..\r\ndrwx------. 2 root     root     16384 Feb 26 20:01 lost+found\r\ndrwx------. 2 postgres postgres  4096 Feb 27 09:45 pg_log\r\n```\r\n\r\nBlow away pg_log to see if initdb is angry about lost+found\r\n```\r\n# rm -rf /opt/rh/postgresql92/root/var/lib/pgsql/data/pg_log/                                                                                                                                    \r\n# sudo -u postgres /opt/rh/postgresql92/root/usr/bin/initdb /opt/rh/postgresql92/root/var/lib/pgsql/data                                                                                         \r\n<snip>\r\ninitdb: directory \"/opt/rh/postgresql92/root/var/lib/pgsql/data\" exists but is not empty\r\n</snip>\r\n```\r\n\r\nBlow away *everything*, including lost+found (sorry, ext4...)\r\n```\r\n# rm -rf /opt/rh/postgresql92/root/var/lib/pgsql/data/*\r\n# sudo -u postgres /opt/rh/postgresql92/root/usr/bin/initdb /opt/rh/postgresql92/root/var/lib/pgsql/data\r\nThe files belonging to this database system will be owned by user \"postgres\".\r\nThis user must also own the server process.\r\n\r\nThe database cluster will be initialized with locale \"en_US.UTF-8\".\r\nThe default database encoding has accordingly been set to \"UTF8\".\r\nThe default text search configuration will be set to \"english\".\r\n\r\nfixing permissions on existing directory /opt/rh/postgresql92/root/var/lib/pgsql/data ... ok\r\ncreating subdirectories ... ok\r\nselecting default max_connections ... 100\r\nselecting default shared_buffers ... 32MB\r\ncreating configuration files ... ok\r\ncreating template1 database in /opt/rh/postgresql92/root/var/lib/pgsql/data/base/1 ... ok\r\ninitializing pg_authid ... ok\r\ninitializing dependencies ... ok\r\ncreating system views ... ok\r\nloading system objects' descriptions ... ok\r\ncreating collations ... ok\r\ncreating conversions ... ok\r\ncreating dictionaries ... ok\r\nsetting privileges on built-in objects ... ok\r\ncreating information schema ... ok\r\nloading PL/pgSQL server-side language ... ok\r\nvacuuming database template1 ... ok\r\ncopying template1 to template0 ... ok\r\ncopying template1 to postgres ... ok\r\n\r\nWARNING: enabling \"trust\" authentication for local connections\r\nYou can change this by editing pg_hba.conf or using the option -A, or\r\n--auth-local and --auth-host, the next time you run initdb.\r\n\r\nSuccess. You can now start the database server using:\r\n\r\n    /opt/rh/postgresql92/root/usr/bin/postgres -D /opt/rh/postgresql92/root/var/lib/pgsql/data\r\nor\r\n    /opt/rh/postgresql92/root/usr/bin/pg_ctl -D /opt/rh/postgresql92/root/var/lib/pgsql/data -l logfile start\r\n```\r\n\r\nSo I guess lost+found needs to be removed after `mkfs.ext4 /opt/rh/postgresql92/root/var/lib/pgsql/data`? I'm curious as to how this wasn't an issue before, though."},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/76410068","html_url":"https://github.com/ManageIQ/manageiq/issues/1914#issuecomment-76410068","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1914","id":76410068,"user":{"login":"seandst","id":441252,"avatar_url":"https://avatars.githubusercontent.com/u/441252?v=3","gravatar_id":"","url":"https://api.github.com/users/seandst","html_url":"https://github.com/seandst","followers_url":"https://api.github.com/users/seandst/followers","following_url":"https://api.github.com/users/seandst/following{/other_user}","gists_url":"https://api.github.com/users/seandst/gists{/gist_id}","starred_url":"https://api.github.com/users/seandst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seandst/subscriptions","organizations_url":"https://api.github.com/users/seandst/orgs","repos_url":"https://api.github.com/users/seandst/repos","events_url":"https://api.github.com/users/seandst/events{/privacy}","received_events_url":"https://api.github.com/users/seandst/received_events","type":"User","site_admin":false},"created_at":"2015-02-27T15:17:46Z","updated_at":"2015-02-27T15:17:46Z","body":"anaconda post log for you, sir: https://gist.github.com/seandst/aa0ed6110132150343dc"}}