# Erro Onebox código 403

**URL:** https://meta.discourse.org/t/onebox-error-code-of-403/189000
**Category:** Support
**Created:** [3 Maio , 2021 14:00 UTC](https://meta.discourse.org/t/onebox-error-code-of-403/189000 "2021-05-03T14:00:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![SkyLin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/skylin/32/206593_2.png) [@SkyLin](https://meta.discourse.org/u/SkyLin)
#### Post date: [3 Maio , 2021 14:00 UTC](https://meta.discourse.org/t/onebox-error-code-of-403/189000/1 "2021-05-03T14:00:25Z")

</div>

A função de pré-visualização do Onebox para URLs da Udemy apresentou o seguinte erro:

“Desculpe, não foi possível gerar uma pré-visualização para esta página da web, pois o servidor web retornou um código de erro 403.”

Não tenho certeza se isso se deve à atualização do Discourse hoje ou ao próprio site. Veja a situação:

1. A pré-visualização do site da Udemy funcionava bem até anteontem. URL de exemplo:  
[Udemy free coupon code 2021\_0502-2 - udemy 優惠券 - StudyCamp 線上學習論壇](https://vip.studycamp.tw/t/topic/1370)

2. A pré-visualização do Onebox não está funcionando hoje. URL de exemplo:  
[Udemy free coupon code 2021\_0503 - udemy 優惠券 - StudyCamp 線上學習論壇](https://vip.studycamp.tw/t/topic/1379)

Fiz alguns testes adicionais:

1. A pré-visualização do Onebox do YouTube funciona bem.

2. A pré-visualização da Udemy na ferramenta de depuração do Facebook funciona bem:  
[https://developers.facebook.com/tools/debug/](https://developers.facebook.com/tools/debug/)

URL de curso da Udemy para teste: (Estranho, a pré-visualização funciona bem aqui)  
[https://www.udemy.com/course/ultimate-devsecops-with-real-world-scenarios/?couponCode=AGER4U](https://www.udemy.com/course/ultimate-devsecops-with-real-world-scenarios/?couponCode=AGER4U)

Por favor, oriente-nos. Muito obrigado!

---

<div class="post-metadata">

### Author: ![SkyLin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/skylin/32/206593_2.png) [@SkyLin](https://meta.discourse.org/u/SkyLin)
#### Post date: [4 Maio , 2021 01:57 UTC](https://meta.discourse.org/t/onebox-error-code-of-403/189000/2 "2021-05-04T01:57:36Z")

</div>

> [@SkyLin](#):
>
> discourse atualizando hoje

A atualização da imagem do docker antes e depois.  
PS: o plugin onebox deve ser o mesmo

> **[Comparing 230dec2...93d7c8a · discourse/docker\_manager](https://github.com/discourse/docker_manager/compare/230dec2...93d7c8a)**
>
> Plugin for use with discourse docker image. Contribute to discourse/docker\_manager development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![SkyLin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/skylin/32/206593_2.png) [@SkyLin](https://meta.discourse.org/u/SkyLin)
#### Post date: [4 Maio , 2021 13:27 UTC](https://meta.discourse.org/t/onebox-error-code-of-403/189000/3 "2021-05-04T13:27:15Z")

</div>

Encontrei um problema semelhante anos atrás.

> [@Amazon onebox fails on my site, but works here](https://meta.discourse.org/t/amazon-onebox-fails-on-my-site-but-works-here/41609):
>
> I’ve tried adding both amazon.com and www.amazon.com as whitelisted domains. I tried to pasted this link and many others from Amazon into a new topic on my site: http://www.amazon.com/The-Advantage-Organizational-Everything-Business/dp/1491510803 When I do, I get the following in Chrome’s dev tools console: https://www.myforumdomain.com/onebox?url=http%3A%2F%2Fwww.amazon.com%2FThe-Advantage-Organizational-Everything-Business%2Fdp%2F1491510803d&refresh=false Failed to load resource: the serve…

---

<div class="post-metadata">

### Author: ![SkyLin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/skylin/32/206593_2.png) [@SkyLin](https://meta.discourse.org/u/SkyLin)
#### Post date: [4 Maio , 2021 13:40 UTC](https://meta.discourse.org/t/onebox-error-code-of-403/189000/4 "2021-05-04T13:40:24Z")

</div>

Informações da atualização: antes e depois.  
PS: Após a atualização, o onebox falhou com erro 403

```plaintext
https://github.com/discourse/docker_manager/compare/230dec2...93d7c8a

https://github.com/discourse/discourse/compare/54b7a0d0...f1e74c89

https://github.com/discourse/discourse-calendar/compare/082bb3d...6cc116d

https://github.com/discourse/discourse-chat-integration/compare/ec7cf1e...a1bd603

https://github.com/discourse/discourse-math/compare/c925f7e...afb8e9f

https://github.com/discourse/discourse-reactions/compare/75f9dd9...9238b8c

https://github.com/discourse/discourse-sitemap/compare/9f2e7de...e64f393

```

---

<div class="post-metadata">

### Author: ![SkyLin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/skylin/32/206593_2.png) [@SkyLin](https://meta.discourse.org/u/SkyLin)
#### Post date: [7 Maio , 2021 10:46 UTC](https://meta.discourse.org/t/onebox-error-code-of-403/189000/5 "2021-05-07T10:46:12Z")

</div>

Fiz mais alguns testes, nenhum deles resolveu esse bug.

**Teste 1**. Restaurar o backup\* feito antes do bug ocorrer. Reiniciar o sistema e então obter um erro 502.  
PS: Imagem de disco do VPS com backup em 27/04, não um arquivo zip de backup do Discourse.

O novo arquivo de backup pode ser restaurado e o sistema reiniciado sem problemas; apenas o backup antigo falhou. É estranho. Teoricamente, o backup antigo deveria funcionar tão bem quanto o outro.

 ![502](https://global.discourse-cdn.com/meta/original/3X/3/f/3f42c39da280ce08401e03f24a80110ee9ac2ec0.jpeg)

**Teste 2**. Clonar a imagem de disco do backup do VPS para um novo VPS e seguir os passos abaixo para configurar um novo domínio. O novo site funciona normalmente, mas esse bug ainda persiste. Isso deve ser devido ao rebuild, que carrega uma nova imagem do Discourse, que é a mesma.

> [@Change the domain name or rename your Discourse](https://meta.discourse.org/t/change-the-domain-name-or-rename-my-discourse/16098):
>
> bookmark This guide explains how-to change the domain name of your Discourse site, and includes information about setting up DNS changes, editing configuration files, updating site settings, and correcting social logins and post content to reflect your new domain name. warning This guide is for self-hosted Discourse instances that were installed using our [installation guide on GitHub](https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md). If you are [hosted by Discourse](https://www.discourse.org/pricing), please see [Configure your domain name for hosted Discourse](https://meta.discourse.org/t/configure-your-domain-name-for-hosted-discourse/21827) for specific …

**Teste 3**. Seguir os passos da página web abaixo para verificar o motivo do erro 403.

> [@Amazon onebox fails on my site, but works here](https://meta.discourse.org/t/amazon-onebox-fails-on-my-site-but-works-here/41609/9):
>
> Just tried a couple things: From the DO box itself I can curl this URL fine: http://www.amazon.com/The-Advantage-Organizational-Everything-Business/dp/1491510803 If I curl from within the docker container, though, I get a 503: \* Connection #0 to host www.google.com left intact root@host:/# curl http://www.amazon.com/The-Advantage-Organizational-Everything-Business/dp/1491510803 -v -o deleteme \* Hostname was NOT found in DNS cache % Total % Received % Xferd Average Speed Time …

A imagem aqui mostra a diferença do onebox entre o meta (acima) e meu site (abaixo).

 ![Clipboard01](https://global.discourse-cdn.com/meta/original/3X/f/7/f74a6dd626ee936cf0856ab136958ee6e6f1b3ab.jpeg)

Testando URLs para Udemy e Amazon. Parece que uma retorna 403 e a outra 503.  
[https://www.udemy.com/course/power-bi-2021-proyectos-reales-para-volverte-un-master/](https://www.udemy.com/course/power-bi-2021-proyectos-reales-para-volverte-un-master/)

> **[Deep Learning with Python: Chollet, Francois: 9781617294433: Amazon.com: Books](https://www.amazon.com/Deep-Learning-Python-Francois-Chollet/dp/1617294438)**
>
> Deep Learning with Python \[Chollet, Francois\] on Amazon.com. \*FREE\* shipping on qualifying offers. Deep Learning with Python

```plaintext
< HTTP/2 403
< date: Fri, 07 May 2021 10:18:28 GMT
< content-type: text/plain; charset=UTF-8
< content-length: 16
< x-frame-options: SAMEORIGIN
< cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< expires: Thu, 01 Jan 1970 00:00:01 GMT
< set-cookie: __cfduid=dbbbf721820c12aac03e8116c362147d51620382708; expires=Sun, 06-Jun-21 10:18:28 GMT; path=/; domain=.udemy.com; HttpOnly; SameSite=Lax
< cf-request-id: 09e7ef0b3c00000b939211d000000001
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< set-cookie: __cf_bm=f83cbaa075085ed2ae624e9bcfa5badf394f7ddd-1620382708-1800-Af1qbDD41LzYLWJX0XR39JAeFnjBdEmvhZO/0YloMwnBR8urb60m7+bcte18X+L59RfHKhzWeGPELN02cuiV9RA=; path=/; expires=Fri, 07-May-21 10:48:28 GMT; domain=.udemy.com; HttpOnly; Secure; SameSite=None
< x-content-type-options: nosniff
< server: cloudflare
< cf-ray: 64b9b4585d9b0b93-NRT
<
{ [16 bytes data]
100 16 100 16 0 0 290 0 --:--:-- --:--:-- --:--:-- 296
* Connection #0 to host www.udemy.com left intact

```

```plaintext
< HTTP/2 503
< server: Server
< date: Fri, 07 May 2021 10:25:04 GMT
< content-type: text/html
< strict-transport-security: max-age=47474747; includeSubDomains; preload
< x-amz-rid: P43ZS4CBG7V92Z7W4VSC
< vary: Content-Type,Accept-Encoding,X-Amzn-CDN-Cache,X-Amzn-AX-Treatment,User-Agent
< last-modified: Wed, 30 Sep 2020 23:54:00 GMT
< etag: "a6f-5b0909d09d600"
< accept-ranges: bytes
< content-length: 2671
<
{ [1139 bytes data]
100 2671 100 2671 0 0 11871 0 --:--:-- --:--:-- --:--:-- 11871
* Connection #0 to host www.amazon.com left intact

```
