martialblog/docker-limesurvey

ckfinder not working - nginx error

le-zell opened this issue ยท 13 comments

using nginx + docker 5.4.10 version

When accessing to "browse the server" to upload images for example.

The page on URI : /third_party/kcfinder/browse.php?type=images&CKEditor=description_fr&CKEditorFuncNum=2&langCode=fr has missing js and css files witch are rendered by css/index.php and js/index.php files.

in logs we have nginx errors :

rewrite or internal redirection cycle while internally redirecting to "index.php"

maybe an nginx error configuration

Hi, could this be related to the issue #131 ? There also was some mentioning of the ckfinder plugin.

My first instinct is to thing about the BASE_URL and PUBLIC_URL parameters. However, there are also issues reported with the app not playing nicely with reverse proxies regardless of the parameters. Could be related.

Regards

Yes i think so.

It's maybe relative to a config parameter ''urlFormat' => 'path', witch shortcuts the URIs...don't know...

as a workaround i hacked third_party/kcfinder/tpl/tpl_browser.php and put <base href="/third_party/kcfinder/"> instead of <base href="<?= Yii::app()->request->getBaseUrl() ?>/">

I get a more fonctionnal webpage (with css/js resources). But the module is not working better...

There's probably a way to tell the Yii::app that it is running behind a proxy, so that the routing is handled correctly.

I cannot get it to work either.

The 500 error reported at the top of this issue seems to be an nginx server config issue. The nginx config file has a location ~ \.php$ {...} directive which contains the line try_files $uri /index.php. When I change this to try_files $uri /index.php?$args, the 500 error no longer occurs, but a 404 error occurs instead. And in my opinion this is the root of the problem:

Script /vendor/kcfinder/browse.php attempts to access the following files:

  • index.php
  • css.php
  • js_localize.php
  • js.php

All of these throw a 404 error, because browse.php references them in the root folder (example.com/), but in fact they reside in /vendor/kcfinder. It's not so much about the server domain, it's the path prefix that is missing.

I see this with @martialblog's LimeSurvey 6.x as well as 5.x images.

What puzzles me is that the LimeSurvey image by @adamzammit does not exhibit this behavior. I tried to find out what the differences are between the images by @martialblog and @adamzammit, but I was unable to see anything that might be relevant (e.g., different configuration or so).

This is what the 'ressources' page of a survey looks like in my browser with @martialblog 's image (the buttons are not functional):

image

And this is a screenshot of LimeSurvey running in a container based on @adamzammit's image (buttons are functional):

image

To summarize, there seems to be a directory issue with the kcfinder plugin in this image.

P.S. Here's a docker-compose.yml file that helps to quickly try out the two different images:

(expand)

services:

  adamzammit:
    image: adamzammit/limesurvey
    ports:
      - 127.0.0.1:9090:80
    environment:
      LIMESURVEY_DB_PASSWORD: example
      LIMESURVEY_ADMIN_USER: admin
      LIMESURVEY_ADMIN_PASSWORD: admin
      LIMESURVEY_ADMIN_NAME: Admin
      LIMESURVEY_ADMIN_EMAIL: admin@example.com
    depends_on:
      - mysql

  martialblog:
    image: docker.io/martialblog/limesurvey:latest
    environment:
      - DBENGINE=InnoDB
      - DB_TYPE=mysql
      - DB_HOST=mysql
      - DB_PASSWORD=example
      - DB_NAME=martialblog
      - DB_USERNAME=root
      - ADMIN_USER=admin
      - ADMIN_NAME=Admin
      - ADMIN_PASSWORD=admin
      - ADMIN_EMAIL=admin@example.com
      - PUBLIC_URL=foobar.com
    ports:
      - 127.0.0.1:9091:8080
    depends_on:
      - mysql

  mysql:
    image: mariadb
    environment:
      MYSQL_ROOT_PASSWORD: example

Start up these services in the usual way, invoke http://localhost:9090/admin and http://localhost:9091/admin, log in with admin/admin, quickly create new surveys, and go to the 'Resources' page to see whether ckfinder works or does not work.

I've never been able to figure out why one image works (with regard to this issue) and the other doesn't, despite diff'ing entire directory trees.

However, in case anyone else besides me experiences problems with this, I've forked @adamzammit's
limesurvey-docker repository and added Postgres support. In this container, the resources page works. I've created a PR on the original repository: adamzammit/limesurvey-docker#51

Works well on my server.

Hey there. Im still having the same issue with this. Using limesurvey 6.5 and i cant seem to browse the server.
image
This happens when i try to upload an image but the whole thing is not responding and the buttons are not doing anything. Is there a potential fix for this? Or is there any justification on why this is happening?

Issue still exists, unable to find a working solution. Have to use an other image :(

Adam Zammit's image works very well and since reporting this issue, we have introduced support for Postgres databases, if that is why you were using this one here. https://github.com/adamzammit/limesurvey-docker

Adam Zammit's image works very well and since reporting this issue, we have introduced support for Postgres databases, if that is why you were using this one here. https://github.com/adamzammit/limesurvey-docker

Hi, I have just tested it and I am running in the same error someone else already mentioned.

image
Used the latest image from adam

Well that's odd. I've had some very "interesting" issues with stray/dangling Docker volumes in the past, maybe you want to double-check that you really start your container from scratch? Just an idea. Or try my docker-compose.yml file that I posted above and see if that makes a difference or not.

Used your docker-compose-yml and facing the issue for martialblog
from above:

image

and the one I have provided yesterday from adam

@jonas-kiesewetter That's too bad, I'm afraid I do not have enough Docker karma to solve this... The docker-compose.yml file still works well on my end (as does my production system), so it makes me wonder whether there is something specific to your server or workstation (Docker version???) that interferes with it. Do you have other hardware to try this on, by any chance?