Skip to content

Ethereum indexer fails on startup when block.data is created as directory #67

Description

@MrLutik

Description

The Ethereum indexer fails on startup with the following error:

ERROR tasks/block.go:118 tasks - BlockManager - set last block - write to file
{"error": "open /srv/block.data: is a directory"}

Root Cause

When Docker Compose starts with the volume mount:

- "./worker/ethereum/sai-ethereum-indexer/block.data:/srv/block.data"

If the source path does not exist on the host, Docker creates it as a directory instead of a file. The indexer expects a regular file to store the last processed block height.

Affected Code

  • worker/ethereum/sai-ethereum-indexer/tasks/block.go:116 - ioutil.WriteFile() fails when path is a directory
  • Volume mount in docker-compose configuration

Workaround

rm -rf ./worker/ethereum/sai-ethereum-indexer/block.data
touch ./worker/ethereum/sai-ethereum-indexer/block.data
docker compose restart ethereum-indexer


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions