Search

Troubleshooting

Find here common solutions to frequently occurring issues.

Content

Core Data & Services (CDS)

How Do I Resolve Installation Issues with NPM?

Check the registry settings of your npm configuration

Make sure that you don’t have old registry entries anymore for @sap:registry in your .npmrc. Just execute:

  npm config delete "@sap:registry"

Type npm config list to check the configuration, which is stored in a file .npmrc in the users home directory. There, no @sap:registry should appear.

Learn more about the move to npmjs.org in the blog post by DJ Adams.

Check the Node.js version

Make sure you run the latest long-term support (LTS) version of Node.js with an even number like 14. Refrain from using odd versions, for which some modules with native parts will have no support and thus might even fail to install. Check version with:

  node -v

Learn more about the release schedule of Node.js. Learn about ways to install Node.js.

Check access permissions on Mac or Linux

In case you get error messages like Error: EACCES: permission denied, mkdir '/usr/local/...' when installing a global module like @sap/cds-dk, configure npm to use a different directory for global modules:

  mkdir ~/.npm-global ; npm set prefix '~/.npm-global'
  export PATH=~/.npm-global/bin:$PATH

Also add the last line to your user profile, for example, ~/.profile, so that future shell sessions have the changed PATH as well.

Learn more about other ways to handle this error.

Check if your environment variables are properly set on Windows

Global npm installations are stored in a user-specific directory on your machine. On Windows, this directory usually is:

  C:\Users\<your-username>\AppData\Roaming\npm

Make sure that your PATH-environment variable contains this path.

In addition set the variable NODE_PATH to
C:\Users\<your-username>\AppData\Roaming\npm\node_modules.

How Do I Consume a New Version of CDS?

  • Design time tools like cds init

    Install and update @sap/cds-dk globally using npm i -g @sap/cds-dk.

  • Node.js runtime

    Maintain the version of @sap/cds in the top-level package.json of your application in the dependencies section.

    Learn more about recommendations for Node.js dependencies.

  • Java runtime

    Maintain the version in the pom.xml of your Java module, which is located in the root folder. In this file, modify the property cds.services.version.

Why Can’t My xs-security.json File Be Used to Create an XSUAA Service Instance?

Root Cause: Your file isn’t UTF-8 encoded. If you executed cds compile with Windows PowerShell, the encoding of your xs-security.json file is wrong.
Solution: Make sure, you execute cds compile in a command prompt that encodes in UTF-8 when piping output into a file.

You can find related information on Stack Overflow.

Node.js

Why are requests occasionally rejected with “ResourceRequest timed out”?

This error indicates, that the settings of the pool containing the database clients don’t match the application’s needs. There are two possible root causes.

Root Cause 1: The maximum number of database clients in the pool is reached and additional requests wait too long for the next client.
Root Cause 2: The amount of time for creating a new connection to the database takes too long.
Solution: Adapt max or acquireTimeoutMillis with more appropriate values, according to the documentation.

SAP HANA

How to Get an SAP HANA Cloud Instance on SAP Cloud Platform Cloud Foundry Environment?

On https://saphanajourney.com, there’s a description on the trial service and how to configure SAP HANA Cloud. See How to create your trial SAP HANA Cloud instance for more details.

On trial, your SAP HANA Cloud instance will be automatically stopped overnight, according to the server region time zone. That means you need to restart your instance every day, before you start working with your trial.

See the documentation for SAP HANA Cloud on SAP Cloud Platform.

I removed sample data (.csv file) from my project. Still, the data is deployed and overwrites existing data.

Root Cause You’ve build your database artifacts with the production profile and have configured SAP HANA for production. This creates artifacts that trigger the deployment, no matter if you remove the initial .csv files.
Solution Add an undeploy.json file to the root of your database module (the db folder by default). This file defines the files and data to be deleted. See HDI Delta Deployment and Undeploy Whitelist for more information.

If you want to keep the data from .csv files and data you’ve already added, see SAP Note 2922271 - Undeploy an HDI .hdbtabledata artifact without losing the content of the associated table.

