Skip to content

Bug: S3 profile paths are stored with double slashes ("//profile-name") #621

@amantiwari1

Description

@amantiwari1

What happened?

When creating or importing profiles from S3, a literal / folder (empty folder name) is created in the S3 bucket, causing profiles to be stored at paths like s3://bucket//profile-name/ instead of s3://bucket/profile-name/.

This is due to the way url.pathname is used in the code, resulting in an empty or slash-only prefix being accidentally interpreted as part of the path. Specifically, packages/driver-lightsail/src/fs/index.ts uses url.pathname directly as the path, which becomes / when no path is provided, and then path.posix.join(prefix, filename) creates a double slash.

Suggested Fix: Normalize the path to treat / as empty and trim leading/trailing slashes.

Add screenshots

S3 bucket contents showing / folder with profile

Steps to reproduce the behavior

  1. Create a profile with S3 storage: preevy profile create my-profile 's3://my-bucket/my-profile?region=us-east-1'
  2. Check S3 bucket contents
  3. Observe a / folder containing my-profile/ instead of my-profile/ at the root

Expected behavior

Profile should be stored at s3://bucket/my-profile/, not at s3://bucket//my-profile/.

What OS are you seeing the problem on?

MacOS

Additional context

Preevy version: [check with preevy version]
OS: macOS
Cloud provider: AWS Lightsail + S3
File: packages/driver-lightsail/src/fs/index.ts (see parseS3Url and usage of url.pathname)

Record

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions