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

Tests fail to start new DB: pg_ctl: unrecognized operation mode #106

Open
ShadowWayve opened this issue Nov 29, 2022 · 4 comments
Open

Tests fail to start new DB: pg_ctl: unrecognized operation mode #106

ShadowWayve opened this issue Nov 29, 2022 · 4 comments

Comments

@ShadowWayve
Copy link

I'm trying to install DBD::Pg on a Windows 11 machine (64-bit). The installation fails every time because the tests fail.

Installation command: cpanm DBD::Pg@3.16.0 --quiet
Console error message: ! Installing DBD::Pg failed. See C:\Users\[username]\.cpanm\work\1669705333.8180\build.log for details. Retry with --force to force install it.

Last several lines from the build.log file:

t/00_signature.t ....... skipped: Set the environment variable TEST_SIGNATURE to enable this test
t/00basic.t ............ ok
Please wait, creating new database (version 14.5) for testing
pg_ctl: unrecognized operation mode "C:/Users/[username]/.cpanm/work/1669705333.8180/DBD-Pg-3.16.0/dbdpg_test_database/data/socket'"
Try "pg_ctl --help" for more information.
# 
# DBI                         Version 1.643
# DBD::Pg                     Version 3.16.0
# Perl                        Version 5.32.1
# OS                          MSWin32
# PostgreSQL (compiled)       ?
# PostgreSQL (target)         ?
# PostgreSQL (reported)       ?
# Default port                ?
# DBI_DSN                     ?
# DBI_USER                    <not set>
# Test schema                 dbd_pg_testschema
# LANG                        C
# Adjusted:                   initdb
# Error was: Could not startup new database (pg_ctl -o '-k C:/Users/[username]/.cpanm/work/1669705333.8180/DBD-Pg-3.16.0/dbdpg_test_database/data/socket' -l C:/Users/[username]/.cpanm/work/1669705333.8180/DBD-Pg-3.16.0/dbdpg_test_database/dbdpg_test.logfile -D C:/Users/[username]/.cpanm/work/1669705333.8180/DBD-Pg-3.16.0/dbdpg_test_database/data start) () ()
Bailout called.  Further testing stopped:  Cannot continue: connection failed
FAILED--Further testing stopped: Cannot continue: connection failed
gmake: *** [Makefile:983: test_dynamic] Error 255
-> FAIL Installing DBD::Pg failed. See C:\Users\[username]\.cpanm\work\1669705333.8180\build.log for details. Retry with --force to force install it.

Additional info about my machine:

  • The machine itself has been alive for over a year. I upgraded from Windows 10 to Windows 11 a couple weeks ago.
  • I installed Perl, cpanminus, PostgreSQL, and Sqitch for the first time EVER today. I installed HeidiSQL a couple weeks ago (not sure if that matters).
  • The command perl -e 'use DBI; DBI->installed_versions();' says that I have DBD::Pg version 3.8.0 installed. I don't know where that version of DBD::Pg came from.
  • Earlier today I also hit issue Compile error 'initdb' not recognized for ver 3.15.1 #96. I resolved that issue by installing PostgreSQL and adding the PostgreSQL bin folder to my Path.

I've never used PostgreSQL before, so feel free to share as much "obvious" beginner information with me as you want. I won't think that you are being condescending. 😄

@esabol
Copy link
Contributor

esabol commented Nov 29, 2022

I haven't used a Windows computer in over 25 years, so take what I write with a grain of salt, but, based on my googling, I think the pg_ctl: unrecognized operation mode error means you need to run the tests in a shell with administrator privileges, or at least that's what someone wrote on the pgsql-novice(at)postgresql(dot)org mailing list.

@ShadowWayve
Copy link
Author

I haven't used a Windows computer in over 25 years, so take what I write with a grain of salt, but, based on my googling, I think the pg_ctl: unrecognized operation mode error means you need to run the tests in a shell with administrator privileges, or at least that's what someone wrote on the pgsql-novice(at)postgresql(dot)org mailing list.

I guess I should have mentioned that I was running the command in an elevated PowerShell command prompt (powershell.exe). I tried executing cpanm DBD::Pg@3.16.0 --quiet in an elevated cmd.exe instance just now too. Same error. 😞

Thank you for sharing your hunch, though!! Much appreciated.

@ShadowWayve
Copy link
Author

Something else I should have shared:

The "socket" folder mentioned in the error message "pg_ctl: unrecognized operation mode "C:/Users/[username]/.cpanm/work/1669705333.8180/DBD-Pg-3.16.0/dbdpg_test_database/data/socket'" doesn't exist on my machine. Is that socket folder supposed to be created on the fly later, or should it exist at the time this error is hit?

Other folders that do exist at "C:/Users/[username]/.cpanm/work/1669705333.8180/DBD-Pg-3.16.0/dbdpg_test_database/data/":

  • base
  • global
  • pg_commit_ts
  • pg_dynshmem
  • pg_logical
  • pg_multixact
  • pg_notify
  • pg_replslot
  • pg_serial
  • pg_snapshots
  • pg_stat
  • pg_stat_tmp
  • pg_subtrans
  • pg_tblspc
  • pg_twophase
  • pg_wal
  • pg_xact

Files that exist in the data folder:

  • pg_hba.conf
  • pg_ident.conf
  • PG_VERSION
  • postgresql.auto.conf
  • postgresql.conf

A total of 22 folders & files.

@ShadowWayve ShadowWayve changed the title Tests fail to create new DB: pg_ctl: unrecognized operation mode Tests fail to start new DB: pg_ctl: unrecognized operation mode Nov 29, 2022
@turnstep
Copy link
Contributor

turnstep commented Mar 5, 2023

This means that pg_ctl is not getting the final argument, 'start', as probably the other arguments are somehow intercepting it. Does the actual username contain spaces or anything odd? You could try from the command line and putting the "start" as the very first argument, and seeing if the output can give us a clue where the problem is.

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

No branches or pull requests

3 participants