How to Resolve Common Nacos Startup Errors on Ubuntu
This article explains two frequent Nacos issues on Ubuntu—startup failures caused by shell syntax errors and database creation errors for Derby data—provides the exact error messages, shows the problematic commands, and offers step‑by‑step fixes including using bash with the correct flags and removing the corrupted Derby directory before restarting.
Problem 1: Ubuntu Nacos startup error
Issue description
The command sh startup.sh -m standalone fails with errors such as
. /startup.sh: 78: ./startup: [[: not found
./startup.sh: 88: ./startup.sh: [[: not found
./startup.sh: 90: ./startup.sh: [[: not found
./startup.sh: 96: ./startup.sh: [[: not foundSolution
Run the script with bash and the -f flag: bash -f ./startup.sh -m standalone This starts Nacos correctly.
Problem 2: Failed to create database '/data/soft/nacos/data/derby-data'
Issue description
When executing the same startup command, the following exception is thrown:
Caused by: java.lang.RuntimeException: load schema.sql error.
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Failed to create database '/data/nacos/data/derby-data', ...)
at com.alibaba.nacos.config.server.service.LocalDataSourceServiceImpl.reload(...)
... (stack trace continues)Solution
Delete the directory /data/nacos/data/derby-data that contains the corrupted Derby files, then restart Nacos using the corrected command.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
