Skip to content
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

I cannot start the service according to the instructions #1

Open
Valentinishe opened this issue Sep 9, 2020 · 3 comments
Open

I cannot start the service according to the instructions #1

Valentinishe opened this issue Sep 9, 2020 · 3 comments

Comments

@Valentinishe
Copy link

Hi, Good Job)
I know that this is not your problem, but I can't start the service according to your guide.
When I execute the commands:
sudo systemctl start warchest_bot and sudo journalctl -u warchest_bot.service -f
I get an error:

Sep 09 11:05:31 dimaro systemd[1]: warchest_bot.service: Service hold-off time over, scheduling restart.
Sep 09 11:05:31 dimaro systemd[1]: warchest_bot.service: Scheduled restart job, restart counter is at 1969.
Sep 09 11:05:31 dimaro systemd[1]: Stopped Warchest bot managing near stake.
Sep 09 11:05:31 dimaro systemd[1]: Started Warchest bot managing near stake.
Sep 09 11:05:31 dimaro python3.6[32474]: INFO:root:Started Warchest bot
Sep 09 11:05:31 dimaro python3.6[32474]: ERROR:root:Pinged contract coolpool.dimaro1.betanet
Sep 09 11:05:31 dimaro python3.6[32474]: --- Logging error ---
Sep 09 11:05:31 dimaro python3.6[32474]: Traceback (most recent call last):
Sep 09 11:05:31 dimaro python3.6[32474]:   File "/home/near/near_warchest/warchest.py", line 39, in ping_contract
Sep 09 11:05:31 dimaro python3.6[32474]:     stderr=subprocess.STDOUT,
Sep 09 11:05:31 dimaro python3.6[32474]:   File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
Sep 09 11:05:31 dimaro python3.6[32474]:     **kwargs).stdout
Sep 09 11:05:31 dimaro python3.6[32474]:   File "/usr/lib/python3.6/subprocess.py", line 438, in run
Sep 09 11:05:31 dimaro python3.6[32474]:     output=stdout, stderr=stderr)
Sep 09 11:05:31 dimaro python3.6[32474]: subprocess.CalledProcessError: Command '['near call coolpool.dimaro1.betanet ping --accountId dimaro1.betanet']' returned non-zero exit status 1.
Sep 09 11:05:31 dimaro python3.6[32474]: During handling of the above exception, another exception occurred:
Sep 09 11:05:31 dimaro python3.6[32474]: Traceback (most recent call last):
Sep 09 11:05:31 dimaro python3.6[32474]:   File "/usr/lib/python3.6/logging/__init__.py", line 994, in emit
Sep 09 11:05:31 dimaro python3.6[32474]:     msg = self.format(record)
Sep 09 11:05:31 dimaro python3.6[32474]:   File "/usr/lib/python3.6/logging/__init__.py", line 840, in format
Sep 09 11:05:31 dimaro python3.6[32474]:     return fmt.format(record)
Sep 09 11:05:31 dimaro python3.6[32474]:   File "/usr/lib/python3.6/logging/__init__.py", line 577, in format
Sep 09 11:05:31 dimaro python3.6[32474]:     record.message = record.getMessage()
Sep 09 11:05:31 dimaro python3.6[32474]:   File "/usr/lib/python3.6/logging/__init__.py", line 338, in getMessage
Sep 09 11:05:31 dimaro python3.6[32474]:     msg = msg % self.args
Sep 09 11:05:31 dimaro python3.6[32474]: TypeError: not all arguments converted during string formatting
Sep 09 11:05:31 dimaro python3.6[32474]: Call stack:
Sep 09 11:05:31 dimaro python3.6[32474]:   File "/home/near/near_warchest/warchest.py", line 171, in <module>
Sep 09 11:05:31 dimaro python3.6[32474]:     run()
Sep 09 11:05:31 dimaro python3.6[32474]:   File "/home/near/near_warchest/warchest.py", line 26, in run
Sep 09 11:05:31 dimaro python3.6[32474]:     ping_contract()
Sep 09 11:05:31 dimaro python3.6[32474]:   File "/home/near/near_warchest/warchest.py", line 45, in ping_contract
Sep 09 11:05:31 dimaro python3.6[32474]:     logging.error("Status : FAIL", e.returncode, e.output)
Sep 09 11:05:31 dimaro python3.6[32474]: Message: 'Status : FAIL'
Sep 09 11:05:31 dimaro python3.6[32474]: Arguments: (1, b"/usr/local/lib/node_modules/near-shell/commands/dev-deploy.js:4\nconst { readFile, writeFile, mkdir } = require('fs').promises;\n        ^\n\nTypeError: Cannot destructure property `readFile` of 'undefined' or 'null'.\n    at Object.<anonymous> (/usr/local/lib/node_modules/near-shell/commands/dev-deploy.js:4:53)\n    at Module._compile (module.js:652:30)\n    at Object.Module._extensions..js (module.js:663:10)\n    at Module.load (module.js:565:32)\n    at tryModuleLoad (module.js:505:12)\n    at Function.Module._load (module.js:497:3)\n    at Module.require (module.js:596:17)\n    at require (internal/module.js:11:18)\n    at Object.<anonymous> (/usr/local/lib/node_modules/near-shell/bin/near-cli.js:217:14)\n    at Module._compile (module.js:652:30)\n")

