Probot: Could not open tunnel: Invalid subdomain.

Created on 15 Jul 2017  路  6Comments  路  Source: probot/probot

Following the instructions at https://github.com/probot/probot/blob/f0b3f4993faa706d7eed67de2aa621e594021538/docs/development.md for setting up a local probot server.

$ npm start

> electron-probot@ start /Users/z/git/electron-probot
> probot run ./index.js

Yay, the plugin was loaded!
05:28:15.679Z DEBUG PRobot: Loaded plugin: ./index.js
Could not open tunnel:  Invalid subdomain. Subdomains must be lowercase and between 4 and 63 alphanumeric characters.

Without looking at probot's code, my guess was that the subdomain creation was based on the name value in package.json, but changing it to an alphanumeric string and running npm start did not change the outcome.

$ cat package.json 
{
  "name": "electron-probot",
  "private": true,
  "description": "A helpful robot for the electron org",
  "author": "zeke",
  "license": "MIT",
  "repository": "https://github.com/electron/electron-probot",
  "scripts": {
    "start": "probot run ./index.js",
    "test": "mocha && xo --extend probot"
  },
  "dependencies": {
    "probot": "^0.7.2"
  },
  "devDependencies": {
    "eslint-config-probot": ">=0.1.0",
    "expect": "^1.20.2",
    "localtunnel": "^1.8.2",
    "mocha": "^3.2.0",
    "xo": "^0.18.0"
  },
  "engines": {
    "node": ">= 7.7.0",
    "npm": ">= 4.0.0"
  }
}

Most helpful comment

Just found these lines in probot's .env.example:

# Subdomain to use for localtunnel server. Defaults to your local username.
# SUBDOMAIN=

My local username is z, which is too short.

But this did the trick:

$ SUBDOMAIN=zeketown npm start

> electron-probot@ start /Users/z/git/electron-probot
> probot run ./index.js

Yay, the plugin was loaded!
05:41:20.176Z DEBUG PRobot: Loaded plugin: ./index.js
Listening on https://zeketown.localtunnel.me

I started off using the plugin-template repo, which currently does not include the SUBDOMAIN entry.

All 6 comments

Just found these lines in probot's .env.example:

# Subdomain to use for localtunnel server. Defaults to your local username.
# SUBDOMAIN=

My local username is z, which is too short.

But this did the trick:

$ SUBDOMAIN=zeketown npm start

> electron-probot@ start /Users/z/git/electron-probot
> probot run ./index.js

Yay, the plugin was loaded!
05:41:20.176Z DEBUG PRobot: Loaded plugin: ./index.js
Listening on https://zeketown.localtunnel.me

I started off using the plugin-template repo, which currently does not include the SUBDOMAIN entry.

@bkeepers you should update the docs on https://probot.github.io/docs/development/ to explain that we need to enter a subdomain in the .env file before running npm start

Also the comment in the env files says: "Subdomain to use for localtunnel server. Defaults to your local username." but it didn't use my local username, it just failed. Maybe it couldn't find it since I'm on windows?

Probot
GitHub Apps to automate and improve your workflow

Ah no it's just that my username is "Olivier" and localtunnel only works with lower case, maybe you could use toLowerCase() before using it?

Just a note that this happened to me too. Maybe printing the used subdomain (like the username used) would help figuring the problem.

@luebken printing the subdomain is a great idea. That's a fairly simple change (compared to the rest of what we've talked about here and in #280), but with a great benefit. We'd love it if you made that PR @luebken, if you have the time!

@JasonEtco Sure. The original message comes from libtunnel. So if we want to fix it here we need to touch [lib/tunnel.js]. Here is a first shot: https://github.com/luebken/probot/pull/1/files

Is there a guide on how to setup local development? A git clone && npm install && npm start throws me an error:

> node ./bin/probot run

fs.js:948
  binding.lstat(pathModule._makeLong(path));
          ^

Error: ENOENT: no such file or directory, lstat '/Users/mdl/workspace/git-hub-lib/luebken/probot/bin/probot'
GitHub
So users with short usernames get a hint on whats wrong. Not yet tested.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ezyang picture ezyang  路  3Comments

dev
devmchakan picture devmchakan  路  3Comments

anglinb picture anglinb  路  4Comments

brunolemos picture brunolemos  路  3Comments

Jake-Gillberg picture Jake-Gillberg  路  3Comments