Chia-Network / drplotter

Apache License 2.0
62 stars 7 forks source link

Version 0.9.2 fails with "drchia init" : No such file or directory: '/usr/lib/drharvester/chia/util/initial-config.yaml' #35

Closed ghmgit closed 4 months ago

ghmgit commented 4 months ago

This fails:


root@587c355b4987:~# drchia version
0.9.2

root@587c355b4987:~# drchia init
Chia directory /root/.chia/mainnet
Traceback (most recent call last):
  File "/usr/lib/drharvester/chia.py", line 141, in <module>
  File "/usr/lib/drharvester/chia.py", line 137, in main
  File "/usr/lib/drharvester/click/core.py", line 1130, in __call__
  File "/usr/lib/drharvester/click/core.py", line 1055, in main
  File "/usr/lib/drharvester/click/core.py", line 1657, in invoke
  File "/usr/lib/drharvester/click/core.py", line 1404, in invoke
  File "/usr/lib/drharvester/click/core.py", line 760, in invoke
  File "/usr/lib/drharvester/click/decorators.py", line 26, in new_func
  File "/usr/lib/drharvester/chia/cmds/init.py", line 56, in init_cmd
  File "/usr/lib/drharvester/chia/cmds/init_funcs.py", line 256, in init
  File "/usr/lib/drharvester/chia/cmds/init_funcs.py", line 363, in chia_init
  File "/usr/lib/drharvester/chia/util/config.py", line 34, in create_default_chia_config
  File "/usr/lib/drharvester/chia/util/config.py", line 29, in initial_config_file
  File "/usr/lib/drharvester/pkg_resources/__init__.py", line 1147, in resource_string
  File "/usr/lib/drharvester/pkg_resources/__init__.py", line 1393, in get_resource_string
  File "/usr/lib/drharvester/pkg_resources/__init__.py", line 1560, in _get
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/drharvester/chia/util/initial-config.yaml'
ghmgit commented 4 months ago

And some more files are missing, after copying the initial-config.yaml from previous version is fails with:


root@587c355b4987:/dr-dr# cp initial-config.yaml /usr/lib/drharvester/chia/util/initial-config.yaml

root@587c355b4987:~# drchia init
Chia directory /root/.chia/mainnet
Traceback (most recent call last):
  File "/usr/lib/drharvester/chia.py", line 141, in <module>
  File "/usr/lib/drharvester/chia.py", line 137, in main
  File "/usr/lib/drharvester/click/core.py", line 1130, in __call__
  File "/usr/lib/drharvester/click/core.py", line 1055, in main
  File "/usr/lib/drharvester/click/core.py", line 1657, in invoke
  File "/usr/lib/drharvester/click/core.py", line 1404, in invoke
  File "/usr/lib/drharvester/click/core.py", line 760, in invoke
  File "/usr/lib/drharvester/click/decorators.py", line 26, in new_func
  File "/usr/lib/drharvester/chia/cmds/init.py", line 56, in init_cmd
  File "/usr/lib/drharvester/chia/cmds/init_funcs.py", line 256, in init
  File "/usr/lib/drharvester/chia/cmds/init_funcs.py", line 382, in chia_init
  File "/usr/lib/drharvester/chia/ssl/create_ssl.py", line 162, in create_all_ssl
  File "/usr/lib/drharvester/chia/ssl/create_ssl.py", line 32, in get_chia_ca_crt_key
  File "/usr/lib/drharvester/pkg_resources/__init__.py", line 1147, in resource_string
  File "/usr/lib/drharvester/pkg_resources/__init__.py", line 1393, in get_resource_string
  File "/usr/lib/drharvester/pkg_resources/__init__.py", line 1560, in _get
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/drharvester/chia/ssl/chia_ca.crt'
ghmgit commented 4 months ago

Adding the 3 missing files from ssl directory, I can run "drchia init":

root@587c355b4987:/dr-dr# cp chia_ca.* dst_root_ca.pem /usr/lib/drharvester/chia/ssl/

root@587c355b4987:~# rm -rf .chia  # clean leftovers 

root@587c355b4987:~# drchia init
Chia directory /root/.chia/mainnet
Can't find private CA, creating a new one in /root/.chia/mainnet to generate TLS certificates
No keys are present in the keychain. Generate them with 'chia keys generate'

To see your keys, run 'chia keys show --show-mnemonic-seed'

But then the next step from the instructions fails:


root@587c355b4987:~# drchia init -c /dr-dr/ca-from-cni-fullnode/
Error, the program tried to call itself with '-c' argument. Disable with '--no-deployment-flag=self-execution'.
drnick23 commented 4 months ago

Thank you, will look into it. Chia just released another update that breaks changes with previous harvesters/farmers.

Did you run chia init before you ran drchia init? The different programs have different config files as there are version conflicts now.

ghmgit commented 4 months ago

1) It works when I use the long option: drchia init --create-certs /ca-from-cni-fullnode

Googling for "program tried to call itself" I assume you use nuitka, and that has pecularities with -c and -m !?

2) I am using remote drharvesters connecting to (unchanged) CNI chia fullnode. These are running in containers and initialize from scratch every start in the entrypoint. That has the advantage I can just put that container on any machine and it runs (aka scale-out). As containers are ephemeral it also has the advantage if anything bad happens inside, on the next restart/reboot the container starts fresh (only the logs are persisted).

drchia init drchia init --create-certs /ca-from-CNI-fullnode drchia configure --set-farmer-peer my-CNI-fullnode-farmer-name:8447 drchia configure --log-level INFO

With 0.9.0 all was working, creating a new container with 0.9.2 inside I hit the problems above (nothing else changed, especially CNI fullnode was not touched).

With these workarounds I now have 0.9.2 running in container again:


                               DrSolver v0.9.2
DrPlotter Farm Status
--------------------------------------------------------------------------------
  Status: CONNECTED                                             Uptime: 00:18:51
  Client Token: x...
  Total Harvesters: 3                                           Total Solvers: 1
  Num DrPlots        Raw Size           Effective Size     Extra Rewards
  3288               102.09 TiB         310.60 TiB         +304%
Solver GPU: NVIDIA GeForce RTX 3090
--------------------------------------------------------------------------------
  Fan    Temp   Perf   Pwr:Usage/Cap                                Memory-Usage
  30%    59C    P2     320W / 350W                           23419MiB / 24576MiB
  Status                                            Load  1 min / 5 min / 15 min
  SOLVING                                                  29%  /  19%  /  20%
drnick23 commented 4 months ago

Yes, using nuitka. I must have missed some configuration directives when compiling, appreciate all the input and the workaround.

Are you on the drplotter discord? If you are, please send me a PM if you're familiar with nuitka and want to lend some support. At the moment I compile twice, once for the "drchia" directive, and once for the "start_harvester" directive, but there should be a better way compile the chia base code.

ghmgit commented 4 months ago

The NEW 0.9.2 release fixes all problems from this issue: 00f8b2dd1827849b3df654be3302772b drplotter_0.9.2_amd64.deb-NEW 15159adea384692d9a4d2e81c9bb49e7 drplotter_0.9.2_amd64.deb-OLD

So this issue can be closed as resolved.