Chia-Network / chia-blockchain

Chia blockchain python implementation (full node, farmer, harvester, timelord, and wallet)
Apache License 2.0
10.83k stars 2.03k forks source link

[Bug] Node cannot start #18304

Closed YuXiaoCoder closed 1 month ago

YuXiaoCoder commented 1 month ago

What happened?

Executing the command [chia start node] runs the node service, but why does it start the wallet service?

chia show -s
Network: mainnet    Port: 8444   RPC Port: 28555
Node ID: 822d216a649f78bf83ebcae953fcd0008dd4ac6353d8e7034f91aca1baf91a8a
Genesis Challenge: ccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb
Current Blockchain Status: Full Node Synced

Peak: Hash: ec4f863b8d5dd267f8a2990607164fe0ccfe03b0762c86b357a16913258e85f4
      Time: Mon Jul 15 2024 16:13:01 CST                  Height:    5645781

Estimated network space: 24.085 EiB
Current difficulty: 16768
Current VDF sub_slot_iters: 578813952

  Height: |   Hash:
  5645781 | ec4f863b8d5dd267f8a2990607164fe0ccfe03b0762c86b357a16913258e85f4
  5645780 | a7d26f7455ab039f11189f530fa9003172b0ec0d11b9883fdf58ba015dbb32d4
  5645779 | d7c1cf5cfbe1d034d344b2091997a9a8d18c996652cd1d45dd15cd32f90b35f5
  5645778 | 1d2f171573ed7a38e9c32a9a861b4aa7519358161c85a8606dc190cbb9495e8a
  5645777 | c5f567eb169b845a655af9060bf1381cb85daa42a91089aed90d594ebe55599f
  5645776 | 02cbaad30246bd76ddfe47325ffa778ac6acea34674e3fbee2f384df23f9506f
  5645775 | 25171aa58517fccf8f1503ba6d3cc52d47d3c604b959c1572d4657272f828cb1
  5645774 | dfb64b30d9e48e9063572de048900bc7561cdc472cc691edc4ecd143d1e0063f
  5645773 | 96413c94d461887709859b6a01a74a26584fdddf97746b058a98bb8bd8cc303b
  5645772 | 2de430773ffeb6bc4650c7b21168d36045b48903d36851e1dc10fd1ce5d2cd09

Version

2.4.3.dev1

What platform are you using?

Linux

What ui mode are you using?

CLI

Relevant log output

Daemon not started yet
Starting daemon
chia_full_node: started
Traceback (most recent call last):
  File "/usr/local/bin/chia_wallet", line 8, in <module>
    sys.exit(main())
  File "/opt/xchmain/core/chia-blockchain/chia/server/start_wallet.py", line 105, in main
    return async_run(async_main())
  File "/opt/xchmain/core/chia-blockchain/chia/server/start_service.py", line 323, in async_run
    return asyncio.run(coro)
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/opt/xchmain/core/chia-blockchain/chia/server/start_wallet.py", line 96, in async_main
    await service.run()
  File "/opt/xchmain/core/chia-blockchain/chia/server/start_service.py", line 197, in run
    async with self.manage():
  File "/usr/lib/python3.10/contextlib.py", line 199, in __aenter__
    return await anext(self.gen)
  File "/opt/xchmain/core/chia-blockchain/chia/server/start_service.py", line 214, in manage
    await async_exit_stack.enter_async_context(self._node.manage())
  File "/usr/lib/python3.10/contextlib.py", line 619, in enter_async_context
    result = await _cm_type.__aenter__(cm)
  File "/usr/lib/python3.10/contextlib.py", line 199, in __aenter__
    return await anext(self.gen)
  File "/opt/xchmain/core/chia-blockchain/chia/wallet/wallet_node.py", line 165, in manage
    await self._start()
  File "/opt/xchmain/core/chia-blockchain/chia/wallet/wallet_node.py", line 401, in _start
    await self._start_with_fingerprint()
  File "/opt/xchmain/core/chia-blockchain/chia/wallet/wallet_node.py", line 473, in _start_with_fingerprint
    await self._update_balance_cache(wallet_id)
  File "/opt/xchmain/core/chia-blockchain/chia/wallet/wallet_node.py", line 1737, in _update_balance_cache
    pending_change = await wallet.get_pending_change_balance()
  File "/opt/xchmain/core/chia-blockchain/chia/wallet/wallet.py", line 157, in get_pending_change_balance
    return uint64(addition_amount)
  File "/usr/local/lib/python3.10/dist-packages/chia_rs/struct_stream.py", line 83, in __init__
    raise ValueError(f"Value {self} does not fit into {type(self).__name__}")
ValueError: Value 53923910098499241464 does not fit into uint64
YuXiaoCoder commented 1 month ago

https://github.com/Chia-Network/chia-blockchain/blob/main/chia/util/service_groups.py

katmai commented 1 month ago

check if any chia processes are still running before starting. i noticed that when running chia stop -d all, not all processes stop:

