[SOLVED] Cant connect from desktop client to instance, keeps looping "connect account" page

Hi! I’m able to use my nextcloud instance from web, but can’t connect through desktop client! After clicking next after writing server host, I’m redirected to Connect to your account, I put my credentials there, then I get redirected to Account access, then keeps looping Connect to your account then Account access and so on and never connects!

Client version: 2.5.1git, using Ubuntu desktop 18.04

I’m using an external MariaDB server on my host, configuration went just fine, and I started the instance with this docker-compose.yml file:

version: '2'

services:
  web:
    image: nextcloud:stable-apache
    restart: always
    hostname: 'cloud.mgscreativa.com.ar'
    container_name: nextcloud
    ports:
    - "3080:80"
    volumes:
    - /media/data/nextcloud/data/html:/var/www/html
    - /media/data/nextcloud/data/apps:/var/www/html/custom_apps
    - /media/data/nextcloud/data/config:/var/www/html/config
    - /media/data/nextcloud/data/cloud_data:/var/www/html/data

I’m using apache server as proxy with this config:

# NextCloud pass connections to docker
<Proxy />
    Allow from localhost
</Proxy>

ProxyPreserveHost On
ProxyPass /.well-known/acme-challenge/ !
ProxyPass / http://lucas.mgscreativa.com.ar:3080/
ProxyPassReverse / http://lucas.mgscreativa.com.ar:3080/

When using my iOS client I get

Error
Access Forbidden
Invalid Request

I have taken a screenshot

I have raised debuglevel to 0. This is the debug log

{“reqId”:“2NC1ZbDTv9K9lf7r6RmM”,“level”:0,“time”:“2019-03-07T21:09:52-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/index.php/login/flow",“message”:“Scss is disabled for /var/www/html/core/css/jquery-ui-fixes.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}

{“reqId”:“2NC1ZbDTv9K9lf7r6RmM”,“level”:0,“time”:“2019-03-07T21:09:52-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/index.php/login/flow",“message”:“Scss is disabled for /var/www/html/core/css/server.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“2NC1ZbDTv9K9lf7r6RmM”,“level”:0,“time”:“2019-03-07T21:09:52-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/index.php/login/flow",“message”:“Scss is disabled for /var/www/html/core/css/css-variables.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“2NC1ZbDTv9K9lf7r6RmM”,“level”:0,“time”:“2019-03-07T21:09:52-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/index.php/login/flow",“message”:“Scss is disabled for /var/www/html/apps/firstrunwizard/css/firstrunwizard.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“2NC1ZbDTv9K9lf7r6RmM”,“level”:0,“time”:“2019-03-07T21:09:52-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/index.php/login/flow",“message”:“Scss is disabled for /var/www/html/core/css/jquery.ocdialog.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“2NC1ZbDTv9K9lf7r6RmM”,“level”:0,“time”:“2019-03-07T21:09:52-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/index.php/login/flow",“message”:“Scss is disabled for /var/www/html/core/search/css/results.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“j34grcnIwxU07jtKJxIz”,“level”:0,“time”:“2019-03-07T21:09:53-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“no app in context”,“method”:“GET”,“url”:"/core/js/oc.js?v=c6d74562",“message”:“No cache entry found for /appdata_ock1b8qb3rn9/theming/images (storage: local::/var/www/html/data/, internalPath: appdata_ock1b8qb3rn9/theming/images)”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“j34grcnIwxU07jtKJxIz”,“level”:0,“time”:“2019-03-07T21:09:53-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“no app in context”,“method”:“GET”,“url”:"/core/js/oc.js?v=c6d74562",“message”:“No cache entry found for /appdata_ock1b8qb3rn9/theming/images (storage: local::/var/www/html/data/, internalPath: appdata_ock1b8qb3rn9/theming/images)”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“j34grcnIwxU07jtKJxIz”,“level”:0,“time”:“2019-03-07T21:09:53-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“no app in context”,“method”:“GET”,“url”:"/core/js/oc.js?v=c6d74562",“message”:“No cache entry found for /appdata_ock1b8qb3rn9/theming/images (storage: local::/var/www/html/data/, internalPath: appdata_ock1b8qb3rn9/theming/images)”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“GQr40ExgUXg0r5sYfnjT”,“level”:0,“time”:“2019-03-07T21:10:15-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/login/flow/grant?clientIdentifier=&stateToken=5wAMux8bg3yO8t2briAnG4LIYjAyhDQ3iysf6aBUT1IHPCq7oqmfgY1r2T9rlufF",“message”:“Scss is disabled for /var/www/html/core/css/jquery-ui-fixes.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“GQr40ExgUXg0r5sYfnjT”,“level”:0,“time”:“2019-03-07T21:10:15-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/login/flow/grant?clientIdentifier=&stateToken=5wAMux8bg3yO8t2briAnG4LIYjAyhDQ3iysf6aBUT1IHPCq7oqmfgY1r2T9rlufF",“message”:“Scss is disabled for /var/www/html/core/css/server.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“GQr40ExgUXg0r5sYfnjT”,“level”:0,“time”:“2019-03-07T21:10:15-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/login/flow/grant?clientIdentifier=&stateToken=5wAMux8bg3yO8t2briAnG4LIYjAyhDQ3iysf6aBUT1IHPCq7oqmfgY1r2T9rlufF",“message”:“Scss is disabled for /var/www/html/core/css/css-variables.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“GQr40ExgUXg0r5sYfnjT”,“level”:0,“time”:“2019-03-07T21:10:15-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/login/flow/grant?clientIdentifier=&stateToken=5wAMux8bg3yO8t2briAnG4LIYjAyhDQ3iysf6aBUT1IHPCq7oqmfgY1r2T9rlufF",“message”:“Scss is disabled for /var/www/html/apps/firstrunwizard/css/firstrunwizard.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“GQr40ExgUXg0r5sYfnjT”,“level”:0,“time”:“2019-03-07T21:10:15-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/login/flow/grant?clientIdentifier=&stateToken=5wAMux8bg3yO8t2briAnG4LIYjAyhDQ3iysf6aBUT1IHPCq7oqmfgY1r2T9rlufF",“message”:“Scss is disabled for /var/www/html/core/css/jquery.ocdialog.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“GQr40ExgUXg0r5sYfnjT”,“level”:0,“time”:“2019-03-07T21:10:15-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/login/flow/grant?clientIdentifier=&stateToken=5wAMux8bg3yO8t2briAnG4LIYjAyhDQ3iysf6aBUT1IHPCq7oqmfgY1r2T9rlufF",“message”:“Scss is disabled for /var/www/html/core/search/css/results.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“CONs0EEx4VaUJTOPDSuL”,“level”:0,“time”:“2019-03-07T21:10:16-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“no app in context”,“method”:“GET”,“url”:"/core/js/oc.js?v=c6d74562",“message”:“No cache entry found for /appdata_ock1b8qb3rn9/theming/images (storage: local::/var/www/html/data/, internalPath: appdata_ock1b8qb3rn9/theming/images)”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“CONs0EEx4VaUJTOPDSuL”,“level”:0,“time”:“2019-03-07T21:10:16-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“no app in context”,“method”:“GET”,“url”:"/core/js/oc.js?v=c6d74562",“message”:“No cache entry found for /appdata_ock1b8qb3rn9/theming/images (storage: local::/var/www/html/data/, internalPath: appdata_ock1b8qb3rn9/theming/images)”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“CONs0EEx4VaUJTOPDSuL”,“level”:0,“time”:“2019-03-07T21:10:16-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“no app in context”,“method”:“GET”,“url”:"/core/js/oc.js?v=c6d74562",“message”:“No cache entry found for /appdata_ock1b8qb3rn9/theming/images (storage: local::/var/www/html/data/, internalPath: appdata_ock1b8qb3rn9/theming/images)”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“nkm1gkz3nTAWRhCIphEs”,“level”:0,“time”:“2019-03-07T21:10:37-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/login/flow",“message”:“Scss is disabled for /var/www/html/core/css/jquery-ui-fixes.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“nkm1gkz3nTAWRhCIphEs”,“level”:0,“time”:“2019-03-07T21:10:37-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/login/flow",“message”:“Scss is disabled for /var/www/html/core/css/server.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“nkm1gkz3nTAWRhCIphEs”,“level”:0,“time”:“2019-03-07T21:10:37-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/login/flow",“message”:“Scss is disabled for /var/www/html/core/css/css-variables.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“nkm1gkz3nTAWRhCIphEs”,“level”:0,“time”:“2019-03-07T21:10:37-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/login/flow",“message”:“Scss is disabled for /var/www/html/apps/firstrunwizard/css/firstrunwizard.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“nkm1gkz3nTAWRhCIphEs”,“level”:0,“time”:“2019-03-07T21:10:37-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/login/flow",“message”:“Scss is disabled for /var/www/html/core/css/jquery.ocdialog.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“nkm1gkz3nTAWRhCIphEs”,“level”:0,“time”:“2019-03-07T21:10:37-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“core”,“method”:“GET”,“url”:"/login/flow",“message”:“Scss is disabled for /var/www/html/core/search/css/results.scss, ignoring”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“vNwC6AUXEBICJvntquYk”,“level”:0,“time”:“2019-03-07T21:10:38-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“no app in context”,“method”:“GET”,“url”:"/core/js/oc.js?v=c6d74562",“message”:“No cache entry found for /appdata_ock1b8qb3rn9/theming/images (storage: local::/var/www/html/data/, internalPath: appdata_ock1b8qb3rn9/theming/images)”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“vNwC6AUXEBICJvntquYk”,“level”:0,“time”:“2019-03-07T21:10:38-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“no app in context”,“method”:“GET”,“url”:"/core/js/oc.js?v=c6d74562",“message”:“No cache entry found for /appdata_ock1b8qb3rn9/theming/images (storage: local::/var/www/html/data/, internalPath: appdata_ock1b8qb3rn9/theming/images)”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“vNwC6AUXEBICJvntquYk”,“level”:0,“time”:“2019-03-07T21:10:38-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“no app in context”,“method”:“GET”,“url”:"/core/js/oc.js?v=c6d74562",“message”:“No cache entry found for /appdata_ock1b8qb3rn9/theming/images (storage: local::/var/www/html/data/, internalPath: appdata_ock1b8qb3rn9/theming/images)”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.23.1”,“version”:“15.0.5.3”}
{“reqId”:“f0uvLJanm9LUBfYubZvt”,“level”:0,“time”:“2019-03-07T21:11:27-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“no app in context”,“method”:“GET”,“url”:"/settings/admin/logging",“message”:“No cache entry found for /appdata_ock1b8qb3rn9/avatar/martinb/avatar.jpg (storage: local::/var/www/html/data/, internalPath: appdata_ock1b8qb3rn9/avatar/martinb/avatar.jpg)”,“userAgent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0”,“version”:“15.0.5.3”}
{“reqId”:“f0uvLJanm9LUBfYubZvt”,“level”:0,“time”:“2019-03-07T21:11:27-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“no app in context”,“method”:“GET”,“url”:"/settings/admin/logging",“message”:“No cache entry found for /appdata_ock1b8qb3rn9/theming/images (storage: local::/var/www/html/data/, internalPath: appdata_ock1b8qb3rn9/theming/images)”,“userAgent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0”,“version”:“15.0.5.3”}
{“reqId”:“f0uvLJanm9LUBfYubZvt”,“level”:0,“time”:“2019-03-07T21:11:27-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“no app in context”,“method”:“GET”,“url”:"/settings/admin/logging",“message”:“No cache entry found for /appdata_ock1b8qb3rn9/theming/images (storage: local::/var/www/html/data/, internalPath: appdata_ock1b8qb3rn9/theming/images)”,“userAgent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0”,“version”:“15.0.5.3”}
{“reqId”:“f0uvLJanm9LUBfYubZvt”,“level”:0,“time”:“2019-03-07T21:11:27-03:00”,“remoteAddr”:“10.0.0.77”,“user”:“martinb”,“app”:“no app in context”,“method”:“GET”,“url”:"/settings/admin/logging",“message”:“No cache entry found for /appdata_ock1b8qb3rn9/theming/images (storage: local::/var/www/html/data/, internalPath: appdata_ock1b8qb3rn9/theming/images)”,“userAgent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0”,“version”:“15.0.5.3”}

Thanks in advise!

Got it working, more info here Stuck in a login loop when logging in from sync client on Linux