I Think trouble in this line

[f"near call {stake_pool_id} ping --accountId {accound_id}"],

Because if I change this line to this,
[f "near --version"],

then the error will be repeated, but will clearly indicate that she does not see not "near"

Sep 09 11:09:38 dimaro systemd[1]: warchest_bot.service: Scheduled restart job, restart counter is at 2058.
Sep 09 11:09:38 dimaro systemd[1]: Stopped Warchest bot managing near stake.
Sep 09 11:09:38 dimaro systemd[1]: Started Warchest bot managing near stake.
Sep 09 11:09:38 dimaro python3.6[5357]: INFO:root:Started Warchest bot
Sep 09 11:09:39 dimaro python3.6[5357]: ERROR:root:Pinged contract coolpool.dimaro1.betanet
Sep 09 11:09:39 dimaro python3.6[5357]: --- Logging error ---
Sep 09 11:09:39 dimaro python3.6[5357]: Traceback (most recent call last):
Sep 09 11:09:39 dimaro python3.6[5357]:   File "/home/near/near_warchest/warchest.py", line 40, in ping_contract
Sep 09 11:09:39 dimaro python3.6[5357]:     stderr=subprocess.STDOUT,
Sep 09 11:09:39 dimaro python3.6[5357]:   File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
Sep 09 11:09:39 dimaro python3.6[5357]:     **kwargs).stdout
Sep 09 11:09:39 dimaro python3.6[5357]:   File "/usr/lib/python3.6/subprocess.py", line 438, in run
Sep 09 11:09:39 dimaro python3.6[5357]:     output=stdout, stderr=stderr)
Sep 09 11:09:39 dimaro python3.6[5357]: subprocess.CalledProcessError: Command '['near --version']' returned non-zero exit status 1.
Sep 09 11:09:39 dimaro python3.6[5357]: During handling of the above exception, another exception occurred:
Sep 09 11:09:39 dimaro python3.6[5357]: Traceback (most recent call last):
Sep 09 11:09:39 dimaro python3.6[5357]:   File "/usr/lib/python3.6/logging/__init__.py", line 994, in emit
Sep 09 11:09:39 dimaro python3.6[5357]:     msg = self.format(record)
Sep 09 11:09:39 dimaro python3.6[5357]:   File "/usr/lib/python3.6/logging/__init__.py", line 840, in format
Sep 09 11:09:39 dimaro python3.6[5357]:     return fmt.format(record)
Sep 09 11:09:39 dimaro python3.6[5357]:   File "/usr/lib/python3.6/logging/__init__.py", line 577, in format
Sep 09 11:09:39 dimaro python3.6[5357]:     record.message = record.getMessage()
Sep 09 11:09:39 dimaro python3.6[5357]:   File "/usr/lib/python3.6/logging/__init__.py", line 338, in getMessage
Sep 09 11:09:39 dimaro python3.6[5357]:     msg = msg % self.args
Sep 09 11:09:39 dimaro python3.6[5357]: TypeError: not all arguments converted during string formatting
Sep 09 11:09:39 dimaro python3.6[5357]: Call stack:
Sep 09 11:09:39 dimaro python3.6[5357]:   File "/home/near/near_warchest/warchest.py", line 172, in <module>
Sep 09 11:09:39 dimaro python3.6[5357]:     run()
Sep 09 11:09:39 dimaro python3.6[5357]:   File "/home/near/near_warchest/warchest.py", line 26, in run
Sep 09 11:09:39 dimaro python3.6[5357]:     ping_contract()
Sep 09 11:09:39 dimaro python3.6[5357]:   File "/home/near/near_warchest/warchest.py", line 46, in ping_contract
Sep 09 11:09:39 dimaro python3.6[5357]:     logging.error("Status : FAIL", e.returncode, e.output)
Sep 09 11:09:39 dimaro python3.6[5357]: Message: 'Status : FAIL'
Sep 09 11:09:39 dimaro python3.6[5357]: Arguments: (1, b"/usr/local/lib/node_modules/near-shell/commands/dev-deploy.js:4\nconst { readFile, writeFile, mkdir } = require('fs').promises;\n        ^\n\nTypeError: Cannot destructure property `readFile` of 'undefined' or 'null'.\n    at Object.<anonymous> (/usr/local/lib/node_modules/near-shell/commands/dev-deploy.js:4:53)\n    at Module._compile (module.js:652:30)\n    at Object.Module._extensions..js (module.js:663:10)\n    at Module.load (module.js:565:32)\n    at tryModuleLoad (module.js:505:12)\n    at Function.Module._load (module.js:497:3)\n    at Module.require (module.js:596:17)\n    at require (internal/module.js:11:18)\n    at Object.<anonymous> (/usr/local/lib/node_modules/near-shell/bin/near-cli.js:217:14)\n    at Module._compile (module.js:652:30)\n")

