Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the chunk merging method, special characters and Chinese characters are not handled, causing files containing special characters or Chinese characters to throw errors during the merging process. #1385

Open
Guohao0509 opened this issue Feb 18, 2025 · 4 comments

Comments

@Guohao0509
Copy link

Guohao0509 commented Feb 18, 2025

in there: composeObject ->> headers['x-amz-copy-source'] = ${sourceObj}

@prakashsvmx
Copy link
Member

Please share the trace error/details @Guohao0509

@Guohao0509
Copy link
Author

Guohao0509 commented Feb 20, 2025

Invalid character in header content ["x-amz-copy-source"] (uncaughtException throw 1 times on pid:67602)
    at ClientRequest.setHeader (node:_http_outgoing:579:3)
    at new ClientRequest (node:_http_client:262:14)
    at Object.request (node:http:96:10)
    at _makeRequest (/opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/minio/dist/main/minio.js:549:32)
    at Client.getBucketRegion (/opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/minio/dist/main/minio.js:594:44)
    at Client.makeRequestStream (/opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/minio/dist/main/minio.js:579:10)
    at Client.makeRequest (/opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/minio/dist/main/minio.js:482:10)
    at Client.uploadPartCopy (/opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/minio/dist/main/minio.js:3776:17)
    at /opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/async/dist/async.js:246:13
    at eachOfArrayLike (/opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/async/dist/async.js:506:13)
    at eachOf (/opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/async/dist/async.js:626:16)
    at awaitable (/opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/async/dist/async.js:211:32)
    at _asyncMap (/opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/async/dist/async.js:244:16)
    at Object.map (/opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/async/dist/async.js:749:16)
    at Object.awaitable [as map] (/opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/async/dist/async.js:211:32)
    at performUploadParts (/opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/minio/dist/main/minio.js:3925:24)
    at /opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/minio/dist/main/minio.js:3944:9
    at DestroyableTransform.<anonymous> (/opt/opsmgr/web/components/dfe.1/bin/dfe-form/node_modules/minio/dist/main/minio.js:2287:101)
    ...
code: "ERR_INVALID_CHAR"
pid: 67602
hostname: aiot-20210731-01.novalocal

@prakashsvmx
Copy link
Member

a valid reproducer code would help or a trace for this above scenario.

@Guohao0509
Copy link
Author

src/internal/client.ts

Line 1454 in 2813

headers['x-amz-copy-source'] = `${sourceObj}`

If the fileName has Chinese characters and is not escaped, an error will occur

async compose (objectIds, fileName, bucket) {
    const sourceList = objectIds.map((objId) => {
      return new MinIOHelpers.CopySourceOptions({
        Bucket: bucket,
        Object: objId
      })
    })
    const destOption = new MinIOHelpers.CopyDestinationOptions({
      Bucket: bucket,
      Object: fileName
    })
    try {
      await this.app.minioClient.composeObject(destOption, sourceList)
    } catch (error) {
      throw new Exception(ErrorCode.COMPOSE_FILES_FAILED);
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants