[Looking for Charlie's main web site? or all posts?]

Curious bug where cfpm CLI commands may fail unexpectedly, tracker ticket filed

I want to offer a heads-up about an issue someone may run into, when using the interactive cfpm CLI shell (meaning, typing "cfpm" then running commands inside it, rather than passing them directly from your host terminal). I just found an annoying bug where it will complain of errors that may not seem to make sense, and I've filed a Tracker ticket about it.

The issue turned out to happen if you somehow put more than one space between some cfpm commands (like scan) and then its argument (like the folder path). For example:

  • This works (within cfpm>): scan /path/to/folder (one space)
  • This fails (within cfpm>): scan  /path/to/folder (two spaces, which happened somehow based on how I pasted a folder to be scanned)

The failing one will report:

Incorrect usage of scan command. It must be scan CODEBASEPATH.

That will be confusing if you feel "there's nothing wrong with the codebasepath provided".

Happens with many but not all cfpm commands, and only WITHIN cfpm cli

The issue is not just with "scan" but several other cfpm commands as I tested (like info, import, export, downloadrpo scanandinstall, and more).

For example, an attempt to run "info  zip" (two spaces before "zip") will get the same sort of error, as "Incorrect usage of the info command. It must be info packageNAME". Then again using more than one space after "updaterepopath" will get a differently worded error, "Incorrect parameters for the command updaterepopath." I'm just offering these here to help folks find them when searching online.

Curiously the problem does NOT happen with ALL the cfpm commands. These don't seem sensitive to an extra space: update, install, or uninstall. (And that also means this is not an issue for CommandBox users, who may have their server.json "scripts" section doing "cfpm install" of packages.)

And again, it only happens INSIDE the cfpm CLI, at its "cli>" prompt. If instead you run that "cfpm info  zip" (with two spaces) directly from your regular bash/command prompt/PowerShell terminal, it works perfectly fine because the host OS handles the whitespace tokenization.

I also confirmed that this is not new with CF2025: it happens also with CF2023 and 2021 (which is when cfpm was introduced). I wonder how long some people may have suffered this, perhaps getting the error and just "giving up" if they couldn't sort it out.

The CFPM tool (and the package management mechanism) is more interesting than many realize. FWIW, I did a talk on it in 2024, available on my site (with links to PDF and youtube recording), "The Many Capabilities of CF Package Management and cfpm".

Tracker ticket filed with Adobe

I have filed a tracker ticket with Adobe to get their argument parser fixed. You can upvote or track it here: Adobe Tracker Ticket CF-4234524.

Did I really need to bring this up as a blog post? I vacillated. It was a confusing enough error as it happened that I suspect it may well have happened to others.

Watch that space for any updates from Adobe...and until then, watch your "spaces". :-)


For more content like this from Charlie Arehart: Need more help with problems?
  • If you may prefer direct help, rather than digging around here/elsewhere or via comments, he can help via his online consulting services
  • See that page for more on how he can help a) over the web, safely and securely, b) usually very quickly, c) teaching you along the way, and d) with satisfaction guaranteed
Comments
Copyright ©2026 Charlie Arehart
Carehart Logo
BlogCFC was created by Raymond Camden. This blog is running version 5.005.
(Want to validate the HTML in this page?)

Managed Hosting Services provided by
xByte cloud Hosting