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

Cannot connect via subdomain #140

Closed
4 tasks done
jramosss opened this issue Dec 6, 2024 · 4 comments
Closed
4 tasks done

Cannot connect via subdomain #140

jramosss opened this issue Dec 6, 2024 · 4 comments
Labels
invalid-forum Adding this label will automatically comment, redirecting the user to support forums

Comments

@jramosss
Copy link

jramosss commented Dec 6, 2024

Acknowledgements

  • I have written a descriptive issue title
  • I have searched pyngrok's documentation for an answer
  • I have searched Issues to see if the bug has already been reported
  • I have searched Stack Overflow to ensure the issue I'm experiencing has not already been discussed

Operating System

macOs 14.6.1

Python Version

3.11.10

pyngrok Version

7.2.1

Describe the Bug

When I add the parameter "subdomain", it is marked as non existent, even though it is marked as existent in the docs

conf.get_default().region = 'sa'
conf.get_default().auth_token = authtoken
url = ngrok.connect(25565, 'tcp', name="chulsever", subdomain="sbcm")

Here is the exception trace

File ~/Documents/mc-server/.venv/lib/python3.11/site-packages/pyngrok/ngrok.py:522, in api_request(url, method, data, params, timeout, auth)
    [521](https://file+.vscode-resource.vscode-cdn.net/Users/chuls/Documents/mc-server/~/Documents/mc-server/.venv/lib/python3.11/site-packages/pyngrok/ngrok.py:521) try:
--> [522](https://file+.vscode-resource.vscode-cdn.net/Users/chuls/Documents/mc-server/~/Documents/mc-server/.venv/lib/python3.11/site-packages/pyngrok/ngrok.py:522)     response = urlopen(request, encoded_data, timeout)
    [523](https://file+.vscode-resource.vscode-cdn.net/Users/chuls/Documents/mc-server/~/Documents/mc-server/.venv/lib/python3.11/site-packages/pyngrok/ngrok.py:523)     response_data = response.read().decode("utf-8")

File /opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:216, in urlopen(url, data, timeout, cafile, capath, cadefault, context)
    [215](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:215)     opener = _opener
--> [216](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:216) return opener.open(url, data, timeout)

File /opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:525, in OpenerDirector.open(self, fullurl, data, timeout)
    [524](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:524)     meth = getattr(processor, meth_name)
--> [525](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:525)     response = meth(req, response)
    [527](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:527) return response

File /opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:634, in HTTPErrorProcessor.http_response(self, request, response)
    [633](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:633) if not (200 <= code < 300):
--> [634](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:634)     response = self.parent.error(
    [635](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:635)         'http', request, response, code, msg, hdrs)
    [637](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:637) return response

File /opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:563, in OpenerDirector.error(self, proto, *args)
    [562](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:562) args = (dict, 'default', 'http_error_default') + orig_args
--> [563](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:563) return self._call_chain(*args)
...
    [546](https://file+.vscode-resource.vscode-cdn.net/Users/chuls/Documents/mc-server/~/Documents/mc-server/.venv/lib/python3.11/site-packages/pyngrok/ngrok.py:546) except URLError as e:
    [547](https://file+.vscode-resource.vscode-cdn.net/Users/chuls/Documents/mc-server/~/Documents/mc-server/.venv/lib/python3.11/site-packages/pyngrok/ngrok.py:547)     raise PyngrokNgrokURLError(f"ngrok client exception, URLError: {e.reason}", e.reason)

PyngrokNgrokHTTPError: ngrok client exception, API returned 400: {"error_code":102,"status_code":400,"msg":"invalid tunnel configuration","details":{"err":"yaml: unmarshal errors:\n  line 1: field options not found in type config.TCPv2Tunnel"}}

Steps to Reproduce

Create a Ngrok tunnel and use the parameter subdomain in the connect method

Expected Behavior

No response

@jramosss jramosss added the bug Something isn't working label Dec 6, 2024
@alexdlaird alexdlaird added invalid-forum Adding this label will automatically comment, redirecting the user to support forums and removed bug Something isn't working labels Dec 6, 2024
Copy link

github-actions bot commented Dec 6, 2024

This is a bug tracker and not a support forum.

While we'd love to be able to support every person on their projects, that would simply be infeasible. Luckily, that's what the helpful developer community over at Stack Overflow is for! Please create a question there with the "pyngrok" tag if what you're looking for is a programming question or you need help with an integration. You can refer to pyngrok's own documentation to help you write the best possible question.

If you support the project, contact me directly and I'd be happy to help you troubleshoot.

@github-actions github-actions bot closed this as completed Dec 6, 2024
@jramosss
Copy link
Author

jramosss commented Dec 6, 2024

this is not a forum question, it is a parameter that is present in the docs and not working

@alexdlaird
Copy link
Owner

I'll grant you their error message could be clearer. What you'll find is, subdomain is not a valid parameter for a TCP tunnel, only HTTP. You don't get to pick the domain from ngrok in TCP scenarios.

@jramosss
Copy link
Author

jramosss commented Dec 6, 2024

oh, looks like I mistaken it with the http parameter. Sounds good thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid-forum Adding this label will automatically comment, redirecting the user to support forums
Projects
None yet
Development

No branches or pull requests

2 participants