How Do I Resolve Service Creation Errors?

  • If there’s more than one SAP HANA DB mapped to your Cloud Foundry space, service creation fails. In this case, you need to specify the DB: cf create-service ... -c "{\"database_id\":\"XXX\" }" where XXX is the ID of the DB instance.
  • On trial landscapes, you need to use hanatrial instead of hana as service type: cf create-service hanatrial ...

How Do I Resolve Deployment Errors?

Deployment fails — Cyclic dependencies found or Cycle between files

Root Cause This is a known issue with older HDI/HANA versions, which are offered on trial landscapes.
Solution Apply the workaround of adding --treat-unmodified-as-modified as argument to the hdi-deploy command in db/package.json. This option redeploys files, even if they haven’t changed. If you’re the owner of the SAP HANA installation, ask for an upgrade of the SAP HANA instance.

Deployment fails — Version incompatibility

Root Cause An error like Version incompatibility for the ... build plugin: "2.0.x" (installed) is incompatible with "2.0.y" (requested) indicates that your project demands a higher version of SAP HANA than what is available in your org/space on the Cloud Foundry environment. The error might not occur on other landscapes for the same project.
Solution Lower the version in file db/src/.hdiconfig to the one given in the error message. If you’re the owner of the SAP HANA installation, ask for an upgrade of the SAP HANA instance.

Deployment fails — Cannot create certificate store

Root Cause If you deploy to SAP HANA from a local Windows machine, this error might occur if the SAP CommonCryptoLib isn’t installed on this machine. It’s required by the SAP HANA client to manage certificates locally.
Solution To install it, follow these instructions. If this doesn’t solve the problem, please also set the environment variables as described here.

