lemberg / connfa-integration-server

Connfa CMS & Integration Server
Apache License 2.0
31 stars 43 forks source link

Integration server producing empty responses on all requests after updateSchedule #27

Closed alikuru closed 6 years ago

alikuru commented 6 years ago

I'm preparing a Connfa setup for our event and today I noticed the app is not properly updating personal schedules. After digging into the logs, found that the problem was my web server; it was responding updateSchedule requests coming from app with 501 -not implemented. Configured the server with necessary settings to support PUT requests, issue fixed and I saw at the logs that my server started to respond with 204 to the updateSchedule calls.

However, when I turn back to the web interface of the integration server, it saw that it's returning empty responses to every request. This is what I get when I try to view the back-end, on a blank page:

{"data":[]}

Also, as you might have already guessed, app started to crash immediately at the splash screen after this.

Any ideas how to fix it? Couldn't find anything at the logs. Thought it might be related to schedules and removed all data from schedules and schedule_event tables but it didn't help.

alikuru commented 6 years ago

Found something rather interesting while trying to figure out what's happening. Apparently API calls made to updateSchedule are changing the contents of the index.php on the server side. It basically overwrites it with the JSON data containing the update, i.e. {"data":[1,4,3]}.

Could this be happening because of a missing rewrite rule? Are there any specific rules needed for the integration server?

alikuru commented 6 years ago

Since I couldn't find anything even similar to this problem with googling, I suspect that the issue might be specific to my server setup (Hiawatha v10.6, PHP 7.0.19-1, MariaDB 10.1.26 on Debian 9.1).

To be sure, I cloned my the integration server to another server, which has a more generic setup: nginx 1.10.1 (compiled with --with-http_dav_module), PHP 5.6.29, MariaDB 5.5.46 on Debian 8.6 with DirectAdmin. This is the nginx config I'm using to enable PUT requests:

location / {
        try_files $uri $uri/ /index.php?$query_string;
        dav_methods put;
        client_body_temp_path /path/to/public/temp;
        create_full_put_path on;
        client_max_body_size 0;
        dav_access user:rw group:rw all:rw;
}

This time I'm getting 444 responses for updateSchedule requests, which seems weird considering the relaxed dav settings on my config.

I wonder whether the issue will replicate on nginx, appreciate if you can share your suggested config.

alikuru commented 6 years ago

Tried another server with nginx and it seems like working. So, I assume problem was related to my initial setup with Hiawatha.

Sorry for troubling, closing.