Skip to content

Infer destination object name for pelican object put to "directory" location #2946

@aowen-uwmad

Description

@aowen-uwmad

Pelican Service:

  • Client
  • Plugin
  • Registry
  • Director
  • Origin
  • Cache
  • Other (please give the detail)

Is your feature request related to a problem? Please describe.
When uploading (put-ing) to an existing namespace, users have built up the intuition that the object name at the destination is inferred by the object name at the source. That is, users expect

pelican object put ./aowen-uwmad_test.txt osdf:///<existing_namespace>

to have the same outcome as

pelican object put ./aowen-uwmad_test.txt osdf:///<existing_namespace>/aowen-uwmad_test.txt

This arises from such behavior of common unix commands such as mv, cp, and scp when an existing directory is provided as the destination.

Instead, the user receives an error like this:

ERROR[2026-01-05T12:31:53-06:00] Error when attempting to transfer object osdf:///<existing_namespace> for client 019b8f6e-0f40-711d-a992-3ab2693ab191: remote object already exists, upload aborted

The intuition built up by the user further confuses the point - they interpret the error to mean that the object they are trying to upload (aowen-uwmad_test.txt) already exists in the namespace (osdf:///<existing_namespace>/aowen-uwmad_test.txt), but any subsequent queries (pelican object ls, pelican object get) against that supposed object will fail.

Describe the solution you'd like
The command

pelican object put ./aowen-uwmad_test.txt osdf:///<existing_namespace>

has the same outcome as

pelican object put ./aowen-uwmad_test.txt osdf:///<existing_namespace>/aowen-uwmad_test.txt

Additional context

  1. For downloads, the client already infers the object name if not provided at the destination. That is,

    pelican object get osdf:///<existing_namespace>/aowen-uwmad_test.txt ./
    

    behaves the same as

    pelican object get osdf:///<existing_namespace>/aowen-uwmad_test.txt ./aowen-uwmad_test.txt
    

    as expected.

  2. If the current behavior is a policy decision (e.g., "users should not upload objects without being explicit about the name"), I'll counter that implicit naming is already used for --recursive or sync uploads anyways, so implementing this feature will not break a fundamental premise.

  3. If there is no desire to implement this feature, then I recommend that, at the very least, the client handles the existing error and suggests to the user something like Did you mean to run "pelican object put aowen-uwmad_test.txt osdf:///<existing_namespace>/aowen-uwmad_test.txt"?.

Metadata

Metadata

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions