Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

[BUG] Pagination does not work #66

Closed
asawatzki opened this issue Jan 15, 2020 · 9 comments
Closed

[BUG] Pagination does not work #66

asawatzki opened this issue Jan 15, 2020 · 9 comments

Comments

@asawatzki
Copy link

asawatzki commented Jan 15, 2020

Describe the bug
The pagination does not work.

To Reproduce
Steps to reproduce the behaviour:

  1. clone repo
  2. change kimai version from 1.5 to 1.6
  3. run docker-compose
  4. add more than 51 activities to generate a button for page 2
  5. click button to change to page 2
  6. error: page does not change

Desktop (please complete the following information):

  • OS: Windows 10 Pro
  • Docker version 19.03.5, build 633a0ea
  • Docker compose version: 1.24.1, build 4667896b

Command used to run the container

  • docker-compose up -d

Docker compose file (with passwords redacted)

version: '3.5'
services:

  sqldb:
    image: mysql:5.7
    environment:
      - MYSQL_DATABASE=kimai
      - MYSQL_USER=kimaiuser
      - MYSQL_PASSWORD=kimaipassword
      - MYSQL_ROOT_PASSWORD=changemeplease
    volumes:
      - /var/lib/mysql
    command: --default-storage-engine innodb
    restart: unless-stopped
    healthcheck:
      test: mysqladmin -pchangemeplease ping -h localhost
      interval: 20s
      start_period: 10s
      timeout: 10s
      retries: 3 

  nginx:
    build: compose
    ports:
      - 8001:80
    volumes:
      - ./nginx_site.conf:/etc/nginx/conf.d/default.conf
    restart: unless-stopped
    depends_on:
      - kimai
    volumes:
      - public:/opt/kimai/public
    healthcheck:
      test:  wget --spider http://nginx/health || exit 1 
      interval: 20s
      start_period: 10s
      timeout: 10s
      retries: 3 

  kimai:
    image: kimai/kimai2:fpm-alpine-1.6-prod
    environment:
      - APP_ENV=prod
      - TRUSTED_HOSTS=localhost
      - ADMINMAIL=admin@kimai.local
      - ADMINPASS=changemeplease
    volumes:
      - public:/opt/kimai/public
      - var:/opt/kimai/var
    restart: unless-stopped
    healthcheck:
      test: wget --spider http://nginx || exit 1
      interval: 20s
      start_period: 10s
      timeout: 10s
      retries: 3

  postfix:
    image: catatnight/postfix
    environment:
      maildomain: neontribe.co.uk
      smtp_user: kimai:kimai
    restart: unless-stopped
    restart: always

volumes:
    var:
    public:

Additional context
Changing the page via URL works like a charm:
http://localhost:8001/en/admin/activity/page/2

Am I missing some configuration?

@kevinpapst
Copy link
Collaborator

Anything inside the javascript console of your browser?
What does the network tab say? Is there a request going out and what is the response?

@asawatzki
Copy link
Author

asawatzki commented Jan 15, 2020

The js console is empty.
In the network tab is one event:

request headers

GET /en/admin/activity/?globalsOnly=0&visibility=1&pageSize=50&page=2&order=ASC&orderBy=name HTTP/1.1
Host: localhost:8001
Connection: keep-alive
Accept: */*
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Referer: http://localhost:8001/en/admin/activity/
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,de;q=0.8
Cookie: PHPSESSID=63be660fa8f96d0d50bbaf51d00dcd00

response headers

HTTP/1.1 200 OK
Server: nginx/1.17.7
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/7.3.10
Cache-Control: max-age=0, must-revalidate, private
Date: Wed, 15 Jan 2020 11:26:12 GMT
Expires: Wed, 15 Jan 2020 11:26:12 GMT

EDIT:
formatted some stuff

@kevinpapst
Copy link
Collaborator

Do the regular search filters work? Most of the search forms use GET params as well...

@asawatzki
Copy link
Author

Unfortunately not. Neither the sorting nor the search works.
The js console is still empty.
In the network tab appears many event (mostly documents like svg, woff2, etc) and these two:

request

GET /en/admin/activity/?searchTerm=&customer=&project=&globalsOnly=0&visibility=1&pageSize=10&page=1&order=DESC&orderBy=name HTTP/1.1
Host: localhost:8001
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36
Sec-Fetch-User: ?1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Referer: http://localhost:8001/en/admin/activity/?searchTerm=&customer=&project=&globalsOnly=0&visibility=2&pageSize=50&page=1&order=ASC&orderBy=name
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,de;q=0.8
Cookie: PHPSESSID=b7a67967bc01d1ff7d7a9e606e6b4a30

response

HTTP/1.1 200 OK
Server: nginx/1.17.7
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/7.3.10
Cache-Control: max-age=0, must-revalidate, private
Date: Wed, 15 Jan 2020 12:36:51 GMT
Expires: Wed, 15 Jan 2020 12:36:51 GMT

and:
request

GET /api/timesheets/recent?size=10 HTTP/1.1
Host: localhost:8001
Connection: keep-alive
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
X-AUTH-SESSION: true
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36
Content-Type: application/json
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Referer: http://localhost:8001/en/admin/activity/?searchTerm=&customer=&project=&globalsOnly=0&visibility=1&pageSize=10&page=1&order=DESC&orderBy=name
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,de;q=0.8
Cookie: PHPSESSID=b7a67967bc01d1ff7d7a9e606e6b4a30

response

HTTP/1.1 200 OK
Server: nginx/1.17.7
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/7.3.10
Cache-Control: max-age=0, must-revalidate, private
Date: Wed, 15 Jan 2020 12:36:52 GMT
Expires: Wed, 15 Jan 2020 12:36:52 GMT

@kevinpapst
Copy link
Collaborator

kevinpapst commented Jan 15, 2020

Thanks @asawatzki for the feedback.
This is a very likely a configuration issue in nginx.
There was recently a user in the Kimai issue tracker who had a similar problem.
I couldn't find the issue quickly, but it was in the last 14 days.

@tobybatch and @Schrolli91 he mentioned that the GET params weren't passed to PHP/Symfony. I can only assume, but maybe an issue with the fastcgi params definition. He found a solution in the Symfony docs, probably the webserver setup section

@asawatzki
Copy link
Author

You are very welcome. Let me know if you need more support.

@tobybatch
Copy link
Owner

Duplicate #61

@heeen
Copy link

heeen commented Feb 11, 2020

I have this issue but I can't get it to work. The nginx site config does not represent the file form the repo:

/srv/kimai2# docker exec kimai2_nginx_1 grep try_files /etc/nginx/conf.d/default.conf
        try_files $uri $uri/ /index.php;
/srv/kimai2# grep try_files compose/nginx_site.conf 
        try_files $uri $uri/ /index.php$is_args$args;

I tried docker-compose stop, docker-compose rm, docker system purge --volumes, nothing makes it update

@tobybatch
Copy link
Owner

@heeen Can you open a fresh issue please? We need information about which images you are using etc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants