Illegal operation on a directory while starting ceramic node in docker

Hi I am trying to run a testnet node in my local using docker. I follow this documentation - Running in production - Ceramic Developers.

The ipfs container started and working properly. When I try to start the ceramic container using

docker run -d -p 7007:7007 -v /path_on_volume_for_daemon_config:/root/.ceramic/daemon.config.json -v /path_on_volume_for_ceramic_logs:/root/.ceramic/logs -v /path_on_volume_for_ceramic_statestore:/root/.ceramic/statestore -e NODE_ENV=production --name js-ceramic ceramicnetwork/js-ceramic:latest

The container stops running with the following error.

Ceramic daemon failed to start up:
[Error: EISDIR: illegal operation on a directory, read] {
errno: -21,
code: ‘EISDIR’,
syscall: ‘read’
}

There is a note in documentation specifying Before running the Ceramic daemon, configure it to use IPFS in “remote” mode. But I am not sure how to update it. I am doubtful if it is causing this error.

Thanks in advance for any help :slightly_smiling_face:

1 Like

You told it to try to read the config from root’s home directory which you, as a normal user, don’t have permission to read. (Or, Docker is running as root and the directory doesn’t exist.)

In any case, if you want a testnet node, you should follow the development setup rather than production.

1 Like

Thanks for your answer. Now I got the point and changed the path of daemon.config.json.

The config contains the following

{
    "anchor": {
        "ethereum-rpc-url": "https://eg_infura_endpoint" // Replace with an Ethereum RPC endpoint to avoid rate limiting
    },
    "http-api": {
        "cors-allowed-origins": [
            ".*"
        ]
    },
    "ipfs": {
        "mode": "remote",
        "host": "http://127.0.0.1:5001"
    },
    "logger": {
        "log-level": 2, // 0 is most verbose
        "log-to-files": true
    },
    "network": {
        "name": "testnet-clay", // Connect to mainnet, testnet-clay, or dev-unstable
    },
    "node": {},
    "state-store": {
        "mode": "fs",
        "local-directory": "/path_for_ceramic_statestore", // Defaults to $HOME/.ceramic/statestore
    }
}

Now I get an different error

