422 Unprocessable Entity عند النقر على "عرض المنشور بالكامل" في منشور Discourse

Hello,
I’m really hoping I can get some help here. Browsed the web, but couldn’t fine a case matching mine.

I’m testing Wordpress with Discourse. Separately they both work just fine. However I’ve got an issue when using the WP plugin.
When I publish a WP post, a topic gets created in Discourse using the plugin as desired. The topic itself is created correctly. However when I click the “Show full Post” button the WP post doesn’t get expanded.
In the browser console I see an error like this:

Request URL: http://forum.sadzinica.pl/posts/19/expand-embed
Request Method: GET
Status Code: 422 Unprocessable Entity
Remote Address: 192.168.0.15:80
Referrer Policy: strict-origin-when-cross-origin
Cache-Control: no-cache, no-store
Connection: keep-alive
Content-Type: application/json; charset=utf-8
Date: Tue, 12 Jan 2021 09:07:49 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: nginx/1.14.2
Set-Cookie: __profilin=REMOVED; path=/; HttpOnly; SameSite=Lax
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Discourse-Route: posts/expand_embed
X-Discourse-Username: admin
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Request-Id: b904c2d5-2088-4193-be0c-f36b497d716e
X-Runtime: 0.021514
X-XSS-Protection: 1; mode=block
Accept: application/json, text/javascript, */*; q=0.01
Accept-Encoding: gzip, deflate
Accept-Language: pl-PL,pl;q=0.9,en-GB;q=0.8,en;q=0.7,de-DE;q=0.6,de;q=0.5,en-US;q=0.4,it;q=0.3,es;q=0.2,ro;q=0.1,it-IT;q=0.1
Connection: keep-alive
Cookie: __profilin=REMOVED; _t=REMOVED; _forum_session=I-REMOVED-IT
Discourse-Logged-In: true
Discourse-Present: true
Discourse-Track-View: true
Host: forum.sadzinica.pl
Referer: http://forum.sadzinica.pl/t/zebranie-wiejskie-w-sprawie-x/15/3
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36
X-CSRF-Token: 1ke5PaosmJ5gYeRpUs6ZkMWD+H4zaovMmVr3JPPNXeuidSmhdD2FmkeBaTgrH0TUuU+GrH/+OV0c338W/4RbjA==
X-Requested-With: XMLHttpRequest

And a jquery error:

XMLHttpRequest.send | @ | includes.js?v=10da95…f1bd50fe50ed714:819
  | send | @ | _ember_jquery-189e46…649161a18d.js:10113
  | ajax | @ | _ember_jquery-189e46…6649161a18d.js:9696
  | i | @ | _application-525b557…c2ebdfb8509.js:9229
  | (anonymous) | @ | _ember_jquery-189e46…649161a18d.js:72238
  | n | @ | _ember_jquery-189e46…649161a18d.js:72760
  | i | @ | _application-525b557…c2ebdfb8509.js:9242
  | expand | @ | _application-525b557…2ebdfb8509.js:16991
  | expandFirstPost | @ | _application-525b557…2ebdfb8509.js:78560
  | (anonymous) | @ | _application-525b557…2ebdfb8509.js:82798
  | value | @ | _application-525b557…2ebdfb8509.js:82756
  | value | @ | _application-525b557…2ebdfb8509.js:82794
  | click | @ | _application-525b557…2ebdfb8509.js:78431
  | (anonymous) | @ | _application-525b557…2ebdfb8509.js:75834
  | (anonymous) | @ | _application-525b557…2ebdfb8509.js:75733
  | value | @ | _application-525b557…2ebdfb8509.js:82756
  | k | @ | _application-525b557…2ebdfb8509.js:75732
  | (anonymous) | @ | _application-525b557…2ebdfb8509.js:75833
  | dispatch | @ | _ember_jquery-189e46…6649161a18d.js:5443
  | d.handle | @ | _ember_jquery-189e46…6649161a18d.js:5247

My setup: WP and DIscourse installed inside Ubuntu 20.04 LTS VM running on Virualbox under Linux. I’m testing withinmy local network with my own DNS directing to the host hosting the Virtualbox VM. I use 2 nginx reverse proxies. The first one in Ubuntu VM redirects requests to/from VM docker containers ports/unix sockets
Then this is forwared by Virtualbox to port 8000 on the host and then another nginx does reverse proxy to map this to port 80 of the host machine (host hosting the VM).
I’m testing this to simulate a real setup as I want to run both Wordpress and Discourse inside a VPS when I get everything working locally.

Please let me know if you need more info. Thank you!

Hey there @dgtal1 apologies for the slow reply here. Are you still experiencing this issue? Also, was it just this specific post, or all posts?

I suspect this one has something to do with the content of the wordpress post itself, which seems to be initiating a request.

عذرًا على إحياء منشور قديم، ولكنني أواجه هذه المشكلة أيضًا، على Drupal - وليس WordPress. لقد قمت سابقًا بتعطيل سياسة أمان المحتوى لمحاولة حل هذه المشكلة، ولكنني الآن أرى خطأ 422 كيان غير قابل للمعالجة عند النقر فوق زر “إظهار المنشور بالكامل”. يبدو أن هذه الوظيفة المعطلة للزر تحدث عبر جميع المقالات التي تم نشرها، وليس فقط المقالات الجديدة. تتأثر المقالات القديمة التي تم تمكين الاقتطاع فيها أيضًا.

تثبيتي خلف Cloudflare، ولكني لا أرى أي سجلات أحداث أمنية تشير إلى حظر الموارد من منطقة جدار حماية التطبيقات (WAF) أو القواعد المُدارة. أنا حقًا لست متأكدًا مما يجب فعله بعد ذلك لحل هذه المشكلة.

مرحباً @spectrum، هل تمانع في فتح موضوع Support منفصل مع بعض التفاصيل الإضافية بما في ذلك:

  1. بعض السجلات (مثل المنشور الأول في هذا الموضوع).
  2. روابط للمنشورات ذات الصلة على Discourse و Drupal إن أمكن.

ليست كل أخطاء 422 متماثلة. في الحالة المذكورة أعلاه، كان من المحتمل أن يكون ذلك بسبب محتوى المنشور.

إعجاب واحد (1)

هل هذه نفس المشكلة التي تم حلها في هذا الموضوع @spectrum؟

إعجابَين (2)

نعم، هذا صحيح! أعتذر عن تأخري. تمكنت من تأكيد أن هذا يعمل بعد رفع حظر عنوان IP من خادمنا. لقد نسيت أنني تواصلت أيضًا في هذا الموضوع أثناء استكشاف الأخطاء وإصلاحها، لذا آسف لذلك! نأمل أن يساعد هذا في توجيه الآخرين الذين يواجهون مشكلات مماثلة في الاتجاه الصحيح.

إعجابَين (2)