uvdesk / community-skeleton

UVdesk Opensource Community Helpdesk Project built for all to make a Full Ticketing Support System along with many more other features.
https://www.uvdesk.com
Open Software License 3.0
8.96k stars 463 forks source link

Doctrine\ORM\Query\QueryException at multiple classes #232

Closed unclego closed 4 years ago

unclego commented 4 years ago

Description
All menus in USERS section not working (Groups, Teams, Agents, Customers, privileges) not working.

How to reproduce

Fresh manual install on Centos 7. php 7.3.12 from https://cdn.uvdesk.com/uvdesk/downloads/opensource/uvdesk-community-current-stable.zip

Unzip archive into nginx webroot. Add this lines to webserver config

    location / {
        try_files $uri /public$uri @index;
    }
    location @index {
        rewrite ^/(.*)$ /index.php?url=$1 last;
    }

    location ~ \.php$ {
        try_files $uri /public$uri =404;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

Naviagte to public folder and configure uvdesc.

Try any menu in in USERS section

Additional context
Erros in log.

request.CRITICAL: Uncaught PHP Exception Doctrine\ORM\Query\QueryException: "[Semantical Error] ......

Error: Class Webkul\UVDesk\CoreFrameworkBundle\Entity\SupportPrivilege has no field or association named url

Error: Class Webkul\UVDesk\CoreFrameworkBundle\Entity\User has no field or association named url

Error: Class Webkul\UVDesk\CoreFrameworkBundle\Entity\SupportGroup has no field or association named url

Error: Class Webkul\UVDesk\CoreFrameworkBundle\Entity\SupportTeam has no field or association named url

etc. etc.

vaishaliwebkul commented 4 years ago

Hello unclego, Could you please elaborate more steps to reproduce this issue?

unclego commented 4 years ago

Well one more thing wich can probably help. It's nginx webserver. I have some troubles before i was able to start uvdesk. I cant find exmaple config for nginx in documentation, so i finished with this configuration

    location / {
        try_files $uri /public$uri @index;
    }
    location @index {
        rewrite ^/(.*)$ /index.php?url=$1 last;
    }

    location ~ \.php$ {
        #try_files $uri =404;
        try_files $uri /public$uri =404;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
refueledinc commented 4 years ago

I'm having a similar issue, but with Apache.

Page returns 500 error for XHR.

request.CRITICAL: Uncaught PHP Exception Doctrine\ORM\Query\QueryException: "[Syntax Error] line 0, col 208: Error: Expected Doctrine\ORM\Query\Lexer::T_IDENTIFIER, got '/'" at /uvdesk/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php line 54 {"exception":"[object] (Doctrine\\ORM\\Query\\QueryException(code: 0): [Syntax Error] line 0, col 208: Error: Expected Doctrine\\ORM\\Query\\Lexer::T_IDENTIFIER, got '/' at /uvdesk/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:54, Doctrine\\ORM\\Query\\QueryException(code: 0): SELECT COUNT (DISTINCT user.id) FROM UVDeskCoreFrameworkBundle:User user LEFT JOIN user.userInstance userInstance LEFT JOIN userInstance.supportRole supportRole WHERE supportRole.id != :customerRole AND user./en/member/agents/xhr = :/en/member/agents/xhr ORDER BY userInstance.createdAt DESC at /uvdesk/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:43)"} []

Any ideas as to a fix?

papnoisanjeev commented 4 years ago

@refueledinc Please elaborate more steps to reproduce this issue.

You can also create a support ticket https://support.uvdesk.com/en/customer/create-ticket/ here for better communication.

refueledinc commented 4 years ago

There's not much else I can provide you.

I simply installed the open source version, went to the dashboard and click on any of the links under the users sections and I get a loading icon with an XHR error of 500 when inspecting the page

papnoisanjeev commented 4 years ago

@refueledinc

Show your config files and provide us the log var->log->dev.log and var->log->prod.log files.

papnoisanjeev commented 4 years ago

@unclego
try this in your config remove url after index.php *location @index { rewrite ^/(.)$ /index.php?$1 last; }**

imadmoqaddem commented 4 years ago

Hi, I probably have the same problem as @refueledinc . After a fresh install today on Debian 10, PHP 7.3.11, Apache2.4.38, via composer, I have several Doctrine errors on users' menus :

Doctrine\ORM\Query\QueryException
SELECT COUNT (DISTINCT user.id) FROM UVDeskCoreFrameworkBundle:User user LEFT JOIN user.userInstance userInstance LEFT JOIN userInstance.supportRole supportRole WHERE supportRole.id != :customerRole AND user./en/member/agents/xhr = :/en/member/agents/xhr ORDER BY userInstance.createdAt DESC

Please find the dev.log file attached.

NB : same behavior with page Saved Replies (/en/member/saved-replies)

Thank you for your help dev.log

unclego commented 4 years ago

@papnoisanjeev

Now i got a different error

request.CRITICAL: Uncaught PHP Exception Doctrine\ORM\Query\QueryException: "[Syntax Error] line 0, col 218: Error: Expected Literal, got 'member'" at .../vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php line 54 {"exception":"[object] (Doctrine\\ORM\\Query\\QueryException(code: 0): [Syntax Error] line 0, col 218: Error: Expected Literal, got 'member' at .../vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:54, Doctrine\\ORM\\Query\\QueryException(code: 0): SELECT COUNT (DISTINCT user.id) FROM UVDeskCoreFrameworkBundle:User user LEFT JOIN user.userInstance userInstance LEFT JOIN userInstance.supportRole supportRole WHERE supportRole.id != :customerRole AND user.public/en/member/agents/xhr = :public/en/member/agents/xhr ORDER BY userInstance.createdAt DESC at .../vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:43)"} []

akshaywebkul commented 4 years ago

The most likely culprit is faulty nginx configuration, that is the request url parameters aren't being resolved correctly.

@unclego , our team is now able to reproduce this new error you're getting so we'll try debug this issue and get back to you shortly.

papnoisanjeev commented 4 years ago

@imadmoqaddem @unclego @refueledinc @vaishaliwebkul Please update your .htaccess file.

Open your project, go to public->.htaccess Open .htaccess and remove ? after index.php.

htaccessNew

And finally clear your project cache by: php bin/console c:c

unclego commented 4 years ago

@papnoisanjeev

Please update your .htaccess file.

Open your project, go to public->.htaccess Open .htaccess and remove ? after index.php.

This doesn't work on nginx. If i replace rewrite ^/(.*)$ /index.php?$1 last; with rewrite ^/(.*)$ /index.php$1 last; i got this error *5 rewrite or internal redirection cycle while redirect to named location "@index"

papnoisanjeev commented 4 years ago

@unclego This fix is basically for Apache we have not tested it for nginx but for sure we will test it for nginx too and will let you know.

unclego commented 4 years ago

I fixed this using symfony nginx minimum configuration

IMHO nginx part of documentation need some work.