Ceramic daemon failed to start up:
2023-01-19 18:05:49 SyntaxError: Unexpected token / in JSON at position 77
2023-01-19 18:05:49     at JSON.parse (<anonymous>)
2023-01-19 18:05:49     at Function.fromString (file:///js-ceramic/packages/cli/lib/daemon-config.js:242:33)
2023-01-19 18:05:49     at Function.fromFile (file:///js-ceramic/packages/cli/lib/daemon-config.js:247:39)
2023-01-19 18:05:49     at async Function.createDaemon (file:///js-ceramic/packages/cli/lib/ceramic-cli-utils.js:51:24)
2023-01-19 18:05:49     at async Command.<anonymous> (file:///js-ceramic/packages/cli/lib/bin/ceramic.js:28:5)

And I have an another doubt also should I provide a valid RPC url. If yes which network I should use for testnet-clay. Thanks

You can’t have comments in JSON.

Thanks @dysbulic. It worked :pray:

1 Like

The ceramic node connected to ipfs container started at port 7007. But I’m unable to read or write data, kindly find my logs below. Thanks in advance

2023-01-19 20:10:54 [2023-01-19T14:40:54.718Z] IMPORTANT: Starting Ceramic Daemon at version 2.18.0 with config: 
2023-01-19 20:10:54 {
2023-01-19 20:10:54   "anchor": {},
2023-01-19 20:10:54   "http-api": {
2023-01-19 20:10:54     "cors-allowed-origins": [
2023-01-19 20:10:54       ".*"
2023-01-19 20:10:54     ]
2023-01-19 20:10:54   },
2023-01-19 20:10:54   "ipfs": {
2023-01-19 20:10:54     "mode": "remote",
2023-01-19 20:10:54     "host": "http://192.168.0.105:5001"
2023-01-19 20:10:54   },
2023-01-19 20:10:54   "logger": {
2023-01-19 20:10:54     "log-level": 2,
2023-01-19 20:10:54     "log-to-files": true
2023-01-19 20:10:54   },
2023-01-19 20:10:54   "network": {
2023-01-19 20:10:54     "name": "testnet-clay"
2023-01-19 20:10:54   },
2023-01-19 20:10:54   "node": {},
2023-01-19 20:10:54   "state-store": {
2023-01-19 20:10:54     "mode": "fs",
2023-01-19 20:10:54     "local-directory": "/root/.ceramic/statestore/"
2023-01-19 20:10:54   }
2023-01-19 20:10:54 }
2023-01-19 20:10:54 [2023-01-19T14:40:54.836Z] IMPORTANT: Connecting to IPFS node available as /ip4/127.0.0.1/tcp/4001/p2p/QmWKpDoKkc3KxRq9fjN7uBRcvmHKNnTdYAFYJEfMAfxgKD, /ip4/127.0.0.1/tcp/8081/ws/p2p/QmWKpDoKkc3KxRq9fjN7uBRcvmHKNnTdYAFYJEfMAfxgKD, /ip4/172.18.0.2/tcp/4001/p2p/QmWKpDoKkc3KxRq9fjN7uBRcvmHKNnTdYAFYJEfMAfxgKD, /ip4/172.18.0.2/tcp/8081/ws/p2p/QmWKpDoKkc3KxRq9fjN7uBRcvmHKNnTdYAFYJEfMAfxgKD
2023-01-19 20:10:54 [2023-01-19T14:40:54.913Z] IMPORTANT: Connecting to ceramic network 'testnet-clay' using pubsub topic '/ceramic/testnet-clay'
2023-01-19 20:11:04 [2023-01-19T14:41:04.816Z] IMPORTANT: Connected to anchor service 'https://cas-clay.3boxlabs.com' with supported anchor chains ['eip155:100']
2023-01-19 20:11:06 [2023-01-19T14:41:06.014Z] WARNING: No pinned streams detected. This is expected if this is the first time this node has been run, but may indicate a problem with the node's persistence setup if it should have pinned streams
2023-01-19 20:11:06 [2023-01-19T14:41:06.074Z] IMPORTANT: Ceramic API running on 0.0.0.0:7007'
2023-01-19 20:12:37 [2023-01-19T14:42:37.298Z] ERROR: Error: Error connecting to CAS while attempting to anchor k2t6wyfsu4pfx6ec5lu9cctk50fzfiiq2hkr3v4u7h7be9saiagh5pzwzg4izn at commit bafyreiatvxbvsbbuq43e6ts5ow7fo4rvziwg4vhqxwbzdmj7xz5e6i3vem: HTTP request to 'https://cas-clay.3boxlabs.com/api/v0/requests' failed with status 'Bad Request': {"error":"Creating request with streamId k2t6wyfsu4pfx6ec5lu9cctk50fzfiiq2hkr3v4u7h7be9saiagh5pzwzg4izn and commit CID bafyreiatvxbvsbbuq43e6ts5ow7fo4rvziwg4vhqxwbzdmj7xz5e6i3vem failed: Cannot read properties of undefined (reading 'cid')"}
2023-01-19 20:12:37 [2023-01-19T14:42:37.393Z] ERROR: Error: Error connecting to CAS while attempting to anchor k2t6wyfsu4pfx6ec5lu9cctk50fzfiiq2hkr3v4u7h7be9saiagh5pzwzg4izn at commit bafyreiatvxbvsbbuq43e6ts5ow7fo4rvziwg4vhqxwbzdmj7xz5e6i3vem: HTTP request to 'https://cas-clay.3boxlabs.com/api/v0/requests' failed with status 'Bad Request': {"error":"Creating request with streamId k2t6wyfsu4pfx6ec5lu9cctk50fzfiiq2hkr3v4u7h7be9saiagh5pzwzg4izn and commit CID bafyreiatvxbvsbbuq43e6ts5ow7fo4rvziwg4vhqxwbzdmj7xz5e6i3vem failed: Cannot read properties of undefined (reading 'cid')"}
2023-01-19 20:13:38 [2023-01-19T14:43:38.769Z] ERROR: Error: Error connecting to CAS while attempting to anchor k2t6wyfsu4pfx6ec5lu9cctk50fzfiiq2hkr3v4u7h7be9saiagh5pzwzg4izn at commit bafyreiatvxbvsbbuq43e6ts5ow7fo4rvziwg4vhqxwbzdmj7xz5e6i3vem: HTTP request to 'https://cas-clay.3boxlabs.com/api/v0/requests' failed with status 'Bad Request': {"error":"Creating request with streamId k2t6wyfsu4pfx6ec5lu9cctk50fzfiiq2hkr3v4u7h7be9saiagh5pzwzg4izn and commit CID bafyreiatvxbvsbbuq43e6ts5ow7fo4rvziwg4vhqxwbzdmj7xz5e6i3vem failed: Cannot read properties of undefined (reading 'cid')"}

Its working now, haven’t made any changes :+1:

1 Like

We were having some IPFS issues earlier this week, glad they went away for you! Let us know if they return.

Thanks for jumping in here to help dys!