webapp/kopano.php?subsystem=webapp_1558940030903 502 Bad Gateway
-
I’m messing around with a weird problem in Kopano Webapp. I’m using kopano within docker containers from following project
https://github.com/zokradonh/kopano-docker
and the latest version of Core and Webapp (I tried with the last 5 Versions)
Webapp : 3.5.7.2298+1289.1
Core: 8.7.81.48.39640ec78-0+233.1The problem is, that everything is running perfect besides the one issue that i cannot answer or forward to an email.
If I create and send a new email everything works as expected. When I answer to an email the browser and the proxy report a 502 bad gateway issue.I tried to connect to the webapp with and without a proxy. So the direct connection over port 9080 results in the same issue. So I can exclude a proxy issue. I tried different versions and I tried to log things but the only log I could get related to this problem is the log from the proxy server.
kweb log
X.X.X.X - - [27/May/2019:07:05:44 +0000] "POST /webapp/kopano.php?subsystem=webapp_1558940724801 HTTP/1.1" 502 40
If I manually connect to this site I get follow information within my browser
headers
Cache-Control: no-cache, must-revalidate Connection: Keep-Alive Content-Encoding: gzip Content-Length: 168 Content-Type: application/json; charset=utf-8 Date: Mon, 27 May 2019 07:08:26 GMT Expires: Mon, 27 May 2019 07:08:26GMT Keep-Alive: timeout=5, max=94 Last-Modified: Mon, 27 May 2019 07:08:26GMT Pragma: no-cache Server: kweb X-Zarafa: 3.5.7.2298+1289.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding: gzip, deflate, br Accept-Language: en-US Connection: keep-alive Host: XX.domain.com Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0
json
{"zarafa":{"error":{"type":2,"info":{"file":"util.php:575","display_message":"Beim codieren\/decodieren der JSON-Daten sind Probleme aufgetreten.","original_message":"JSON Fehler: - Syntaxfehler"}}}}
Thanks
I’d really appreciate your help. This is the last part to complete my project.
-
@rothirschtech said in webapp/kopano.php?subsystem=webapp_1558940030903 502 Bad Gateway:
The problem is, that everything is running perfect besides the one issue that i cannot answer or forward to an email.
that sounds like https://forum.kopano.io/topic/2446/problems-with-webapp-3-5-7-could-not-send-mails
-
Yeah I saw that article too. Ok in that case I will test the whole project with my official supported Kopano packages and will write my experiences to this site. Thanks for the quick reply.
-
Ok I tried the whole setup with my official supported packages.
Version
kopano-server 8.7.1.0-0+1.1
kopano-webapp 3.5.6.2298+94.1The problem still exists. After answering the mail, it looks like that the webapp tries to POST but gets a 502 response. After that it tests if the kopano server is online. Because this response is good it tries it again. This process loops until i reload the site or I sign out from webapp. After a few minutes the browser gets really slow. I don’t know
XHR POSThttps://XX.domain.local/webapp/kopano.php?subsystem=webapp_1558948911629 [HTTP/1.1 502 Bad Gateway 65ms] XHR GEThttps://XX.domain.local/webapp/kopano.php?ping [HTTP/1.1 200 OK 32ms] XHR POSThttps://XX.domain.local/webapp/kopano.php?subsystem=webapp_1558948911629 [HTTP/1.1 502 Bad Gateway 63ms] XHR GEThttps://XX.domain.local/webapp/kopano.php?ping [HTTP/1.1 200 OK 31ms] XHR POSThttps://XX.domain.local/webapp/kopano.php?subsystem=webapp_1558948911629 [HTTP/1.1 200 OK 109ms] XHR POSThttps://XX.domain.local/webapp/kopano.php?subsystem=webapp_1558948911629 [HTTP/1.1 502 Bad Gateway 71ms]
Maybe this is related to my docker setup? I changed the docker-compose.yml https://github.com/zokradonh/kopano-docker a bit. But I don’t think so because any other Request, if click through the webapp or send a new mail, does work
GATEWAY - - [27/May/2019:09:33:30 +0000] "POST /webapp/kopano.php?subsystem=webapp_1558949606425 HTTP/1.1" 200 32492 GATEWAY - - [27/May/2019:09:33:37 +0000] "POST /webapp/kopano.php?subsystem=webapp_1558949606425 HTTP/1.1" 200 2928 GATEWAY - - [27/May/2019:09:33:38 +0000] "POST /webapp/kopano.php?subsystem=webapp_1558949606425 HTTP/1.1" 200 2258 GATEWAY - - [27/May/2019:09:33:38 +0000] "POST /webapp/kopano.php?subsystem=webapp_1558949606425 HTTP/1.1" 200 2917 GATEWAY - - [27/May/2019:09:33:45 +0000] "POST /webapp/kopano.php?subsystem=webapp_1558949606425 HTTP/1.1" 502 40 GATEWAY - - [27/May/2019:09:33:46 +0000] "GET /webapp/kopano.php?ping HTTP/1.1" 200 90 GATEWAY - - [27/May/2019:09:33:46 +0000] "POST /webapp/kopano.php?subsystem=webapp_1558949606425 HTTP/1.1" 502 40 GATEWAY - - [27/May/2019:09:33:47 +0000] "GET /webapp/kopano.php?ping HTTP/1.1" 200 90 GATEWAY - - [27/May/2019:09:33:47 +0000] "POST /webapp/kopano.php?subsystem=webapp_1558949606425 HTTP/1.1" 502 40 GATEWAY - - [27/May/2019:09:33:48 +0000] "GET /webapp/kopano.php?ping HTTP/1.1" 200 90 GATEWAY - - [27/May/2019:09:33:48 +0000] "POST /webapp/kopano.php?subsystem=webapp_1558949606425 HTTP/1.1" 502 40 GATEWAY - - [27/May/2019:09:33:49 +0000] "GET /webapp/kopano.php?ping HTTP/1.1" 200 90 GATEWAY - - [27/May/2019:09:33:49 +0000] "POST /webapp/kopano.php?subsystem=webapp_1558949606425 HTTP/1.1" 502 40 GATEWAY - - [27/May/2019:09:33:50 +0000] "GET /webapp/kopano.php?ping HTTP/1.1" 200 90 GATEWAY - - [27/May/2019:09:33:51 +0000] "POST /webapp/kopano.php?subsystem=webapp_1558949606425 HTTP/1.1" 502 40 GATEWAY - - [27/May/2019:09:33:52 +0000] "GET /webapp/kopano.php?ping HTTP/1.1" 200 90 GATEWAY - - [27/May/2019:09:33:52 +0000] "POST /webapp/kopano.php?subsystem=webapp_1558949606425 HTTP/1.1" 502 40 GATEWAY - - [27/May/2019:09:33:53 +0000] "GET /webapp/kopano.php?ping HTTP/1.1" 200 90 GATEWAY - - [27/May/2019:09:33:53 +0000] "POST /webapp/kopano.php?subsystem=webapp_1558949606425 HTTP/1.1" 502 40 GATEWAY - - [27/May/2019:09:33:54 +0000] "GET /webapp/kopano.php?ping HTTP/1.1" 200 90 GATEWAY - - [27/May/2019:09:33:54 +0000] "POST /webapp/kopano.php?subsystem=webapp_1558949606425 HTTP/1.1" 502 40 GATEWAY - - [27/May/2019:09:33:55 +0000] "GET /webapp/kopano.php?ping HTTP/1.1" 200 90
-
@rothirschtech said in webapp/kopano.php?subsystem=webapp_1558940030903 502 Bad Gateway:
The problem still exists.
can you execute the following command to make sure that you are actually using the version you think you are using?
docker-compose exec kopano_webapp dpkg -l | grep php7-mapi
@rothirschtech said in webapp/kopano.php?subsystem=webapp_1558940030903 502 Bad Gateway:
After answering the mail, it looks like that the webapp tries to POST but gets a 502 response
Yes, this is because php-mapi is segfaulting. This causes a “bad gateway” for the webserver when it happens.
EDIT: when rebuilding the containers with the core:final repo you will not be able to start webapp because of a too old kwebd in that repo. the container will fail with
kopano_webapp | 2019/05/27 12:04:25 /etc/kweb.cfg:4 - Error during parsing: Unknown directive 'alias'
.I have triggered newer builds for kweb in pre-final and final so with the next Kopano update a newer kweb will be available there. Current plan is to push 8.7.3 to core:pre-final next week, then a week later to core:final.
EDIT2: when you go back to https://github.com/zokradonh/kopano-docker/commit/c5756e30c9170744abcd39aacd2c1121af6d893f#diff-b6920d9083c8e76685bcc8db34b8c9bb then you should be able to rebuild the webapp image (as it back then still used apache+mod_php and not kweb+php-fpm.
-
docker-compose exec kopano_webapp dpkg -l | grep php7-mapi ii php7-mapi 8.7.81.48.39 amd64 PHP bindings for MAPI
Oh your intention was right, after building and tagging the supported images again
make build-all make tag-core make tag-web make tag-webapp
and using this tags in .env the output is
php7-mapi 8.7.1.0-0+1.1 amd64 PHP binding
and everything works.
Big thanks
The most important part for me was that the supported packages will work. Now that they work again I will wait for the next Kopano update to test the opensource packages.
I love Kopano and together with docker it’s really flexible. Thanks for this project and the awesome work.
-
@rothirschtech said in webapp/kopano.php?subsystem=webapp_1558940030903 502 Bad Gateway:
Now that they work again I will wait for the next Kopano update to test the opensource packages.
Just to have it said: there is nothing as a “community edition” or “open source edition” what you refer to are simply nightly builds of our development branch. these have to pass a set of automated tests to be pushed to our download server. If you want to use this in a serious deployment the recommendation is to get a subscription (which will then also open up our support to you and your customer) and use our supported packages.