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

[x] ERROR: 'URLError' object has no attribute 'message' #365

Open
sahrahul2323 opened this issue Aug 26, 2022 · 5 comments
Open

[x] ERROR: 'URLError' object has no attribute 'message' #365

sahrahul2323 opened this issue Aug 26, 2022 · 5 comments

Comments

@sahrahul2323
Copy link

sir this error is showing while running the trape

@god2106
Copy link

god2106 commented Sep 15, 2022

for me also

@Dataclysm0
Copy link

Step by step I will show you exactly what occurs:

  1. The introduction for trape begins to run, then at the end you get slapped with this:

Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/truxit/trape/trape/core/ngrok.py", line 81, in start_ngrok
result = subprocess.check_output([str_ngrok, "http", port])
File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.10/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['./ngrok', 'http', '8080']' returned non-zero exit status 1.
[x] ERROR: 'URLError' object has no attribute 'message'

After this occurs, I look to see what had happened on the ngrok end of things, and in the terminal that has ngrok running within it you will see this at the end after trying to run trape:

HTTP Requests ------------- GET /favicon.ico 502 Bad Gateway
GET / 502 Bad Gateway

THEN, to further understand the issue, I do a ctrl+left click on the "Forwarding" section of Ngrok, and it takes me to a page displaying further info on the issue and it reads

"ERR_NGROK_8012
Traffic was successfully tunneled to the ngrok agent, but the agent failed to establish a connection to the upstream web service at 127.0.0.1:8080. The error encountered was:

dial tcp 127.0.0.1:8080: connectex: No connection could be made because the target machine actively refused it."

I hope this may help out with a solution. Im stumped on this one, but im looking into it more.

@jordanmalecki
Copy link

jordanmalecki commented Jan 29, 2023

I was getting this error as well and I figured it out.
First things first make sure you opened your tunnel and the ngrok service is running.

(1) The ngrok executable file is in the project directory as opposed to path. So calling the ngrok command wouldn't work; it would have to be initiated via ./ngrok http 80 rather than ngrok http 80 ...I am not sure this was causing any issues, but to be safe I added a copy to my local bin (You could also add it to your path via .bashrc too if you wanted, but w/e):

~$ cp ~/trape/ngrok ~/.local/bin

(2) Make sure it is executable.

~$ chmod +x /path/to/ngrok

(3) Get your auth token from here and set it via the ngrok command (as well as in the project config file):

~$ ngrok config <YOUR-AUTHTOKEN>

(4) Make sure the ngrok service and the application are using the same port. Pretty sure 8080 is the default, you can change it to whatever you want, just make sure your firewall will allow it), so first you'd spin up ngrok:

~$ ngrok http 8080

then in your python env call trape.py:

(venv) $ python trape.py -u https://www.google.com -p 8080

If that doesn't work double check your authtoken, check your firewall, and maybe install the latest version of ngrok and replace the file in the project with the latest.

@rbrtjns90
Copy link

I fixed a bunch of these bugs.

https://github.com/rbrtjns90/trape

@Muqtgamer
Copy link

#Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/muqthadir/Desktop/trape/core/ngrok.py", line 81, in start_ngrok
result = subprocess.check_output([str_ngrok, "http", port])
File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['./ngrok', 'http', '80']' returned non-zero exit status 1.
[x] ERROR: 'URLError' object has no attribute 'message' @Dataclysm0 could you please help me to solve iam still learning i did not understand it correctly so,plz tell me how to fix clearly plz plz.

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

6 participants