Files
proxmox/docs/archive/fixes/BLOCKSCOUT_RESTART_FIX.md
defiQUG cb47cce074 Complete markdown files cleanup and organization
- Organized 252 files across project
- Root directory: 187 → 2 files (98.9% reduction)
- Moved configuration guides to docs/04-configuration/
- Moved troubleshooting guides to docs/09-troubleshooting/
- Moved quick start guides to docs/01-getting-started/
- Moved reports to reports/ directory
- Archived temporary files
- Generated comprehensive reports and documentation
- Created maintenance scripts and guides

All files organized according to established standards.
2026-01-06 01:46:25 -08:00

90 lines
2.0 KiB
Markdown

# Fix Blockscout Container Restart Issue
**Issue**: Blockscout container is restarting repeatedly
**Status**: Diagnosing...
---
## Quick Fix Commands
Run these in your SSH session to the container:
```bash
# 1. Check logs to see error
docker logs --tail 50 blockscout
# 2. Stop containers
cd /opt/blockscout # or /root/blockscout
docker-compose down
# 3. Verify PostgreSQL is ready
docker exec blockscout-postgres pg_isready -U blockscout
# 4. Test RPC connectivity
curl -X POST http://192.168.11.250:8545 \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
# 5. Check docker-compose.yml for issues
cat docker-compose.yml | grep -A 5 "blockscout:"
# 6. Ensure SECRET_KEY_BASE is set (not using $())
SECRET_KEY=$(openssl rand -hex 64)
sed -i "s|SECRET_KEY_BASE=.*|SECRET_KEY_BASE=${SECRET_KEY}|" docker-compose.yml
# 7. Remove any command overrides
sed -i '/^\s*command:/d' docker-compose.yml
sed -i '/^\s*entrypoint:/d' docker-compose.yml
# 8. Restart
docker-compose up -d
docker logs -f blockscout
```
---
## Common Issues and Fixes
### Issue 1: SECRET_KEY_BASE Not Generated
**Fix:**
```bash
SECRET_KEY=$(openssl rand -hex 64)
sed -i "s|SECRET_KEY_BASE=.*|SECRET_KEY_BASE=${SECRET_KEY}|" docker-compose.yml
```
### Issue 2: Database Not Ready
**Fix:**
```bash
# Wait for PostgreSQL
docker exec blockscout-postgres pg_isready -U blockscout
# If not ready, restart postgres
docker-compose restart postgres
```
### Issue 3: RPC Endpoint Not Accessible
**Fix:**
```bash
# Test RPC
curl -X POST http://192.168.11.250:8545 \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
```
### Issue 4: Command Override in docker-compose.yml
**Fix:**
```bash
# Remove command/entrypoint overrides
sed -i '/command:/d' docker-compose.yml
sed -i '/entrypoint:/d' docker-compose.yml
docker-compose up -d blockscout
```
---
**Run the diagnosis script first to identify the specific issue!**