aws-quickstart / quickstart-github-enterprise

AWS Quick Start Team
Apache License 2.0
22 stars 22 forks source link

Fix initial user creation failure #13

Closed webdog closed 6 years ago

webdog commented 6 years ago

The script was failing because the write to the user model's permission changed recently in GHE.

This change moves the user creation to sending a POST to the initial user creation screen, allowing the org creation and repo creation to continue for AWS quickstart templates.

webdog commented 6 years ago

@avattathil Can you work with Erin Mcgill to confirm this fix before merging? Thanks!

cc @coryvj

emcfins commented 6 years ago

Hi @webdog - there are conflicts with this pull request. Can you resolve the issues so it can be merged? Thank you.

webdog commented 6 years ago

Sure, will look and resolve when I’m in front of a laptop tomorrow πŸ‘

On Tue, May 29, 2018 at 12:03 PM emcfins notifications@github.com wrote:

Hi @webdog https://github.com/webdog - there are conflicts with this pull request. Can you resolve the issues so it can be merged? Thank you.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aws-quickstart/quickstart-github-enterprise/pull/13#issuecomment-392901768, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6m0mIX7ZLESJwSJhM_krhU1gJmwOWuks5t3ZtzgaJpZM4UAgEV .

--

Christian Weber | Senior Solutions Engineer | GitHub

webdog@github.com | 773.587.6890

emcfins commented 6 years ago

Actually - I'm running into an issue running the adminuser script. This line: curl -L $SetUp | bash -s $(cat $ADMININFO| grep github_adminuser_name | awk -F':' '{print $2}') $(cat $ADMININFO| grep github_adminuser_email | awk -F':' '{print $2}') $(cat $ADMININFO| grep github_adminuser_password | awk -F':' '{print $2}') $(cat $ADMININFO| grep github_organization | awk -F':' '{print $2}') $(cat $ADMININFO| grep github_repository | awk -F':' '{print $2}'); returns an error: /data/github/d4b507ff93607f950134a8e7903e56622fdea777/lib/github/html/rel_nofollow_filter.rb:16:in `map': undefined method `downcase' for nil:NilClass (NoMethodError) from /data/github/d4b507ff93607f950134a8e7903e56622fdea777/lib/github/html/rel_nofollow_filter.rb:16:in `<class:RelNofollowFilter>' from /data/github/d4b507ff93607f950134a8e7903e56622fdea777/lib/github/html/rel_nofollow_filter.rb:4:in `<module:HTML>' from /data/github/d4b507ff93607f950134a8e7903e56622fdea777/lib/github/html/rel_nofollow_filter.rb:3:in `<top (required)>' from /data/github/d4b507ff93607f950134a8e7903e56622fdea777/lib/github/html/rel_nofollow_filter.rb:1:in `__ruby_concealer__' from /data/github/d4b507ff93607f950134a8e7903e56622fdea777/lib/github/html/rel_nofollow_filter.rb:1:in `<top (required)>' from /data/github/d4b507ff93607f950134a8e7903e56622fdea777/config/basic.rb:66:in `require' from /data/github/d4b507ff93607f950134a8e7903e56622fdea777/config/basic.rb:66:in `require' from /data/github/d4b507ff93607f950134a8e7903e56622fdea777/vendor/gems/2.4.2/ruby/2.4.0/gems/activesupport-3.2.22.5.github.fb116f9a6b/lib/active_support/dependencies.rb:251:in `block in require' from /data/github/d4b507ff93607f950134a8e7903e56622fdea777/vendor/gems/2.4.2/ruby/2.4.0/gems/activesupport-3.2.22.5.github.fb116f9a6b/lib/active_support/dependencies.rb:236:in `load_dependency' from /data/github/d4b507ff93607f950134a8e7903e56622fdea777/vendor/gems/2.4.2/ruby/2.4.0/gems/activesupport-3.2.22.5.github.fb116f9a6b/lib/active_support/dependencies.rb:251:in `require' Any idea what may be happening? I ran the script manually on the instance and verified that the necessary data/variable values was included.

webdog commented 6 years ago

@emcfins just resolved the conflict in the UI, however, I’m not sure where your script is failing. I didn’t bootstrap the script with so many variables, I ran the script bootstrapped with the $1, $2, and $3 as defined at the top of the file.

That error looks like an issue with a missing dependency on that machine. However, I’m unsure and can’t validate, as I’m on an iPad at the moment, until tomorrow.

Could you help me out and define what those variables in your script are doing when sending data to the admin user script? The commands are a bit hard to read on the ipad 😭 ✨

emcfins commented 6 years ago

Ha - I bet they are hard to read on the iPad 😸 Would you be available for a quick call? I'm seeing some things that aren't making sense and I think it would be easier to get to the bottom if we talked.

webdog commented 6 years ago

@emcfins Unfortunately, I’m on a plane at the moment. Happy to pick this up in the morning, after I run my test. I’ll see if I can run your command on my environment. Can you post the whole command (plus what the variables should evaluate to) so I can play around in my sandbox?

Thanks!

Christian

On Tue, May 29, 2018 at 1:46 PM emcfins notifications@github.com wrote:

Ha - I bet they are hard to read on the iPad 😸 Would you be available for a quick call? I'm seeing some things that aren't making sense and I think it would be easier to get to the bottom if we talked.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aws-quickstart/quickstart-github-enterprise/pull/13#issuecomment-392938173, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6m0nsVZyUz2ya_b08XjhO-7VWOvyrTks5t3bOXgaJpZM4UAgEV .

--

Christian Weber | Senior Solutions Engineer | GitHub

webdog@github.com | 773.587.6890

emcfins commented 6 years ago

Hmm - I started from scratch and am no longer seeing the error (🎊 πŸŽ‰ ) but it looks like I need to resolve an issue on my side with my license so maybe that caused the issues earlier. I'll resolve that and test again. Thanks!

webdog commented 6 years ago

Oh interesting!

Perhaps we should have a catch for that error in the log then? Theoretically, licenses should be valid when executing the quickstart, but it wouldn’t hurt to catch and return that error cleanly.

On Tue, May 29, 2018 at 3:25 PM emcfins notifications@github.com wrote:

Hmm - I started from scratch and am no longer seeing the error (🎊 πŸŽ‰ ) but it looks like I need to resolve an issue on my side with my license so maybe that caused the issues earlier. I'll resolve that and test again. Thanks!

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aws-quickstart/quickstart-github-enterprise/pull/13#issuecomment-392967415, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6m0i5TgxF6ax4zrHb1F9dbWX8oFyNHks5t3crLgaJpZM4UAgEV .

--

Christian Weber | Senior Solutions Engineer | GitHub

webdog@github.com | 773.587.6890

emcfins commented 6 years ago

Yeah - that's a great call out. I'll open an issue for the change.

emcfins commented 6 years ago

Ok - my license issues have been resolved. I built another stack and am still getting an error with the new script: https://gist.github.com/emcfins/331d25046e390cb4da9406fca179eb5f It looks like the creation of the management password and the configuration process goes fine but it's still having an issue with creating the admin user and initial organizations and repositories. Let me know if you can't view the gist.

webdog commented 6 years ago

Let me try on my machine, but it looks like some sort of timing issue:

*You can't perform that action at this time.*

Could you trying having the script sleep for like 10-15 seconds before it attempts to create the user? Could be a service isn't fully initialized before curl is hitting the registration page. (Just a guess, will need to test)

Christian

On Thu, May 31, 2018 at 12:26 PM, emcfins notifications@github.com wrote:

Ok - my license issues have been resolved. I built another stack and am still getting an error with the new script: https://gist.github.com/emcfins/331d25046e390cb4da9406fca179eb5f It looks like the creation of the management password and the configuration process goes fine but it's still having an issue with creating the admin user and initial organizations and repositories. Let me know if you can't view the gist.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aws-quickstart/quickstart-github-enterprise/pull/13#issuecomment-393609870, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6m0mqVFuVeDpbJNZjNHJP9WERM_JaTks5t4CfigaJpZM4UAgEV .

--

Christian Weber | Senior Solutions Engineer | GitHub

webdog@github.com | 773.587.6890

emcfins commented 6 years ago

@webdog - I got this to work! 🎊 It looks like the admin user that I was trying to use - 'admin' - is no longer accepted as it's a reserved user. πŸ‘ πŸ’ƒ

webdog commented 6 years ago

@emcfins Totally forgot about that 😒

Glad it works!

Do you wanna start a project board with some of the feature additions?

Two I see so far: