Geth version: 1.5.9-stable-a07539fb
OS & Version: tested in Ubuntu Server 16.10
Geth can be run with a --data-dir of a reasonably long length.
Geth shuts down unexpectedly if --data-dir's path is too long. Error message/logs are not clear about why.
I originally saw this on a buildkite agent who's --data-dir absolute path length was 110 characters long total.
I started with something much more complex and narrowed it down to path length, the same script runs successfully when i set --data-dir to ~/.ethereum-test
geth --verbosity 7 --datadir ~/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server/.ethereum-test
````
buildkite-agent@ubuntu-roo:~/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server$ geth --datadir .ethereum-test
I0403 22:44:56.235110 ethdb/database.go:83] Allotted 128MB cache and 1024 file handles to /var/lib/buildkite-agent/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server/.ethereum-test/geth/chaindata
I0403 22:44:56.331172 ethdb/database.go:176] closed db:/var/lib/buildkite-agent/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server/.ethereum-test/geth/chaindata
I0403 22:44:56.331725 node/node.go:176] instance: Geth/v1.5.9-stable-a07539fb/linux/go1.7.3
I0403 22:44:56.331758 ethdb/database.go:83] Allotted 128MB cache and 1024 file handles to /var/lib/buildkite-agent/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server/.ethereum-test/geth/chaindata
I0403 22:44:56.350592 eth/backend.go:187] Protocol Versions: [63 62], Network Id: 1
I0403 22:44:56.350866 eth/backend.go:215] Chain config: {ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000}
I0403 22:44:56.351436 core/blockchain.go:219] Last header: #0 [d4e56740鈥 TD=17179869184
I0403 22:44:56.351458 core/blockchain.go:220] Last block: #0 [d4e56740鈥 TD=17179869184
I0403 22:44:56.351469 core/blockchain.go:221] Fast block: #0 [d4e56740鈥 TD=17179869184
I0403 22:44:56.352311 p2p/server.go:340] Starting Server
I0403 22:44:58.529091 p2p/discover/udp.go:227] Listening, enode://6755736722bcb90168bcff996bf21ef68cf9a854c36cbd57e27ff8b03534701298152da77d6f9c7d027c011c1eabc5425e53c8b696557bf4e58ad29c4028d916@124.170.142.189:30303
I0403 22:44:58.530864 p2p/server.go:608] Listening on [::]:30303
I0403 22:44:58.532139 core/blockchain.go:589] Chain manager stopped
I0403 22:44:58.532156 eth/handler.go:230] Stopping ethereum protocol handler...
I0403 22:44:58.532179 eth/handler.go:251] Ethereum protocol handler stopped
I0403 22:44:58.532221 core/tx_pool.go:196] Transaction pool stopped
I0403 22:44:58.532243 eth/backend.go:519] Automatic pregeneration of ethash DAG OFF (ethash dir: /var/lib/buildkite-agent/.ethash)
I0403 22:44:58.532406 ethdb/database.go:176] closed db:/var/lib/buildkite-agent/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server/.ethereum-test/geth/chaindata
I0403 22:44:58.804511 p2p/nat/nat.go:111] mapped network port udp:30303 -> 30303 (ethereum discovery) using UPNP IGDv1-PPP1
I0403 22:44:59.123324 p2p/nat/nat.go:111] mapped network port tcp:30303 -> 30303 (ethereum p2p) using UPNP IGDv1-PPP1
Fatal: Error starting protocol stack: listen unix /var/lib/buildkite-agent/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server/.ethereum-test/geth.ipc: bind: invalid argument
buildkite-agent@ubuntu-roo:~/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server$ geth --verbosity 7 --datadir .ethereum-test
I0403 22:45:27.775369 accounts/keystore/account_cache.go:228] reloaded keys, cache has 1 accounts
I0403 22:45:27.775455 accounts/keystore/watch.go:74] now watching /var/lib/buildkite-agent/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server/.ethereum-test/keystore
I0403 22:45:27.775657 accounts/keystore/account_cache.go:228] reloaded keys, cache has 1 accounts
I0403 22:45:27.776209 ethdb/database.go:83] Allotted 128MB cache and 1024 file handles to /var/lib/buildkite-agent/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server/.ethereum-test/geth/chaindata
I0403 22:45:27.783397 ethdb/database.go:176] closed db:/var/lib/buildkite-agent/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server/.ethereum-test/geth/chaindata
I0403 22:45:27.783919 node/node.go:176] instance: Geth/v1.5.9-stable-a07539fb/linux/go1.7.3
I0403 22:45:27.783951 ethdb/database.go:83] Allotted 128MB cache and 1024 file handles to /var/lib/buildkite-agent/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server/.ethereum-test/geth/chaindata
I0403 22:45:27.802777 eth/backend.go:187] Protocol Versions: [63 62], Network Id: 1
I0403 22:45:27.803131 eth/backend.go:215] Chain config: {ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000}
I0403 22:45:27.803854 core/blockchain.go:219] Last header: #0 [d4e56740鈥 TD=17179869184
I0403 22:45:27.803880 core/blockchain.go:220] Last block: #0 [d4e56740鈥 TD=17179869184
I0403 22:45:27.803894 core/blockchain.go:221] Fast block: #0 [d4e56740鈥 TD=17179869184
I0403 22:45:27.804193 eth/handler.go:182] Bad Block Reporting is enabled
I0403 22:45:27.804268 eth/downloader/downloader.go:1474] Quality of service: rtt 20s, conf 1.000, ttl 1m0s
I0403 22:45:27.804980 p2p/server.go:340] Starting Server
I0403 22:45:29.972758 p2p/discover/udp.go:227] Listening, enode://6755736722bcb90168bcff996bf21ef68cf9a854c36cbd57e27ff8b03534701298152da77d6f9c7d027c011c1eabc5425e53c8b696557bf4e58ad29c4028d916@124.170.142.189:30303
I0403 22:45:29.972985 p2p/server.go:608] Listening on [::]:30303
I0403 22:45:29.973047 p2p/server.go:470] new task: discovery lookup
I0403 22:45:29.973119 node/node.go:304] InProc registered *node.PrivateAdminAPI under 'admin'
I0403 22:45:29.973187 node/node.go:304] InProc registered *node.PublicAdminAPI under 'admin'
I0403 22:45:29.973374 node/node.go:304] InProc registered *debug.HandlerT under 'debug'
I0403 22:45:29.973414 node/node.go:304] InProc registered *node.PublicDebugAPI under 'debug'
I0403 22:45:29.973471 node/node.go:304] InProc registered *node.PublicWeb3API under 'web3'
I0403 22:45:29.973524 node/node.go:304] InProc registered *ethapi.PublicCompilerAPI under 'eth'
I0403 22:45:29.973556 core/state/statedb.go:455] (+) e22d2d817684ebdb735e120bd60ce2bb3a42c7fd
I0403 22:45:29.973666 core/state/state_object.go:270] e22d2d817684ebdb735e120bd60ce2bb3a42c7fd: #0 115792089237316195423570985008687907853269984665640564039455084007913129639935 (- 2500000000000000000)
I0403 22:45:29.973843 core/state/statedb.go:455] (+) fa7b9770ca4cb04296cac84f37736d4041251cdf
I0403 22:45:29.973898 core/state/state_object.go:257] e22d2d817684ebdb735e120bd60ce2bb3a42c7fd: #1 115792089237316195423570985008687907853269984665640564039457582944313129639935 (+ 2498936400000000000)
I0403 22:45:29.974013 core/state/statedb.go:455] (+) 0000000000000000000000000000000000000000
I0403 22:45:29.974040 core/state/state_object.go:257] 0000000000000000000000000000000000000000: #0 1063600000000000 (+ 1063600000000000)
I0403 22:45:29.974068 internal/ethapi/api.go:578] call took 806.015碌s
I0403 22:45:29.974179 p2p/discover/udp.go:467] >>> 209.50.130.66:12403 discover.pong
I0403 22:45:29.973561 node/node.go:304] InProc registered *ethapi.CompilerAdminAPI under 'admin'
I0403 22:45:29.974249 p2p/discover/udp.go:528] <<< 209.50.130.66:12403 *discover.ping: ok
I0403 22:45:29.974256 contracts/release/release.go:131] Release oracle not found at fa7b9770ca4cb04296cac84f37736d4041251cdf
I0403 22:45:29.974327 node/node.go:304] InProc registered *ethapi.PublicEthereumAPI under 'eth'
I0403 22:45:29.974339 p2p/discover/database.go:183] failed to retrieve node 97afe981840a9438bf6aad724715f21d306b5132c38a2930a608df60537ff10a8c20be002656925f49e76cb7c389769e6a2655638789463d17761ce25568915f: leveldb: not found
I0403 22:45:29.974387 p2p/discover/table.go:473] Bonding 97afe981840a9438: known=false, fails=0 age=414228h45m29.974381423s
I0403 22:45:29.974474 node/node.go:304] InProc registered *ethapi.PublicBlockChainAPI under 'eth'
I0403 22:45:29.974705 node/node.go:304] InProc registered *ethapi.PublicTransactionPoolAPI under 'eth'
I0403 22:45:29.974749 node/node.go:304] InProc registered *ethapi.PublicTxPoolAPI under 'txpool'
I0403 22:45:29.974787 node/node.go:304] InProc registered *ethapi.PublicDebugAPI under 'debug'
I0403 22:45:29.974803 p2p/discover/udp.go:467] >>> 209.50.130.66:12403 discover.ping
I0403 22:45:29.974829 node/node.go:304] InProc registered *ethapi.PrivateDebugAPI under 'debug'
I0403 22:45:29.974860 node/node.go:304] InProc registered *ethapi.PublicAccountAPI under 'eth'
I0403 22:45:29.974964 node/node.go:304] InProc registered *ethapi.PrivateAccountAPI under 'personal'
I0403 22:45:29.975003 node/node.go:304] InProc registered *eth.PublicEthereumAPI under 'eth'
I0403 22:45:29.975048 node/node.go:304] InProc registered *eth.PublicMinerAPI under 'eth'
I0403 22:45:29.975079 node/node.go:304] InProc registered *downloader.PublicDownloaderAPI under 'eth'
I0403 22:45:29.975139 node/node.go:304] InProc registered *eth.PrivateMinerAPI under 'miner'
I0403 22:45:29.975229 node/node.go:304] InProc registered *filters.PublicFilterAPI under 'eth'
I0403 22:45:29.975262 node/node.go:304] InProc registered *eth.PrivateAdminAPI under 'admin'
I0403 22:45:29.975285 node/node.go:304] InProc registered *eth.PublicDebugAPI under 'debug'
I0403 22:45:29.975383 node/node.go:304] InProc registered *eth.PrivateDebugAPI under 'debug'
I0403 22:45:29.975424 node/node.go:304] InProc registered *ethapi.PublicNetAPI under 'net'
I0403 22:45:29.975470 node/node.go:330] IPC registered *node.PrivateAdminAPI under 'admin'
I0403 22:45:29.975498 node/node.go:330] IPC registered *node.PublicAdminAPI under 'admin'
I0403 22:45:29.975565 node/node.go:330] IPC registered *debug.HandlerT under 'debug'
I0403 22:45:29.975582 node/node.go:330] IPC registered *node.PublicDebugAPI under 'debug'
I0403 22:45:29.975599 node/node.go:330] IPC registered *node.PublicWeb3API under 'web3'
I0403 22:45:29.975618 node/node.go:330] IPC registered *ethapi.PublicCompilerAPI under 'eth'
I0403 22:45:29.975634 node/node.go:330] IPC registered *ethapi.CompilerAdminAPI under 'admin'
I0403 22:45:29.975658 node/node.go:330] IPC registered *ethapi.PublicEthereumAPI under 'eth'
I0403 22:45:29.975736 node/node.go:330] IPC registered *ethapi.PublicBlockChainAPI under 'eth'
I0403 22:45:29.975856 node/node.go:330] IPC registered *ethapi.PublicTransactionPoolAPI under 'eth'
I0403 22:45:29.975877 node/node.go:330] IPC registered *ethapi.PublicTxPoolAPI under 'txpool'
I0403 22:45:29.975903 node/node.go:330] IPC registered *ethapi.PublicDebugAPI under 'debug'
I0403 22:45:29.975927 node/node.go:330] IPC registered *ethapi.PrivateDebugAPI under 'debug'
I0403 22:45:29.975945 node/node.go:330] IPC registered *ethapi.PublicAccountAPI under 'eth'
I0403 22:45:29.975974 p2p/discover/database.go:183] failed to retrieve node 979b7fa28feeb35a4741660a16076f1943202cb72b6af70d327f053e248bab9ba81760f39d0701ef1d8f89cc1fbd2cacba0710a12cd5314d5e0c9021aa3637f9: leveldb: not found
I0403 22:45:29.976021 node/node.go:330] IPC registered *ethapi.PrivateAccountAPI under 'personal'
I0403 22:45:29.976071 node/node.go:330] IPC registered *eth.PublicEthereumAPI under 'eth'
I0403 22:45:29.976080 p2p/discover/database.go:183] failed to retrieve node de471bccee3d042261d52e9bff31458daecc406142b401d4cd848f677479f73104b9fdeb090af9583d3391b7f10cb2ba9e26865dd5fca4fcdc0fb1e3b723c786: leveldb: not found
I0403 22:45:29.976021 p2p/discover/table.go:473] Bonding 979b7fa28feeb35a: known=false, fails=0 age=414228h45m29.976015943s
I0403 22:45:29.976096 p2p/discover/database.go:183] failed to retrieve node 1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082: leveldb: not found
I0403 22:45:29.976098 p2p/discover/database.go:183] failed to retrieve node a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c: leveldb: not found
I0403 22:45:29.976133 p2p/discover/table.go:473] Bonding de471bccee3d0422: known=false, fails=0 age=414228h45m29.976125082s
I0403 22:45:29.976156 p2p/discover/table.go:473] Bonding 1118980bf48b0a36: known=false, fails=0 age=414228h45m29.976147216s
I0403 22:45:29.976180 p2p/discover/table.go:473] Bonding a979fb575495b8d6: known=false, fails=0 age=414228h45m29.9761711s
I0403 22:45:29.976120 node/node.go:330] IPC registered *eth.PublicMinerAPI under 'eth'
I0403 22:45:29.976248 node/node.go:330] IPC registered *downloader.PublicDownloaderAPI under 'eth'
I0403 22:45:29.976299 node/node.go:330] IPC registered *eth.PrivateMinerAPI under 'miner'
I0403 22:45:29.976393 node/node.go:330] IPC registered *filters.PublicFilterAPI under 'eth'
I0403 22:45:29.976436 node/node.go:330] IPC registered *eth.PrivateAdminAPI under 'admin'
I0403 22:45:29.976473 node/node.go:330] IPC registered *eth.PublicDebugAPI under 'debug'
I0403 22:45:29.976495 p2p/discover/udp.go:467] >>> 5.1.83.226:30303 discover.ping
I0403 22:45:29.976566 node/node.go:330] IPC registered *eth.PrivateDebugAPI under 'debug'
I0403 22:45:29.976611 node/node.go:330] IPC registered *ethapi.PublicNetAPI under 'net'
I0403 22:45:29.976674 rpc/server.go:239] RPC Server shutdown initiatied
I0403 22:45:29.976673 p2p/discover/udp.go:467] >>> 52.16.188.185:30303 discover.ping
I0403 22:45:29.976695 core/blockchain.go:589] Chain manager stopped
I0403 22:45:29.976711 eth/handler.go:230] Stopping ethereum protocol handler...
I0403 22:45:29.976735 eth/handler.go:251] Ethereum protocol handler stopped
I0403 22:45:29.976781 core/tx_pool.go:196] Transaction pool stopped
I0403 22:45:29.976831 eth/backend.go:519] Automatic pregeneration of ethash DAG OFF (ethash dir: /var/lib/buildkite-agent/.ethash)
I0403 22:45:29.976956 ethdb/database.go:176] closed db:/var/lib/buildkite-agent/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server/.ethereum-test/geth/chaindata
I0403 22:45:29.976975 p2p/discover/udp.go:467] >>> 54.94.239.50:30303 discover.ping
I0403 22:45:29.976975 p2p/discover/udp.go:467] >>> 52.74.57.123:30303 discover.ping
I0403 22:45:29.977030 p2p/server.go:636] Read error: accept tcp [::]:30303: use of closed network connection
I0403 22:45:29.977024 p2p/server.go:493] <-quit: spinning down
I0403 22:45:29.977093 p2p/discover/udp.go:511] Read error: read udp [::]:30303: use of closed network connection
I0403 22:45:29.977127 p2p/discover/table.go:389] no seed nodes found
I0403 22:45:29.977290 p2p/server.go:569] ignoring 1 pending tasks at spindown
I0403 22:45:30.170644 p2p/nat/nat.go:111] mapped network port udp:30303 -> 30303 (ethereum discovery) using UPNP IGDv1-PPP1
I0403 22:45:30.170672 p2p/nat/nat.go:105] deleting port mapping: udp 30303 -> 30303 (ethereum discovery) using UPNP IGDv1-PPP1
I0403 22:45:30.835190 p2p/nat/nat.go:111] mapped network port tcp:30303 -> 30303 (ethereum p2p) using UPNP IGDv1-PPP1
I0403 22:45:30.835213 p2p/nat/nat.go:105] deleting port mapping: tcp 30303 -> 30303 (ethereum p2p) using UPNP IGDv1-PPP1
Fatal: Error starting protocol stack: listen unix /var/lib/buildkite-agent/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server/.ethereum-test/geth.ipc: bind: invalid argument
buildkite-agent@ubuntu-roo:~/builds/ubuntu-roo-1/aletheia/deploy-aletheia-headless-to-local-server$
````
You're hitting the limits of UNIX socket addresses. Geth doesn't start because it wants to bind a socket in the directory, but the OS doesn't allow it.
If you don't need IPC, the workaround is to start geth with --ipcdisable.
You can also explicitly put your socket in another folder via --ipcpath /my/path.
Ahh ok, I tested that your fixes worked. I guess that error message is not so bad I just didn't understand it. Thanks for looking into it.
Had the same problem --ipcdisable helped, thanks! Doing everything via HTTP anyways
Had this error - seems like the file path was too long. Shortened a folder name and got it working.
Most helpful comment
You can also explicitly put your socket in another folder via
--ipcpath /my/path.