katmai      3593  0.0  0.8 1396412 564876 ?      S    Jul04   7:00 chia_full_node_block_validation_worker
katmai      3594  0.0  0.8 1396412 564884 ?      S    Jul04   6:59 chia_full_node_block_validation_worker
katmai      3595  0.0  0.8 1396412 564548 ?      S    Jul04   6:42 chia_full_node_block_validation_worker
katmai      3596  0.0  0.8 1396412 564940 ?      S    Jul04   6:54 chia_full_node_block_validation_worker
katmai      3597  0.0  0.8 1396412 564672 ?      S    Jul04   6:56 chia_full_node_block_validation_worker
katmai      3598  0.0  0.8 1396412 564500 ?      S    Jul04   6:51 chia_full_node_block_validation_worker
katmai      3599  0.0  0.8 1396412 564740 ?      S    Jul04   6:46 chia_full_node_block_validation_worker
katmai      3600  0.0  0.8 1396412 564692 ?      S    Jul04   6:50 chia_full_node_block_validation_worker
katmai      3601  0.0  0.8 1396412 565072 ?      S    Jul04   6:55 chia_full_node_block_validation_worker
katmai      3602  0.0  0.8 1396412 564628 ?      S    Jul04   6:59 chia_full_node_block_validation_worker
katmai      3603  0.0  0.8 1396412 564692 ?      S    Jul04   6:49 chia_full_node_block_validation_worker
katmai      3604  0.0  0.8 1396412 564692 ?      S    Jul04   6:50 chia_full_node_block_validation_worker
katmai      3605  0.0  0.8 1396412 564692 ?      S    Jul04   6:50 chia_full_node_block_validation_worker
katmai      3606  0.0  0.8 1396412 564884 ?      S    Jul04   6:58 chia_full_node_block_validation_worker
katmai      3607  0.0  0.8 1396412 564880 ?      S    Jul04   6:53 chia_full_node_block_validation_worker
katmai      3608  0.0  0.8 1396412 564876 ?      S    Jul04   6:47 chia_full_node_block_validation_worker
katmai      3609  0.0  0.8 1396412 564800 ?      S    Jul04   6:52 chia_full_node_block_validation_worker
katmai      3610  0.0  0.8 1396412 564944 ?      S    Jul04   7:00 chia_full_node_block_validation_worker
katmai      3611  0.0  0.8 1396412 564752 ?      S    Jul04   6:56 chia_full_node_block_validation_worker
katmai      3612  0.0  0.8 1396412 564880 ?      S    Jul04   6:51 chia_full_node_block_validation_worker
katmai      3613  0.0  0.8 1396412 564916 ?      S    Jul04   6:49 chia_full_node_block_validation_worker
katmai      3614  0.0  0.8 1396412 564780 ?      S    Jul04   6:52 chia_full_node_block_validation_worker
katmai      3615  0.0  0.8 1396412 564876 ?      S    Jul04   6:48 chia_full_node_block_validation_worker
katmai      3616  0.0  0.8 1396412 564832 ?      S    Jul04   6:49 chia_full_node_block_validation_worker
katmai      3629  0.0  0.8 1412440 575148 ?      S    Jul04   5:59 chia_full_node_mempool_worker
katmai      3630  0.0  0.8 1412440 575148 ?      S    Jul04   6:02 chia_full_node_mempool_worker

im rebooting and will start after. see if that fixes things.

i've rebooted and the node is back online. so it must be something with the chia stop command not stopping all running processes before upgrade.

wjblanke commented 1 month ago

So it seems like zombie processes are the underlying issue here. That's why rebooting cleared things. Having said that I can't explain why wallet code would be running if you did chia start node. That should only run the node and not the wallet. Are you still having issues with that?

hajes commented 1 month ago

I am having the same issues. Up to version 2.4.1 no problems, runtime since inception of Chia. Fresh install of Debian Bookworm, including official Chia Debian package...crashed all the time. Reinstalled from Git source because it worked before...it is crashing all the time. I can't get farmer running without every 2-10 hours crash.

There is something screwed up from version 2.4.2

Systemd always killed dead process, and restarted. Doesn't work anymore.

chia stop all -d doesn't kill everything as used to do. There are still running processes as above by.

I have written own bash watchdog to kill all chia stuff pkill -9 chia, then chia start ... -r works again.

~/chia-blockchain/venv/bin/chia ... sometimes works, sometimes not.

BrandtH22 commented 1 month ago

I am having the same issues. Up to version 2.4.1 no problems, runtime since inception of Chia. Fresh install of Debian Bookworm, including official Chia Debian package...crashed all the time. Reinstalled from Git source because it worked before...it is crashing all the time. I can't get farmer running without every 2-10 hours crash.

There is something screwed up from version 2.4.2

Systemd always killed dead process, and restarted. Doesn't work anymore.

chia stop all -d doesn't kill everything as used to do. There are still running processes as above by.

I have written own bash watchdog to kill all chia stuff pkill -9 chia, then chia start ... -r works again.

~/chia-blockchain/venv/bin/chia ... sometimes works, sometimes not.

Hey @hajes , I believe your issues are unrelated to this users. Please refer to the comment I left on your issue ticket for more information: https://github.com/Chia-Network/chia-blockchain/issues/18343#issuecomment-2243616013

wjblanke commented 1 month ago

Closing as a zombie issue, please reopen if you continue to have issues.