# Internal links stopped oneboxing in login-required instance

**URL:** https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949
**Category:** Support
**Created:** [Junho 17, 2016, 12:54pm UTC](https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949 "2016-06-17T12:54:28Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [Junho 17, 2016, 12:54pm UTC](https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949/1 "2016-06-17T12:54:28Z")

</div>

I’m operating two Discourse instances with `login required`, both running on the `beta` channel, both are up-to-date.

In _one_ of these instances, local links to posts no longer onebox (they don’t produce a broken onebox, they just do not onebox at all). No log entries are produced.

Does anyone have an idea what could be causing this?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [Junho 17, 2016, 6:48pm UTC](https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949/2 "2016-06-17T18:48:33Z")

</div>

We have had intermittent reports of this but we can never repro it.

Best guess is outgoing server DNS problems, when we have been able to diagnose it.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [Junho 17, 2016, 6:52pm UTC](https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949/3 "2016-06-17T18:52:43Z")

</div>

I just testet `curl`ing from both `google.de` and my domain itself from within the container, and the domain was resolved correctly. But Oneboxes are still not working (even for new links that are not in the cache)…

Any more ideas? Could I help you diagnose that in any way?

---

<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: [Junho 17, 2016, 7:28pm UTC](https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949/4 "2016-06-17T19:28:34Z")

</div>

There was a bug involving local onebox, login required and subdomain, but this got fixed.

When I was debugging it I had to use a dev environment, and it was easy from there, but it was easy to reproduce.

If you can find some difference between the working instance and the other we can hunt it down.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [Junho 17, 2016, 7:31pm UTC](https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949/5 "2016-06-17T19:31:47Z")

</div>

> [@Falco](#):
>
> If you can find some difference between the working instance and the other we can hunt it down.

I cannot really think of any meaningful difference…  
Both are non-subfolder, Docker, `login required`, SSO-enabled instances with almost the same plugins.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [Junho 17, 2016, 8:23pm UTC](https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949/6 "2016-06-17T20:23:35Z")

</div>

That’s why this is so hard to diagnose. You have two “identical” sites and.. one is different. We’ve _never_ been able to repro this problem, but it has been reported a fair number of times.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [Junho 17, 2016, 10:02pm UTC](https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949/7 "2016-06-17T22:02:25Z")

</div>

Okay, I thought a bit more about the possible differences…

- Both sites ran the same version of Discourse.
- Both sites temporarily ran the exact same set of plugins for testing.
- The site settings in the `Onebox` category are identical.
- The site settings in the `Basic Setup` category are identical.
- The remaining site settings are not identical, but no difference seems related to oneboxing.
- The language settings in `app.yml` are identical.
- Both sites run under a nginx proxy handling SSL.
- Both sites are non-subfolder-installs.
- Of course, both sites are supported Docker installs.
- Both sites are running on Ubuntu 14.

Some differences:

- The site with the broken Oneboxes failed the automatic upgrade to Postgres 9.5.
- The site with the broken Oneboxes is running on a fourth-level domain; the other one is running on a third-level domain.

I’m not sure whether local oneboxes have ever been working in the broken instance.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [Junho 17, 2016, 10:09pm UTC](https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949/8 "2016-06-17T22:09:17Z")

</div>

> [@fefrei](#):
>
> The site with the broken Oneboxes is running on a fourth-level domain; the other one is running on a third-level domain.

What does this mean?

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [Junho 17, 2016, 10:10pm UTC](https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949/9 "2016-06-17T22:10:50Z")

</div>

The working instance is running on `discourse.example.com`, the broken one is `project-discourse.department.example.com` – so it’s a subdomain of a subdomain.

---

<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: [Junho 18, 2016, 12:02am UTC](https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949/10 "2016-06-18T00:02:47Z")

</div>

I have an instance on forum.intranet.company.com.br (5 level domain) that works fine.

With SSO enabled too.

Can you try to peek at /var/discourse/shared/standalone/rails/production.log at the one boxing time?

Remember to use a new url, since discourse caches results, and there will be a stack trace there.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [Junho 18, 2016, 9:37am UTC](https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949/11 "2016-06-18T09:37:31Z")

</div>

Here is the log entry for this corresponding call:

```plaintext
Started GET "/onebox?url=https%3A%2F%2Fvorkurs-discourse.cs.uni-saarland.de%2Ft%2Fbijektivitaet%2F547&refresh=false" for 188.210.56.176 at 2016-06-18 09:35:52 +0000
Processing by OneboxController#show as HTML
  Parameters: {"url"=>"https://vorkurs-discourse.cs.uni-saarland.de/t/bijektivitaet/547", "refresh"=>"false"}
  Rendered text template (0.0ms)
Completed 200 OK in 53ms (Views: 12.6ms | ActiveRecord: 17.3ms)

```

That looks fine, I think 😕

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [Junho 22, 2016, 11:41am UTC](https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949/12 "2016-06-22T11:41:27Z")

</div>

I found the problem – and it is a rather stupid one 😊

[https://meta.discourse.org/t/internal-oneboxing-does-not-work-on-topics-in-private-categories/24917/13?u=fefrei](https://meta.discourse.org/t/internal-oneboxing-does-not-work-on-topics-in-private-categories/24917/13)

I ran into this exact problem.

Sorry for wasting your time, @codinghorror and @Falco 😟

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [Julho 4, 2016, 8:37pm UTC](https://meta.discourse.org/t/internal-links-stopped-oneboxing-in-login-required-instance/45949/13 "2016-07-04T20:37:46Z")

</div>


