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

[BUG] NameError: name 'pwnagotchi' is not defined #1096

Closed
scifijunk opened this issue May 26, 2022 · 0 comments · May be fixed by #1121
Closed

[BUG] NameError: name 'pwnagotchi' is not defined #1096

scifijunk opened this issue May 26, 2022 · 0 comments · May be fixed by #1121
Labels
bug Something isn't working

Comments

@scifijunk
Copy link

scifijunk commented May 26, 2022

Describe the bug
Well, I was doing a test build to see if any python packages needed to be updated. I Found that Flask==2.0.1 and Werkzeug==2.0.0 needed to installed. After that, though I got a rather odd error that I'm not sure how to fix. The error is as follows:

[2022-05-26 00:27:50,932] [INFO] setting unit hostname 'pwnagotchi' -> 'scifijunkie'
Traceback (most recent call last):
  File "/usr/local/bin/pwnagotchi", line 150, in <module>
    pwnagotchi.set_name(config['main']['name'])
  File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/__init__.py", line 44, in set_name
    pwnagotchi.reboot()
NameError: name 'pwnagotchi' is not defined

To Reproduce
Steps to reproduce the behavior:

  1. burned img
  2. Noted it was taking longer than normal to boot so I SSHed into it
  3. ran sudo systemctl status pwnagotchi.service and got the following back: ```
● pwnagotchi.service - pwnagotchi Deep Reinforcement Learning instrumenting bettercap for WiFI pwning.
   Loaded: loaded (/etc/systemd/system/pwnagotchi.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Wed 2022-05-25 23:56:51 BST; 26s ago
     Docs: https://pwnagotchi.ai
  Process: 744 ExecStart=/usr/bin/pwnagotchi-launcher (code=exited, status=1/FAILURE)
 Main PID: 744 (code=exited, status=1/FAILURE)
  1. I ran sudo systemctl stop pwnagotchi.service to stop the service
  2. ran sudo pwnagotchi and got the following error:
Traceback (most recent call last):
  File "/usr/local/bin/pwnagotchi", line 139, in <module>
    from pwnagotchi.agent import Agent
  File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/agent.py", line 12, in <module>
    from pwnagotchi.ui.web.server import Server
  File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/web/server.py", line 10, in <module>
    from flask import Flask
  File "/usr/local/lib/python3.7/dist-packages/flask/__init__.py", line 21, in <module>
    from .app import Flask, Request, Response
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 25, in <module>
    from . import cli, json
  File "/usr/local/lib/python3.7/dist-packages/flask/json/__init__.py", line 21, in <module>
    from itsdangerous import json as _json
ImportError: cannot import name 'json' from 'itsdangerous' (/usr/local/lib/python3.7/dist-packages/itsdangerous/__init__.py)
  1. installed Flask=2.0.1
  2. ran sudo pwnagotchi and got the following error:
Traceback (most recent call last):
  File "/usr/local/bin/pwnagotchi", line 139, in <module>
    from pwnagotchi.agent import Agent
  File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/agent.py", line 12, in <module>
    from pwnagotchi.ui.web.server import Server
  File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/web/server.py", line 12, in <module>
    from flask_wtf.csrf import CSRFProtect
  File "/usr/local/lib/python3.7/dist-packages/flask_wtf/__init__.py", line 3, in <module>
    from .csrf import CSRFProtect, CsrfProtect
  File "/usr/local/lib/python3.7/dist-packages/flask_wtf/csrf.py", line 10, in <module>
    from werkzeug.security import safe_str_cmp
ImportError: cannot import name 'safe_str_cmp' from 'werkzeug.security' (/usr/local/lib/python3.7/dist-packages/werkzeug/security.py)
  1. installed Werkzeug==2.0.0
  2. ran sudo pwnagotchi I got the following error:
Traceback (most recent call last):
  File "/usr/local/bin/pwnagotchi", line 139, in <module>
    from pwnagotchi.agent import Agent
  File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/agent.py", line 12, in <module>
    from pwnagotchi.ui.web.server import Server
  File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/web/server.py", line 12, in <module>
    from flask_wtf.csrf import CSRFProtect
  File "/usr/local/lib/python3.7/dist-packages/flask_wtf/__init__.py", line 4, in <module>
    from .form import FlaskForm, Form
  File "/usr/local/lib/python3.7/dist-packages/flask_wtf/form.py", line 4, in <module>
    from jinja2 import Markup
ImportError: cannot import name 'Markup' from 'jinja2' (/usr/local/lib/python3.7/dist-packages/jinja2/__init__.py)
  1. installed jinja2==3.0.3
  2. ran sudo pwnagotchi I got the following error:
[2022-05-26 00:27:50,932] [INFO] setting unit hostname 'pwnagotchi' -> 'scifijunkie'
Traceback (most recent call last):
  File "/usr/local/bin/pwnagotchi", line 150, in <module>
    pwnagotchi.set_name(config['main']['name'])
  File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/__init__.py", line 44, in set_name
    pwnagotchi.reboot()
NameError: name 'pwnagotchi' is not defined
  1. ran sudo pwnagotchi for the final time and it ran like normal

Expected behavior
for it to work.

Screenshots
N/A.

Environment (please complete the following information):

  • Pwnagotchi version: built v1.5.5
  • OS version: 2020-02-13-raspbian-buster-lite
  • Type of hardware: Raspberry Pi4 2G

Additional context
N/A.

@scifijunk scifijunk added the bug Something isn't working label May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant