erigon icon indicating copy to clipboard operation
erigon copied to clipboard

Whitespace Processing Issues

Open wschwab opened this issue 2 years ago • 1 comments

Rationale

I've been working on getting a systemd service for running an Erigon node. I followed a couple of scripts from experienced node runners, but ended up with some weird issues. I had commands that would run on the command line, but not in a systemd service. After spending a while debugging, I discovered the following:

The command I was using to start Erigon was multi-line, with each line ending with a \ in order to merge the next line into it. I discovered that the command's first line had a bunch of trailing whitespace on the first line (ExecStart=/usr/local/bin/erigon \). Looking at systemctl status erigon, it looked like the remaining parts of the command (all of the flags, in other words) might have not been being read.

I don't think this is a bug, since the way the whitespace is being trimmed, or ensuing flags ignored, may be the desired behavior.

I am not 100% sure about this. I experimented for a few hours, and when I finally got things working, this is the best guess I had. If this is the case, then I would ask for better whitespace handling. Copying and pasting scripts is common practice, especially for more casual users and/or beginners. Making sure whitespace can be trimmed shouldn't harm usability, and can aid these users.

Implementation

I don't know the codebase, but I would suspect that if I identified what's happening correctly, that any whitespace between the command starting Erigon and the flags should be trimmed.

This is my first time opening an issue here, so I'm not sure how much information to provide, or what might be useful - I'm happy to provide whatever I can to try to help here. Apologies if I'm not id'ing the issue I experienced properly too.

wschwab avatar Aug 24 '22 10:08 wschwab

I recommend adding the flags using --config

enriavil1 avatar Aug 24 '22 21:08 enriavil1

use IDE to edit .service files - it can highlight spaces, miss-types, etc... Erigon can't fix systemd file parsing logic, maybe can report bad .service file to systemd team.

AskAlexSharov avatar Aug 26 '22 03:08 AskAlexSharov