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

manifest flow is not working; settings/apps/new appears and is blank #1170

Closed
justinsb opened this issue Mar 24, 2020 · 12 comments
Closed

manifest flow is not working; settings/apps/new appears and is blank #1170

justinsb opened this issue Mar 24, 2020 · 12 comments

Comments

@justinsb
Copy link

Current Behavior

I went through the new app flow at https://probot.github.io/docs/development/ ; when I click the "Register Github App" button the https://github.com/settings/apps/new page does appear, but it does not have any values populated - all the text inputs are empty.

Expected behavior/code

I expected the form to be entirely populated, except for the name? My real goal here is to skip the requirement to download the private key, because receiving it via the callback handshake seems much more user-friendly.

Environment

  • Probot version(s): v4.2.2
  • Node/npm version: npm 5.8.0
  • OS: Linux

Additional context

I think maybe this flow is broken on github.com, as I tried implementing it manually also (following https://developer.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/ ) and got the same result.

@welcome
Copy link

welcome bot commented Mar 24, 2020

Thanks for opening this issue. A contributor should be by to give feedback soon. In the meantime, please check out the contributing guidelines and explore other ways you can get involved.

@MaximDevoir
Copy link
Contributor

MaximDevoir commented Mar 24, 2020

It looks like you're using an older version of Probot.

The latest version should automatically fill out these fields for you.

@justinsb
Copy link
Author

Thanks for the response. My mistake: I'm using create-probot-app version v4.2.2, which creates an app that uses probot 9.11.1

Sequence of commands:

npx create-probot-app my-first-app
# choose simple values e.g. no spaces
cd my-first-app
npm run dev

@MaximDevoir
Copy link
Contributor

Hmm, the sequence of commands works for me.

Here's what it looks like for me (PS: I'm using the typescript template for this demo):

cpa-working-example

@MaximDevoir
Copy link
Contributor

MaximDevoir commented Mar 24, 2020

My real goal here is to skip the requirement to download the private key, because receiving it via the callback handshake seems much more user-friendly.

Probot should automagically receive and store the key once you click Register GitHub App and then Create GitHub App.

When you were asked questions with create-probot-app, what values are you answering them with?

Maybe create-probot-app is failing to handle certain values, which may be requiring you to enter in your app configuration manually.

@justinsb
Copy link
Author

Update: I think I've tracked it down; the flows work fine on my home machine, it doesn't work on my work machine. (Using the same app). I'll try to figure out what the difference is by looking at the requests - superficially it looks like my work machine always has a login redirect (which then redirects back) and that seems to be breaking things, but I'll dig in more.

(Just to answer, though I don't think it's the problem: I deliberately chose values that were likely to be unique and non-problematic, my username + "-probot-1" and similar values with no spaces)

Thanks for all the pointers @MaximDevoir - much appreciated!

@justinsb
Copy link
Author

justinsb commented Mar 25, 2020

So I am able to get it working on my work machine as well, but only if I have (very) recently signed out and signed back in.

When it is not working: On the work machine, https://github.com/settings/apps/new 302 redirects to https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsettings%2Fapps%2Fnew which immediately 302 redirects back to https://github.com/settings/apps/new .

I'm assuming that the POST body is getting lost in that redirect. There is a (big) cookie, though I couldn't tell if it was carrying my request.

When I have recently signed in, /new does not redirect to /login, and it works - I get the short-form with just the name, and the name is pre-populated. (More evidence pointing to this redirect being the problem)

I do have two-factor auth enabled, but it's the same account so I have it on both machines. Both are Linux machines running Chrome, though not identical configurations (plainly!). The work machine may well have a more restrictive cookie or security policy, though I don't know what that would be. I did clear cookies on the work machine and log back in, it then works for a period of time until the 302-login redirect starts happening.

The time from when a login is "new enough" is not long - less than half an hour, I think.

I don't think this is a probot issue therefore, as it seems to be server-side on github.com (likely triggered by something different on my work machine browser). I'm not sure if we should pursue the issue with github itself (or the best medium to do that). But if you want to close, that likely makes sense for this issue (and it should be searchable now, should others hit it)

Thank you so much for all the help @MaximDevoir !

GitHub
GitHub is where people build software. More than 40 million people use GitHub to discover, fork, and contribute to over 100 million projects.
GitHub
GitHub is where people build software. More than 40 million people use GitHub to discover, fork, and contribute to over 100 million projects.

@gr2m
Copy link
Contributor

gr2m commented Mar 25, 2020

Great analysis, thank you @justinsb!

@shadycuz
Copy link

shadycuz commented Apr 4, 2020

I also was having trouble and didn't understand the intended flow, but I have the exact same experience as @justinsb. I will try and log in and out and create a new app.

@merinjo
Copy link

merinjo commented May 20, 2020

I have a similar experience as @justinsb . Logging in and out does not solve this for me.

@gr2m gr2m added the pinned label May 20, 2020
@Waterdrips
Copy link

Waterdrips commented Jun 1, 2020

We are hitting this too!
openfaas/ofc-bootstrap#210

the manifext exists, i get 302d to login, then back to apps/new/ which is blank as the manifest is lost!

This looks to be a github issue as we are not using protobot!

@gr2m
Copy link
Contributor

gr2m commented Dec 8, 2020

I'll make sure this problem is addressed via #1435, if it's still relevant

@gr2m gr2m closed this as completed Dec 8, 2020
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