Closed multimill closed 3 years ago
wg-meshconf was designed to accept new hosts at any point. If you encountered this issue as described, then you've either found a bug or didn't do it right. I didn't manage to reproduce this error at my end.
I took my test file and added a new line:
Then I ran init again:
Everything works as expected. Judging by the error message you're getting, are you sure you filled in Address
correctly and saved it to file?
I just tried again and I do have the same problem again. I am using the latest version of wg-meshconf on a Win10 machine. Running in normal cmd window.
I cannot upload .csv files here but I zipped them and uploaded them.
So, the v1 is the file I get when I create a new .csv file via "wg-meshconf init" and put in 2 new lines with two servers. After running "wg-meshconf init" again I get the v2. So I do paste the new Server3 below the new created lines and save it like the v3 file. When I try to run the init command again I do get the given error.
Hope this helps to show my problem. Maybe I am missing something or enter the wrong values?!
EDIT: Okay, my problem is that in my config there is always an empty line created between the ones with vaules. This does actually break it. Maybe this does only happen on Windows 10? I am running Python 3.9 64 Bit if this matters.
Okay, my problem is that in my config there is always an empty line created between the ones with vaules.
I see that in your CSV file. To wg-meshconf, it's a peer with all fields left empty.
Maybe this does only happen on Windows 10?
I'm not sure if it's editor-specific. What editor are you using? Excel?
I'm not sure if it's editor-specific. What editor are you using? Excel?
I tried with different editors. First I used Excel but same does happen in LibreOffice Calc, Notepad++ or the normal notepad.exe from Windows. I just tried the same file on the Windows and Ubuntu machine (like the v1 I uploaded earlier) and on Ubuntu everything is fine while on Windows the empty lines are created.
Guess I will just stick with using it on Ubuntu and mount the .csv file on Windows to edit them.
I think I know what's going on: https://stackoverflow.com/questions/3348460/csv-file-written-with-python-has-blank-lines-between-each-row
Yes, this does look like my problem. But I don't have any clue how to implement a fix.
Here's a quick & dirty way:
This is a version in development. You'll need to do pip install --user rich
before you can use it since this dependency is not included in the current release of wg-meshconf. Open a terminal and cd into the decompressed wg-meshconf folder. Instead of running wg-meshconf
directly, do python -m wg_meshconf
instad.
Sorry for late reply but I could not manage to make it work. Do I just need to download that .zip, extract and run the wg_meshconf.py inside it? Tried it and got this:
C:\Users\multi\Desktop\wg-meshconf_neu\wg-meshconf\wg_meshconf>python -m wg_meshconf
Traceback (most recent call last):
File "C:\Users\multi\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\multi\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\multi\Desktop\wg-meshconf_neu\wg-meshconf\wg_meshconf\wg_meshconf.py", line 15, in <module>
from .database_manager import DatabaseManager
ImportError: attempted relative import with no known parent package
You cannot run the python file directly. You'll need to run the wg_meshconf directory as a Python package. At the root directory of the package, do python -m wg_meshconf
.
Ahh I see. Thanks, I was in the wrong folder (the sub folder below the setup.py).
It's working now.
Meaning that the bug is no more?
Yes, it's working as intended now. No more empty lines.
Great. I'll close this issue once I release the patch. Thanks for helping out with the debugging process.
Hello,
I tried to add new hosts after some time and the program fails everytime with error "The value of Address cannot be automatically generated".
Steps to reproduce:
Is there any workaround for this except adding all hosts at the beginning?
Thanks