cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR when Deploying to HANA cloud database with csv file.

0 Kudos

Hi guys,

I am trying to deploying to hana db with data in csv file using cds deploy --to hana . And I got error as below:

Error: com.sap.hana.di.tabledata: The "include_filter" definitions match with 7 records that already exist in the "SAP_CAPIRE_BACKEND_ROLES" table [8251521]
       at "src/gen/data/sap.capire.backend-Roles.hdbtabledata" (14:26,/imports[0]/import_settings)
    Deploying "src/gen/sap.capire.backend.ContractLocations.hdbtable$SAP_CAPIRE_BACKEND_CONTRACTLOCATIONS.validate"... ok  (0s 9ms)
    Error: Worker 2 has encountered an error; all remaining jobs will be canceled [8214600]


    Error: com.sap.hana.di.tabledata: Deploying "src/gen/data/sap.capire.backend-Roles.hdbtabledata$0.expand"... failed [8212145]
      at "src/gen/data/sap.capire.backend-Roles.hdbtabledata$0.expand" (0:0)
   Error: Processing work list... failed [8212102]
   Make failed (5 errors, 0 warnings): tried to deploy 2 files, undeploy 0 files, redeploy 182 dependent files 
  Error: Making... failed [8211605]
 Error: Starting make in the container "253F14B34CDE448596BB55AE32F87FF9" with 2 files to deploy, 0 files to undeploy... failed [8214168]


Deployment to container 253F14B34CDE448596BB55AE32F87FF9 failed - error: HDI make failed [Deployment ID: none].


Error: HDI make failed


(3s 522ms)






[ERROR] [cds.deploy] - HDI deployment failed with exit code 1
    at hdiDeployLib.deploy (/home/user/projects/dwp-backend/node_modules/@sap/cds/bin/deploy/to-hana/hdiDeployUtil.js:90:35)
    at ChildProcess.<anonymous> (/home/user/projects/dwp-backend/node_modules/@sap/hdi-deploy/library.js:101:14)
    at ChildProcess.emit (events.js:198:13)
    at maybeClose (internal/child_process.js:982:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)

My csv content is as below

CREATEDAT;CREATEDBY;MODIFIEDAT;MODIFIEDBY;ID;NAME
2020-09-24 08:20:31.3180000;SYSTEM;2020-09-25 05:56:35.4990000;SYSTEM;6ddb7f32-2d52-4da4-a607-0b64c69b0664;Test

And the generated .hdbtabledata after I ran cds build/all

{
  "format_version": 1,
  "imports": [
    {
      "target_table": "SAP_CAPIRE_BACKEND_ROLES",
      "source_data": {
        "data_type": "CSV",
        "file_name": "sap.capire.backend-Roles.csv",
        "has_header": true,
        "type_config": {
          "delimiter": ";"
        }
      },
      "import_settings": {
        "import_columns": [
          "CREATEDAT",
          "CREATEDBY",
          "MODIFIEDAT",
          "MODIFIEDBY",
          "ID",
          "NAME"
        ],
        "include_filter": []
      },
      "column_mappings": {
        "CREATEDAT": "CREATEDAT",
        "CREATEDBY": "CREATEDBY",
        "MODIFIEDAT": "MODIFIEDAT",
        "MODIFIEDBY": "MODIFIEDBY",
        "ID": "ID",
        "NAME": "NAME"
      }
    }
  ]
}

But when I deployed cds deploy --to hana without csv file, it was running without error, but of course no data has been modified to the table.

Can you please give me an idea how to solve this issue? Thank you.

Regards,

Kevin.

0 Kudos

My package.json is as below.

{
  "name": "@dwp/backend",
  "version": "1.0.0",
  "description": "A simple CAP project.",
  "repository": "<Add your repository here>",
  "license": "UNLICENSED",
  "private": true,
  "engines": {
    "node": "10.x"
  },
  "dependencies": {
    "@sap/cds": "^3",
    "@sap/hana-client": "^2.4.196",
    "@sap/xssec": "^2.2.5",
    "@sap/xsenv": "^2.2.0",
    "express": "^4",
    "passport": "^0.4.1"
  },
  "scripts": {
    "watch": "npx cds watch",
    "start": "npx cds run",
    "compile": "npx cds compile srv/ --to hana",
    "deploy": "npx cds deploy --to hana"
  },
  "cds": {
    "hana": {
      "deploy-format": "hdbtable",
      "syntax": "hdi"
    },
    "requires": {
      "db": {
        "kind": "hana"
      },
      "uaa": {
        "kind": "xsuaa"
      }
    },
    "auth": {
      "passport": {
        "strategy": "JWT"
      }
    }
  },
  "devDependencies": {
    "@sap/hdi-deploy": "^3.11.11",
    "node-gyp": "^7.0.0"
  }
}



View Entire Topic
Priyanka19
Explorer
0 Kudos

Hi,

My Answer would to clear the data from the “SAP_CAPIRE_BACKEND_ROLES data from the csv file and do a db build this  with resolve the issue.

Thank you