Skip to content

Objects show as "updated" and are redownloaded even when unchanged #53

@noelforte

Description

@noelforte

Environment
NodeJS v18.16.0
macOS 13.4 Ventura

Steps to reproduce
Sample code for how I'm invoking s3-sync-client (with sensitive values stripped):

Show
// Initialize env
import 'dotenv/config';

// Load internal modules
import path from 'node:path';
import { env, exit } from 'node:process';

// Load external modules
import { S3SyncClient } from 's3-sync-client';

// Initialize client
const { sync } = new S3SyncClient({
	region: ***,
	endpoint: ***,
	forcePathStyle: false,
	credentials: {
		accessKeyId: ***,
		secretAccessKey: ***,
	},
});

const results = await sync(
	`s3://my-bucket/path/to/directory`,
	'output',
	{
		del: true,
	}
);

console.log(results);

Expected result
Items that are unchanged from the remote to the local system should not be recopied.

Actual result
Even after an initial successful sync to the local filesystem, s3-sync-client continues to redownload files that haven't changed, incurring additional bandwidth charges.

Here's a screen capture of the network requests going across:

Show

Screen Recording 2023-06-01 at 8 14 17 PM

And the resulting output:

Show
{
  created: [],
  updated: [
    BucketObject {
      id: 'dim-gunger-UO2hOHLq9Y0-unsplash.jpg',
      size: 1667804,
      lastModified: 1685662029901,
      isExcluded: false,
      bucket: '***',
      key: 'test/dim-gunger-UO2hOHLq9Y0-unsplash.jpg'
    },
    BucketObject {
      id: 'luka-verc-D-ChPtXJhXA-unsplash.jpg',
      size: 2448935,
      lastModified: 1685662029901,
      isExcluded: false,
      bucket: '***',
      key: 'test/luka-verc-D-ChPtXJhXA-unsplash.jpg'
    },
    BucketObject {
      id: 'planet-volumes-6tI9Fk5p4bo-unsplash.jpg',
      size: 385869,
      lastModified: 1685662029923,
      isExcluded: false,
      bucket: '***',
      key: 'test/planet-volumes-6tI9Fk5p4bo-unsplash.jpg'
    },
    BucketObject {
      id: 'the-cleveland-museum-of-art-AiD3Pkwmtt0-unsplash.jpg',
      size: 3881833,
      lastModified: 1685662030480,
      isExcluded: false,
      bucket: '***',
      key: 'test/the-cleveland-museum-of-art-AiD3Pkwmtt0-unsplash.jpg'
    },
    BucketObject {
      id: 'yannick-apollon-rYXkqDZxfaw-unsplash.jpg',
      size: 13356953,
      lastModified: 1685662030513,
      isExcluded: false,
      bucket: '***',
      key: 'test/yannick-apollon-rYXkqDZxfaw-unsplash.jpg'
    }
  ],
  deleted: []
}

Other items of note:

  • I thought this could be related to using iDrive e2 (which is S3 compatible), but the same issue exists on Backblaze too.
  • The time returned by s3-sync-client when performing the diff is the same time as what's on the filesystem and on the WebUI for the S3 storage services so any drift differences, if they exist, aren't visible at least to my eyes as an end-user.

Happy to provide any other relevant details!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions