# Twitter, Github and normal username and password logins not working after upgrade

**URL:** https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854
**Category:** Self-hosting
**Tags:** unsupported-install
**Created:** [October 21, 2016, 12:58pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854 "2016-10-21T12:58:57Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [October 21, 2016, 12:58pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/1 "2016-10-21T12:58:57Z")

</div>

I upgraded the forum last night and this morning several members have emailed saying they can’t register (everything appears to work but when redirected back to the forum they are still shown the log-in/sign-up and can’t post etc).

I’ve tried using a Twitter log-in on one of our existing accounts and I get the same thing.

Anyone know how to troubleshoot this? There are no errors in the error log. The forum is at [https://elixirforum.com](https://elixirforum.com)

**Edit** : Normal username and password logins are not working either.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [October 21, 2016, 1:08pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/2 "2016-10-21T13:08:56Z")

</div>

Maybe it’s related?

> [@](#):
>
> Sites down:
> 
> - DYN
> 
> - Twitter
> 
> - Etsy
> 
> - Github
> 
> - soundcloud
> 
> - spotify
> 
> - heroku
> 
> - pagerduty
> 
> - shopify
> 
> - intercom (app, not landing page)
> 
> Note that if these sites seem to be up to you, it’s likely that your machine has cached the DNS response for these sites.
> 
> Some of these sites seem to work when using a UK VPN

> **[Massive Dyn DNS outage](https://news.ycombinator.com/item?id=12759520)**
>
> Sites down:\<p\>- DYN\<p\>- Twitter\<p\>- Etsy\<p\>- Github\<p\>- soundcloud\<p\>- spotify\<p\>- heroku\<p\>- pagerduty\<p\>- shopify\<p\>- intercom (app, not landing page)\<p\>Note that if these sites seem to be up to you, it's likely that your machine has cached the DNS response for these sites.\<p\>Some of these sites seem to work when using a UK VPN

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [October 21, 2016, 2:50pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/3 "2016-10-21T14:50:30Z")

</div>

I don’t think this is the issue because I managed to log in via Twitter to Discourse ok.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [October 21, 2016, 2:51pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/4 "2016-10-21T14:51:24Z")

</div>

And I managed to login with Github on Meta just now.

This looks like something with the new secure cookie. Is your setup just standard docker? I think you are on multisite right?

Is force\_https on for you?

EDIT: Your redirect URI is http on Github Login, somehow. Here on meta is correctly set to https.

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [October 21, 2016, 3:48pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/5 "2016-10-21T15:48:35Z")

</div>

Still getting the same thing (changed github callback url to [https://elixirforum.com](https://elixirforum.com)).

I’m not using multisite, just multiple single containers.

Yep, force\_https is selected.

I think it’s to do with the update : /

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [October 21, 2016, 3:51pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/6 "2016-10-21T15:51:47Z")

</div>

When logging with Github on Meta:

```plaintext
https://github.com/login?client_id=redacted&return_to=%2Flogin%2Foauth%2Fauthorize%3Fclient_id%redacted%26redirect_uri%3Dhttps%253A%252F%252Fmeta.discourse.org%252Fauth%252Fgithub%252Fcallback%26response_type%3Dcode%26scope%3Duser%253Aemail%26state%redacted

```

On Elixir Forum:

```plaintext
https://github.com/login?client_id=redacted&return_to=%2Flogin%2Foauth%2Fauthorize%3Fclient_id%redacted%26redirect_uri%3Dhttp%253A%252F%252Felixirforum.com%252Fauth%252Fgithub%252Fcallback%26response_type%3Dcode%26scope%3Duser%253Aemail%26state%redacted

```

Notice http VS https

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [October 21, 2016, 4:08pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/7 "2016-10-21T16:08:42Z")

</div>

Yeah, the redirect Uri is plain http. This is the secure cookies change

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [October 21, 2016, 4:11pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/8 "2016-10-21T16:11:00Z")

</div>

I just tried logging in with a normal username and password and that is not working either.

What is the secure cookies change and what do I need to do to fix it?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [October 21, 2016, 4:11pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/9 "2016-10-21T16:11:59Z")

</div>

[https://meta.discourse.org/t/secure-cookie-flag/28058/33?u=falco](https://meta.discourse.org/t/secure-cookie-flag/28058/33)

We are adding necessary security on https enabled sites.

It can break if https isn’t set properly.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [October 21, 2016, 4:12pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/10 "2016-10-21T16:12:17Z")

</div>

Go to your GitHub oauth settings and change the redirect URL to be https.

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [October 21, 2016, 4:19pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/11 "2016-10-21T16:19:10Z")

</div>

I set it to https earlier. But still, why would it affect normal username and password logins (which isn’t working either). Or Twitter?

I also just tried to rebuild one of the other forums… and that failed cos `Could not resolve host: github.com;` (which I guess is due to their current problems).

Can we switch this secure cookie update off via ACP or revert to an older version for the time being?

**Edit** : My set-up is detailed in this How To: [Set up Discourse on a server with existing Apache sites](https://meta.discourse.org/t/how-to-set-up-discourse-on-a-server-with-existing-apache-sites/30013)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [October 21, 2016, 4:39pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/12 "2016-10-21T16:39:13Z")

</div>

So it’s:

Internet → Haproxy → Apache → Docker → Nginx → Unicorn

When using something outside docker, I know it’s recommended make the inner nginx listen in a unix socket so stuff don’t break. However I don’t have much experience in your stack.

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [October 21, 2016, 4:45pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/13 "2016-10-21T16:45:53Z")

</div>

No, it’s simply:

Haproxy → Apache sites

Or for the Discourse forums:

Haproxy → Discourse Docker

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [October 21, 2016, 4:55pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/14 "2016-10-21T16:55:53Z")

</div>

Why is this an unsupported install @Falco? It is a Docker install as normal - the only difference is Haproy on the front (as there is no other way to run ‘normal’ websites on the same server - or do you know what the supported method is of running normal sites on a server as well?).

Also is there any way I can roll back the discourse version to before these new secure cookies were introduced? (Without reverting to an older database).

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [October 21, 2016, 5:00pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/15 "2016-10-21T17:00:46Z")

</div>

Github is back online and it’s set to https:

 ![](https://global.discourse-cdn.com/meta/original/3X/3/9/39ae0e0ad3e09b229b078b4bfceba5302ac6bff8.png)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [October 21, 2016, 5:10pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/16 "2016-10-21T17:10:06Z")

</div>

I think that the call back should be:

> [@Configure GitHub login for Discourse](https://meta.discourse.org/t/configure-github-login-for-discourse/13745/1):
>
> Be sure to set the Callback URL to use the path /auth/github/callback at your site domain. e.g., [http://discuss.example.com/auth/github/callback](http://discuss.example.com/auth/github/callback)

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [October 21, 2016, 5:30pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/17 "2016-10-21T17:30:13Z")

</div>

I’ve done that but it’s still `http` in the url 😕

Btw, I’m not using ` web.ssl.template.yml` as I thought there was no need if you are using something like nginix or haproxy on the front end (which handles the https side of things).

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [October 21, 2016, 5:39pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/18 "2016-10-21T17:39:44Z")

</div>

So you are terminating HTTPS at haproxy then right? And then sending HTTP to Discourse Docker?

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [October 21, 2016, 5:53pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/19 "2016-10-21T17:53:48Z")

</div>

Yes @cpradio

This is in my haproxy config (when it matches the url of my first Discourse forum):

> backend discourse\_docker  
> server server2 127.0.0.1:8888 cookie A check  
> cookie JSESSIONID prefix no cache

And in my container:

> expose:

- “8888:80” # fwd host port 80 to container port 80 (http)
- “2222:22” # fwd host port 2222 to container port 22 (ssh)

Full file here:

> [@](#):
>
> ## 
> 
> ## After making changes to this file, you MUST rebuild for any changes
> 
> ## to take effect in your live Discourse instance:
> 
> ## 
> 
> ## /var/discourse/launcher rebuild app
> 
> ## 
> 
> ## Make sure to obey YAML syntax! You can use this site to help check:
> 
> ## [http://www.yamllint.com/](http://www.yamllint.com/)
> 
> ## this is the all-in-one, standalone Discourse Docker container template
> 
> # You may add rate limiting by uncommenting the web.ratelimited template.
> 
> # Out of the box it allows 12 reqs a second per ip, and 100 per minute per ip
> 
> # This is configurable by amending the params in this file
> 
> templates:
> 
> - “templates/postgres.template.yml”
> - “templates/redis.template.yml”
> - “templates/web.template.yml”
> - “templates/sshd.template.yml”
> - “templates/web.ratelimited.template.yml”
> 
> ## which TCP/IP ports should this container expose?
> 
> expose:
> 
> - “8888:80” # fwd host port 80 to container port 80 (http)
> - “2222:22” # fwd host port 2222 to container port 22 (ssh)
> 
> params:  
> db\_default\_text\_search\_config: “pg\_catalog.english”
> 
> ## Set db\_shared\_buffers to a max of 25% of the total memory.
> 
> ## 
> 
> ## On 1GB installs set to 128MB (to leave room for other processes)
> 
> ## on a 4GB instance you may raise to 1GB
> 
> #db\_shared\_buffers: “256MB”
> 
> # 
> 
> ## Set higher on large instances it defaults to 10MB, for a 3GB install 40MB is a good default
> 
> ## this improves sorting performance, but adds memory usage per-connection
> 
> #db\_work\_mem: “40MB”
> 
> # 
> 
> ## Which Git revision should this container use? (default: tests-passed)
> 
> #version: tests-passed
> 
> env:  
> LANG: en\_US.UTF-8
> 
> # DISCOURSE\_DEFAULT\_LOCALE: en
> 
> ## TODO: How many concurrent web requests are supported?
> 
> ## With 2GB we recommend 3-4 workers, with 1GB only 2
> 
> #UNICORN\_WORKERS: 3
> 
> ## TODO: List of comma delimited emails that will be made admin and developer
> 
> ## on initial signup example ‘user1@example.com,user2@example.com’
> 
> DISCOURSE\_DEVELOPER\_EMAILS: ‘myemail@gmx.net’
> 
> ## TODO: The domain name this Discourse instance will respond to
> 
> DISCOURSE\_HOSTNAME: ‘[metaruby.com](http://metaruby.com)’
> 
> ## TODO: The mailserver this Discourse instance will use
> 
> DISCOURSE\_SMTP\_ADDRESS: [mail.myserver.net](http://mail.myserver.net)  
> DISCOURSE\_SMTP\_PORT: 25  
> DISCOURSE\_SMTP\_USER\_NAME: [contact@myforum.com](mailto:contact@myforum.com)  
> DISCOURSE\_SMTP\_PASSWORD: password  
> #DISCOURSE\_SMTP\_ENABLE\_START\_TLS: false  
> DISCOURSE\_SMTP\_OPENSSL\_VERIFY\_MODE: ‘none’
> 
> ## The CDN address for this Discourse instance (configured to pull)
> 
> #DISCOURSE\_CDN\_URL: [//discourse-cdn.example.com](https://discourse-cdn.example.com)
> 
> ## These containers are stateless, all data is stored in /shared
> 
> volumes:
> 
> - volume:  
> host: /home/metaruby/apps/discourse/shared/standalone  
> guest: /shared
> - volume:  
> host: /home/metaruby/apps/discourse/shared/standalone/log/var-log  
> guest: /var/log
> 
> ## The docker manager plugin allows you to one-click upgrade Discourse
> 
> ## [http://discourse.example.com/admin/docker](http://discourse.example.com/admin/docker)
> 
> hooks:  
> after\_code:  
> - exec:  
> cd: $home/plugins  
> cmd:  
> - mkdir -p plugins  
> - git clone [GitHub - discourse/docker\_manager: Plugin for use with discourse docker image · GitHub](https://github.com/discourse/docker_manager.git)  
> - git clone [GitHub - discourse/discourse-tagging: Tagging functionality for Discourse Forums · GitHub](https://github.com/discourse/discourse-tagging.git)  
> - git clone [GitHub - discourse/discourse-solved: Allow accepted answers on topics · GitHub](https://github.com/discourse/discourse-solved.git)
> 
> ## Remember, this is YAML syntax - you can only have one block with a name
> 
> run:
> 
> - exec: echo “Beginning of custom commands”
> 
> ## If you want to set the ‘From’ email address for your first registration, uncomment and change:
> 
> #- exec: rails r “SiteSetting.notification\_email=‘info@unconfigured.discourse.org’”
> 
> ## After getting the first signup email, re-comment the line. It only needs to run once.
> 
> ## If you want to configure password login for root, uncomment and change:
> 
> ## Use only one of the following lines:
> 
> #- exec: /usr/sbin/usermod -p ‘PASSWORD\_HASH’ root  
> #- exec: /usr/sbin/usermod -p “$(mkpasswd -m sha-256 ‘RAW\_PASSWORD’)” root
> 
> ## If you want to authorized additional users, uncomment and change:
> 
> #- exec: ssh-import-id username  
> #- exec: ssh-import-id anotherusername
> 
> - exec: echo “End of custom commands”
> - exec: awk -F# ‘{print $1;}’ ~/.ssh/authorized\_keys | awk ‘BEGIN { print “Authorized SSH keys for this container:”; } NF\>=2 {print $NF;}’
> 
> run:
> 
> - file:  
> path: /tmp/add-cert  
> chmod: +x  
> contents: |  
> #!/bin/bash -e  
> #Download cert  
> wget [http://mysite.net/crts/cert8.txt](http://mysite.net/crts/cert8.txt) -O - \> /usr/local/share/ca-certificates/aston-email.crt  
> update-ca-certificates
> 
> - exec: “/tmp/add-cert”

(I think all of this was set-up in this manner after the advice I got here on Meta.)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 21, 2016, 6:17pm UTC](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854/20 "2016-10-21T18:17:34Z")

</div>

> [@AstonJ](#):
>
> I don’t think this is the issue because I managed to log in via Twitter to Discourse ok.

If you log in to your host and type

```
dig github.com

```

does it resolve? It’s not resolving anywhere that I can find.

```plaintext

; <<>> DiG 9.9.5-3ubuntu0.9-Ubuntu <<>> github.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 17584
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;github.com. IN	A

;; Query time: 5003 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Oct 21 14:13:00 EDT 2016
;; MSG SIZE rcvd: 39

root@forum:/var/discourse# 

```

Right this minute 8.8.8.8 and 8.8.4.4 don’t find github and the ones of github’s DNS servers that I checked are unreachable. I’d wait a while before debugging this further

```plaintext
Tech Email: hostmaster@github.com
Name Server: ns2.p16.dynect.net
Name Server: ns3.p16.dynect.net
Name Server: ns4.p16.dynect.net
Name Server: ns1.p16.dynect.net

```

[Next page](https://meta.discourse.org/t/twitter-github-and-normal-username-and-password-logins-not-working-after-upgrade/51854.md?page=2)
