Build stalls after starting PostgreSQL server

kartikohri13's Avatar

kartikohri13

06 Jun, 2020 11:52 AM

Hi! My AppVeyor builds have been stalling lately since I added a commit to start PostgreSQL server using pg_ctl command line utility from PowerShell. The builds immediately stall after the execution of this command in which ever build phase it is place.
See https://ci.appveyor.com/project/amCap1712/pljava/builds/33355792 and https://ci.appveyor.com/project/amCap1712/pljava/builds/33355891 . Can someone help me with this ?

  1. Support Staff 1 Posted by Feodor Fitsner on 08 Jun, 2020 11:03 PM

    Feodor Fitsner's Avatar

    I think you should run the server as a async process, otherwise it will be blocking the build. It could be done with PS, for example:

    - ps: Start-Process -FilePath pg_ctl -ArgumentList "-D","$env:PGROOT\data","start"
    
  2. 2 Posted by kartikohri13 on 09 Jun, 2020 07:02 AM

    kartikohri13's Avatar

    It does not seem to work. I get the output
    psql: error: could not connect to server: could not connect to server: Connection refused (0x0000274D/10061)
            Is the server running on host "localhost" (::1) and accepting
            TCP/IP connections on port 5432?
    could not connect to server: Connection refused (0x0000274D/10061)
            Is the server running on host "localhost" (127.0.0.1) and accepting
            TCP/IP connections on port 5432?
    when I try to connect to postgres server.

  3. Support Staff 3 Posted by Feodor Fitsner on 09 Jun, 2020 05:22 PM

    Feodor Fitsner's Avatar

    Why not to just use net start postgresql-x64-12 to start PGSql?

  4. 4 Posted by kartikohri13 on 09 Jun, 2020 05:30 PM

    kartikohri13's Avatar

    I was initially using net start but it causes a permissions error when I
    try to access certain files. After starting postgres servers, I build a
    java plugin for the server and install it into the server. The plugin needs
    access to jvm.dll inside the java installation directory. I get an access
    denied error when the plugin tries to access jvm.dll. But this issue does
    not occur when I use pg_ctl to start the server. So, I want to use pg_ctl.

  5. Support Staff 5 Posted by Feodor Fitsner on 10 Jun, 2020 02:17 AM

    Feodor Fitsner's Avatar

    Try logging in to build VM via RDP and experiment with the correct filepath/arguments for Start-Process. I feel it could be a path issue or something else very obvious.

  6. 6 Posted by kartikohri13 on 10 Jun, 2020 12:14 PM

    kartikohri13's Avatar

    Thanks for the tip. The arguments needed be escaped in order for the process to work.

  7. Support Staff 7 Posted by Feodor Fitsner on 10 Jun, 2020 07:25 PM

    Feodor Fitsner's Avatar

    Cool, thanks for the update!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

02 Jul, 2020 03:24 PM
01 Jul, 2020 08:32 PM
01 Jul, 2020 01:12 PM
30 Jun, 2020 04:26 PM
25 Jun, 2020 05:54 PM