Skip to content

Installation of postgresql18 package successful with FOSS Chocolatey, but fails with Chocolatey for Business #3833

@gep13

Description

@gep13

Checklist

  • I confirm there are no unresolved issues reported on the Chocolatey Status page.
  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

The installation of the postgresql18 package from the Chocolatey Community Repository using install arguments to change the installation directory and the data directory works when installing with FOSS Chocolatey, but fails when attempting with Chocolatey for Business (C4B).
FOSS Chocolatey errors when ensuring the directories exist, which allows the installation to proceed. C4B ensures the directories exist by creating them, but the installation fails due to a message stating that the directories already exist.

What is Expected?

Installing postgresql18 with install arguments should succeed with both FOSS and C4B Chocolatey.

How Did You Get This To Happen?

  1. Prepare a location for the installation directory and data directory of PostgreSQL 18. I included an additional virtual hard disk on my VM assigned as the E:\ drive for testing.
  2. Install chocolatey v2.6.0. Once this has finished, I recommend snapshotting the VM to revert back to this point for expediency.
  3. In an administrative PowerShell session, run choco install postgresql18 -y --install-arguments '--prefix E:\PostgreSQL --datadir E:\PostgreSQL\18\data'. This should install the postgresql18 package and its nine dependencies without issue.
  4. Revert to the snapshot created in Step 3.
  5. License the machine and install Chocolatey Licensed Extension v7.0.0.
  6. In an administrative PowerShell session, run choco install postgresql18 -y --install-arguments '--prefix E:\PostgreSQL --datadir E:\PostgreSQL\18\data'.The dependencies will install correctly, but the installation of the postgresql18 package should fail after Chocolatey ensures the directories exist, and there should be a popup stating, "The chosen installation directory exists and is non-empty. Please choose a different directory."

System Details

  • Operating System: Windows Server 2025
  • Windows PowerShell Version: 5.1
  • Chocolatey CLI Version: 2.6.0
  • Chocolatey Licensed Extension version: 7.0.0
  • Chocolatey License type (Professional / Business / ?): BusinessTrial
  • Terminal/Emulator: Windows PowerShell

Installed Packages

N/A

Output Log

Commands were run with `--debug` and `--trace` so the logs are verbose. I have attached them to the issue instead of trying to use them inline.

[FOSS_Postgres18_Success.log](https://github.com/user-attachments/files/24735376/FOSS_Postgres18_Success.log)
[CLE_Postgres18_Failure.log](https://github.com/user-attachments/files/24735372/CLE_Postgres18_Failure.log)

Additional Context

If one were inclined, one could install FOSS Chocolatey, install postgresql18 using the command mentioned above, and then license the machine and install the Chocolatey Licensed Extension. That's really putting a customer through the paces, though.

Related Issue

This issue was originally created here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeThe issue will introduce backwards incompatible changes.BugIssues where something has happened which was not expected or intended.CustomerBug reported or feature requested by a licensed customer of Chocolatey.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions