You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

按Corda V3.1文档部署Ubuntu服务启动Cordapp时遇Permission denied错误

Fixing "Permission Denied" Error When Starting Corda Node as Systemd Service on Ubuntu

Hey there, let's work through this permission denied error you're facing when launching your Corda example node (Party B) as a systemd service on Ubuntu. This is a common issue tied to file system permissions or service configuration, so here are the key steps to diagnose and fix it:

1. Verify Node Directory Permissions

First, make sure the user running your Corda service has full read/write access to the node's root directory and all its contents.

  • Find your node's directory (e.g., /opt/corda/nodes/partyB), then check its current ownership and permissions with:
    ls -ld /opt/corda/nodes/partyB
    
  • If the owner isn't the user your systemd service runs as (let's assume you're using a dedicated corda user), fix the ownership recursively:
    sudo chown -R corda:corda /opt/corda/nodes/partyB
    
  • Ensure the user has read, write, and directory execution permissions:
    sudo chmod -R u+rwX /opt/corda/nodes/partyB
    
    (The X flag adds execution rights only to directories, not files—this is safer than full 777 permissions.)

2. Configure Systemd Service to Run as the Correct User

If your systemd service is running as root (the default if not specified), it might clash with permissions set for a regular corda user. Update your service file (typically at /etc/systemd/system/corda-partyB.service):

  • Add these lines under the [Service] section:
    User=corda
    Group=corda
    
  • Reload systemd to pick up the changes, then restart the service:
    sudo systemctl daemon-reload
    sudo systemctl restart corda-partyB
    

3. Check Temporary Directory Permissions

Java relies on the /tmp directory for temporary files, and incorrect permissions here can cause the error.

  • Verify /tmp has the correct sticky-bit permissions:
    ls -ld /tmp
    
    You should see output like drwxrwxrwt—the t at the end is critical.
  • If not, fix it with:
    sudo chmod 1777 /tmp
    

4. Validate Node Configuration Paths

Double-check your node.conf file for paths that might point to restricted directories:

  • Look for settings like baseDirectory, logPath, or database persistence paths. For example, if logs are configured to write to /var/log/corda, ensure the corda user owns that directory:
    sudo mkdir -p /var/log/corda
    sudo chown corda:corda /var/log/corda
    

5. Test Manual Node Execution

To confirm the issue is permission-related, switch to the corda user and run the node manually:

su - corda
java -jar /opt/corda/corda.jar --config-file /opt/corda/nodes/partyB/node.conf

If you get the same permission error here, it confirms the problem is with the user's access rights rather than systemd-specific configuration.

Most of the time, the root cause is a mismatch between the systemd service's running user and the node directory's ownership. Following these steps should resolve the "Permission denied" error and get your Party B node up and running.

内容的提问来源于stack exchange,提问作者Austin Moothart

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 08:30:58