Deployment fails —

  • Failed to get connection for database
  • Connection failed (RTE:[300015] SSL certificate validation failed
  • Cannot create SSL engine: Received invalid SSL Record Header
Root Cause Your SAP HANA Cloud instance is stopped.
Solution Start your SAP HANA Cloud instance.

Deployment fails — Cannot create SSL engine: Received invalid SSL Record Header

Root Cause Your SAP HANA Cloud instance is stopped.
Solution Start your SAP HANA Cloud instance.

Deployment fails — Error: HDI make failed

Root Cause Your configuration isn’t properly set.
Solution Configure your project as described in Using Databases.

Deployment fails — Connection failed (RTE:[89008] Socket closed by peer

Root Cause Your IP isn’t part of the filtering you configured when you created an SAP HANA Cloud instance.
Solution Configure your SAP HANA Cloud instance to accept your IP.

Eclipse

  • In Problems view, execute Quick fix from the context menu if available. If Eclipse asks you to install additional Maven Eclipse plug-ins to overcome the error, do so.
  • Errors like ‘Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:exec-maven-plugin) can be ignored. Do so in Problems view > Quick fix context menu > Mark goal as ignored in Eclipse preferences.
  • In case, there are still errors in the project, use Maven > Update Project… from the project’s context menu.

SQLite

How Do I Install SQLite on Windows?

  • From the SQLite page, download the precompiled binaries for Windows sqlite-tools-win*.zip.

  • Create a folder C:\sqlite and unzip the downloaded file in this folder to get the file sqlite3.exe.

  • Start using SQLite directly by opening sqlite3.exe from the folder sqlite or from the command line window opened in C:\sqlite.

  • Optional: Add C:\sqlite in your PATH environment variable. As soon as the configuration is active, you can start using SQLite from every location on your Windows installation.

  • Use the command sqlite3 to connect to the in-memory database:

C:\sqlite>sqlite3
SQLite version ...
Enter ".help" for instructions
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite>

If you want to test further, use .help command to see all available commands in sqlite3.

In case you want a visual interface tool to work with SQLite, you can use SQLTools. It’s available as an extension for VS Code and integrated in SAP Business Application Studio.

Multitarget Application (MTA)

Why Does My MTA Build Fail?

How Can I Define the Build Order Between MTA Modules?

By default the MTA build tool executes module builds in parallel. If you want to enforce a specific build order, for example, because one module build relies on the outcome of another one, check the Configuring build order section in the tool documentation.

How Do I Undeploy an MTA?

cf undeploy <mta-id> deletes an MTA (use cf mtas to find the MTA ID).

Use the optional --delete-services parameter to also wipe service instances.
Caution: This deletes the HDI containers with the application data.

Cloud Foundry

How Do I Get Started with Cloud Foundry Environment of SAP Cloud Platform?

For a start, create your Trial Account.

SAP-Inhouse Development

For SAP-inhouse development uses the Canary landscape:

  • API endpoint: https://api.cf.sap.hana.ondemand.com
  • User ID: your D/I user
  • Password: your GLOBAL password

On Canary, you can use the provided Try Out CF space if you don’t have an own. This space includes an SAP HANA service, but all apps are wiped daily.

To get an own org and space on the SAP Cloud Platform Cloud Foundry environment, see Request a Cloud Foundry org for your projects. Then, you need to have an SAP HANA service connected to your Cloud Foundry space. See this process for getting a HaaS instance on Canary.

How Do I Resolve Errors with cf Executable?

Installation fails — mkdir … The system cannot find the path specified

This is a known issue on Windows. The fix is to set the HOMEDRIVE environment variable to C:. In any cmd shell session, you can do so with SET HOMEDRIVE=C:
Also, make sure to persist the variable for future sessions in the system preferences. See How do I set my system variables in Windows for more details.

cf commands fail — Error writing config

This is the same issue as with the installation error above.

How Can I Connect to a Backing Service Container like SAP HANA from My Local Machine?

Depending on, whether the container host is reachable and whether there’s a proxy between your machine and the cloud, one of the following options applies:

  • CF SSH

    The second most convenient way is the cf ssh capability of Cloud Foundry CLI. You can open an SSH tunnel to the target Cloud Foundry container, if these prerequisites are met:

    • There’s no HTTP proxy in the way. Those only let HTTP traffic through.
    • SSH access is enabled for the CF landscape and your space (in Canary this is true, otherwise check with cf ssh-enabled).

    Use it like this:

      cf ssh <app> -L localhost:<LocalPort>:<RemoteIP>:<RemotePort>
    

    where <app> has to be a running application that is bound to the service.

    Example:

    Connect to a HANA service running on remote host 10.10.10.10, port 30010.

      cf ssh <app> -L localhost:30010:10.10.10.10:30010
    

    From then on, use localhost:30010 instead of the remote address.

    Learn more about cf ssh.

  • Chisel

    In all other cases, for example, if there’s an HTTP proxy between you and the cloud, you can resort to a TCP proxy tool, called Chisel. This also applies if the target host isn’t reachable on a network level. You need to install Chisel in your target space and that will tunnel TCP traffic over HTTP from your local host to the target (and vice versa).

    Find step-by-step instructions here. For example, to connect to an SAP HANA service running on remote host 10.10.10.10, port 30010:

      bin/chisel_... client --auth secrets https://<url_to_chisel_server_app> localhost:30010:10.10.10.10:30010
    

    From then on, use localhost:30010 instead of the remote address.

    Learn more about Chisel

xMake

xMake builds fail because of SQLite binaries

xMake builds might fail in, for example npm install operations with an error message like binaries not installable for sqlite3. This is most likely caused by a blocked Internet connectivity on the xMake build servers, so that npm can’t download the sqlite3 binaries from the Internet.
To fix this, add an entry like this in your .xmake.cfg file:

  [env_all]
  npm_config_node_sqlite3_binary_host_mirror=http://nexus.wdf.sap.corp:8081/nexus/content/repositories/build.releases.unzip/com/sap/cds/node-sqlite3-binary/5.0.0/node-sqlite3-binary-5.0.0.zip-unzip

This makes npm fetch the sqlite binaries from SAP’s Nexus. If the build fails, you might need to adjust the version in the URL above to the latest version available.

xMake builds fail with Connection refused

If the build fails with “Connect to proxy:8080 failed: Connection refused”, disable the proxy in the .xmake.cfg:

  [buildplugin]
  noproxy=true

How can I specify the Maven version in xMake?

In your .xmake.cfg, set this:

  [buildplugin]
  maven-version=3.6.0
Show/Hide Beta Features