Also the error is repeated with this line
[f "npm --help"],,
but not with this
[f "node --help"],

it's just some magic

maybe you are facing this problem?
or maybe you know how to solve this problem?
or maybe that's not the problem at all?

I hope for your help)

my env:
ubuntu 18.04
nodejs 8.5 / 10.17 / 12.0
I try use global near-shell and near-cli

@eorituz
Copy link
Owner

eorituz commented Sep 9, 2020

Hey @Valentinishe,
I do not have this issue. The problem here seems to be that the python code is not able to "find" the program called "near".
Did your near-shell install properly? (Node 10+ is required and you have 3 different node versions installed?)
You can test this by running whereis near and echo $PATH. The outcome of whereis should be in a folder listed in echo $PATH.
You could also try to uninstall your near-cli as only near-shell is required.

@Valentinishe
Copy link
Author

Valentinishe commented Sep 9, 2020

Hey @Valentinishe,

Thanks for taking the time to answer)

The problem here seems to be that the python code is not able to "find" the program called "near".

I think so too.

Did your near-shell install properly?

Yes

(Node 10+ is required and you have node 3 different node versions installed?)

I mean I tried with 3 different versions

You can test this by running whereis near and echo $PATH.

I didn't think, thanks)
/home/near/.nvm/versions/node/v12.0.0/bin/near
/usr/bin/near

But it did not help(
[f"/home/near/.nvm/versions/node/v12.0.0/bin/near call {stake_pool_id} ping --accountId {accound_id}"],
[f"/usr/bin/near call {stake_pool_id} ping --accountId {accound_id}"],

You could also try to uninstall your near-cli as only near-shell is required.

I tried with everyone, but now I installed near-shell

@eorituz
Copy link
Owner

eorituz commented Sep 10, 2020

My last idea would be trying to set shell=False in Line 36 (https://github.com/eorituz/near_warchest/blob/master/warchest.py#L36).

Otherwise, I'd recommend doing the whole near setup from scratch again and see if that works. Those kind of issues are usually quite difficult to debug...

I think the easiest approach in your situation might actually be to try one of the other warchest bots (e.g. the one in docker or the other python bot)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants