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

[Bug]: Unable to reimport exported file #11406

Open
SGFGOV opened this issue Feb 11, 2025 · 0 comments
Open

[Bug]: Unable to reimport exported file #11406

SGFGOV opened this issue Feb 11, 2025 · 0 comments

Comments

@SGFGOV
Copy link
Contributor

SGFGOV commented Feb 11, 2025

Package.json file

{
  "name": "medusa-starter-default",
  "version": "0.0.1",
  "description": "A starter for Medusa projects.",
  "author": "Medusa (https://medusajs.com)",
  "license": "MIT",
  "type": "commonjs",
  "keywords": [
    "sqlite",
    "postgres",
    "typescript",
    "ecommerce",
    "headless",
    "medusa"
  ],
  "scripts": {
    "build": "medusa build",
    "seed": "medusa exec ./src/scripts/seed.ts",
    "start": "medusa start",
    "dev": "medusa develop",
    "lint": "eslint --fix ./src",
    "test:integration:http": "TEST_TYPE=integration:http NODE_OPTIONS=--experimental-vm-modules jest --silent=false --runInBand --forceExit",
    "test:integration:modules": "TEST_TYPE=integration:modules NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit",
    "test:unit": "TEST_TYPE=unit NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit"
  },
  "dependencies": {
    "@emotion/react": "^11.11.3",
    "@emotion/styled": "11.13.0",
    "@medusajs/admin-sdk": "^2.4.0",
    "@medusajs/cli": "^2.4.0",
    "@medusajs/framework": "^2.4.0",
    "@medusajs/icons": "^2.4.0",
    "@medusajs/js-sdk": "^2.4.0",
    "@medusajs/medusa": "^2.4.0",
    "@mikro-orm/core": "6.4.3",
    "@mikro-orm/knex": "6.4.3",
    "@mikro-orm/migrations": "6.4.3",
    "@mikro-orm/postgresql": "6.4.3",
    "@mui/material": "^5.15.3",
    "@myparcel-pdk/admin": "^1.5.4",
    "@myparcel-pdk/admin-preset-default": "^1.5.4",
    "@myparcel-pdk/app-builder": "^1.6.1",
    "@myparcel/constants": "^2.2.0",
    "@myparcel/sdk": "^4.1.1",
    "@react-email/components": "^0.0.25",
    "@react-email/render": "^1.0.1",
    "@rokmohar/medusa-plugin-meilisearch": "^0.1.5",
    "@sanity/client": "^6.22.1",
    "@types/lodash": "^4.17.13",
    "@types/multer-s3": "^3.0.3",
    "add": "^2.0.6",
    "awilix": "^8.0.1",
    "axios": "^1.7.8",
    "btoa": "^1.2.1",
    "crypto-js": "^4.2.0",
    "font-awesome": "^4.7.0",
    "frappe-js-sdk": "^1.7.0",
    "froala-editor": "^4.4.0",
    "i18n-iso-countries": "^7.13.0",
    "i18next": "23.15.1",
    "install": "^0.13.0",
    "medusa-variant-images": "^1.0.4",
    "medusajs-payment-mollie": "^0.2.1",
    "moment": "^2.30.1",
    "multer": "^1.4.5-lts.1",
    "multer-s3": "^3.0.1",
    "papaparse": "^5.5.0",
    "pdfkit": "^0.15.1",
    "pg": "^8.13.0",
    "react-froala-wysiwyg": "^4.4.0",
    "react-hook-form": "^7.49.2",
    "react-table": "^7.8.0",
    "resend": "^4.0.0",
    "svix": "^1.44.0"
  },
  "devDependencies": {
    "@medusajs/test-utils": "^2.4.0",
    "@mikro-orm/cli": "6.4.3",
    "@swc/core": "1.5.7",
    "@swc/jest": "^0.2.36",
    "@types/btoa": "^1.2.5",
    "@types/crypto-js": "^4.2.2",
    "@types/jest": "^29.5.13",
    "@types/multer": "^1.4.12",
    "@types/node": "^20.0.0",
    "@types/papaparse": "^5.3.15",
    "@types/react": "^18.3.2",
    "@types/react-dom": "^18.2.25",
    "@typescript-eslint/eslint-plugin": "^5.0.0",
    "@typescript-eslint/parser": "^5.0.0",
    "eslint": "^8.23.1",
    "eslint-config-google": "^0.14.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-config-typescript": "^3.0.0",
    "eslint-plugin-file-progress": "^1.3.0",
    "eslint-plugin-prettier": "^4.2.1",
    "jest": "^29.7.0",
    "prettier": "^2.7.1",
    "prop-types": "^15.8.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "ts-jest": "^27.0.7",
    "ts-node": "^10.9.2",
    "typescript": "^5.6.2",
    "vite": "^5.2.11",
    "yalc": "^1.0.0-pre.53"
  },
  "engines": {
    "node": ">=20"
  },
  "packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}

Node.js version

20.18.1

Database and its version

Postgres 13

Operating system name and version

linux backend, windows client

Browser name

edge

What happended?

When i try to export and reimport the sameset of products, using the same csv file that i exported (no changes).. i get the following error
It may have something to do with - https://stackoverflow.com/questions/22809401/removing-a-null-character-from-a-string-in-javascript and
https://stackoverflow.com/questions/31671634/handling-unicode-sequences-in-postgresql

 - detail: \u0000 cannot be converted to text.
    at PostgreSqlExceptionConverter.convertException x/backend/node_modules/@mikro-orm/core/platforms/ExceptionConverter.js:8:16)
    at PostgreSqlExceptionConverter.convertException x/backend/node_modules/@mikro-orm/postgresql/PostgreSqlExceptionConverter.js:48:22)
    at PostgreSqlDriver.convertException x/backend/node_modules/@mikro-orm/core/drivers/DatabaseDriver.js:351:54)
    at /home/ec2-user/tyler/home-vision/backend/node_modules/@mikro-orm/core/drivers/DatabaseDriver.js:355:24
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async PostgreSqlDriver.nativeInsertMany x/backend/node_modules/@mikro-orm/knex/AbstractSqlDriver.js:457:21)
    at async ChangeSetPersister.persistNewEntity x/backend/node_modules/@mikro-orm/core/unit-of-work/ChangeSetPersister.js:97:21)
    at async ChangeSetPersister.executeInserts x/backend/node_modules/@mikro-orm/core/unit-of-work/ChangeSetPersister.js:40:13)
    at async ChangeSetPersister.runForEachSchema x/backend/node_modules/@mikro-orm/core/unit-of-work/ChangeSetPersister.js:80:13)
    at async UnitOfWork.commitCreateChangeSets x/backend/node_modules/@mikro-orm/core/unit-of-work/UnitOfWork.js:774:9)

    at Parser.parseErrorMessage x/backend/node_modules/pg-protocol/src/parser.ts:368:69)
    at Parser.handlePacket x/backend/node_modules/pg-protocol/src/parser.ts:187:21)
    at Parser.parse x/backend/node_modules/pg-protocol/src/parser.ts:102:30)
    at Socket.<anonymous> x/backend/node_modules/pg-protocol/src/index.ts:7:48)
    at Socket.emit (node:events:518:28)
    at Socket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Socket.Readable.push (node:internal/streams/readable:392:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:191:23) {
  code: '22P05',
  errno: undefined,
  sqlState: undefined,
  sqlMessage: undefined,
  errmsg: undefined,
  length: 220,
  severity: 'ERROR',
  detail: '\\u0000 cannot be converted to text.',
  hint: undefined,
  position: '5463',
  internalPosition: undefined,
  internalQuery: undefined,
  where: 'JSON data, line 1: ...ebruik van een brede dynamische driver van \\u0000...',
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'jsonfuncs.c',
  line: '645',
  routine: 'json_errsave_error'
}
http:    POST /admin/products/import ← http://localhost:8999/app/products/import (500) - 13048.679 ms

### Expected behavior

It should seamless import

### Actual behavior

Throws an error

### Link to reproduction repo

any standard medusa deployment.. no changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant