-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
witness_node uses two incompatible parsers for config.ini #149
Comments
No, that commit handles the situation when two plugins share a common option (like witness and debug_witness in this case). |
Apparently steem has solved this by moving to a json format for the logging config: https://github.com/steemit/steem/releases/tag/v0.19.4rc1 |
Ideas I can think of for the config.ini "repeating option" problem:
ATM, I'm leaning towards 4, as we could implement that without affecting existing configurations. If the new option is there, set a flag and have the logging configuration parser look there for the file. 1 could be implemented where it does not affect existing installations. Read JSON, if parser fails, read the old way. |
I suggest either option 1 as a complete overhaul. or option 4 seeing as that method is already used with api-access.json |
we have implemented the option 3, I can offer the PR if you wish |
@ihla please do! thanks. Before this is fixed, the workaround for node admins is to specify the required options as command line arguments instead. E.G.
|
Thanks @ihla If we use Lubos' fix, we need to consider these questions: A. Do we migrate existing users' configuration settings to the new file, or tell them to do it themselves? |
I like automation, so if possible, please save my exiting config.ini file to config-.ini and rewrite a new one in proper format from legacy file. If that is too much effort, please fail on launch with exceedingly informative instr uctions to refactor the config.ini file manually. |
Automatic migration would be a one-time benefit for a few dozen (?) node operators. IMO not worth the effort. IMO we can apply simple logic
|
I agree with @pmconrad that the number of impacted users for this one time event does not warrent investment of time for automation. What is intended behavior at startup when: "config.ini exists but logging.ini does not"?
|
IMO parse config ini like we do now, i. e. for both "normal" config and logging config. No need to change anything if it's working for the node operator. |
That works as well. New features/parameters added into a new Release typically appear in the config.ini file. My practice has been to allow the software to create a new default config.ini file. I then copy/paste my values into the new .ini file and start it back up. |
I have some more questions regrading the implementation details: I believe the requirement is specified in this pseudo-code by @jmjatlanta If (config.ini does not exist) Parse config.ini for application configuration; If (logging.ini exists) I am not sure about this: should we replace the legacy config.ini with the new config.ini + backup the legacy config.ini? I have modified the pseudo-code to provide backup and new file creation: If (config.ini does not exist) // => fresh installation parse config.ini for application configuration; If (logging.ini exists) Please clarify the requirements so that I can proceed with the implementation, thx. |
My opinion was to allow the legacy config.ini to exist, and read the settings within it. Do not attempt to create the new ones. I was thinking that way so as to avoid the extra work. It would be great to read their settings and create a new one based on their old one. If you would like to tackle that, it would be appreciated. And in that case, yes, backing up the old ones would be important. Verifying the new ones exist and are readable would also be important. |
See my comment above:
IOW if a config.ini exists but logging.ini does not, use only config.ini and the logging config contained therein. |
I am going to implement the option presented in the original @jmjatlanta pseudo-code according to the @pmconrad guidance above. If I find the effort for the "automatic migration" is within my 4 hour estimate, I can offer the enhancement in other PR. |
Now #1024 has been merged. But I'm not sure whether it completely fixed this issue. Originally,
With the patch, if I have multiple "track-account" entries in |
For existing installations the behaviour will not change, i. e. if a config.ini exists and contains multiple entries with the same key, then the contained logging config will be ignored. This is deliberate, see discussion in #1024 (comment) - node operators must manually fix such broken installations, for example by adding a logging.ini file. New installations will have a config.ini and logging.ini generated. |
Update: I thought the fix was included in |
I'm running a private testnet and constantly getting logging parsing error
config.ini contains multiple witnesses
If I'm commenting out all witnesses except the first, logging begins to work. Bitshares version is recent, docker image 26b7a6685e66 Edit: logging configuration is in logging.ini is working, but it's not symlinked inside docker CT, will open a new issue for that. Opened #1723 |
From @pmconrad on January 14, 2016 17:14
The config.ini file used by the witness_node is parsed twice, with different parsers:
These two parsers are not entirely compatible, which sometimes leads to the second parse failing. This results in the default logging config being used instead of that in the config file.
Specifically, the ini_parser does not support repeating options. This conflicts with the documented (in the default config file) behaviour wrt the track-account option "Account ID to track history for (may specify multiple times)".
The problem is difficult to diagnose, because the reason for the parse failure is not logged.
Copied from original issue: cryptonomex/graphene#521
CORE TEAM TASK LIST
The text was updated successfully, but these errors were encountered: