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.

Programmer DD
Programmer DD
Programmer DD
How to Resolve Common Nacos Startup Errors on Ubuntu

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 found

Solution

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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavaShellUbuntu
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.