You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@guacamole.apache.org by "Mike Jumper (Jira)" <ji...@apache.org> on 2020/07/02 18:53:00 UTC

[jira] [Reopened] (GUACAMOLE-942) MySQL JDBC contains an invalid SQL Query (no RDP Start possible)

     [ https://issues.apache.org/jira/browse/GUACAMOLE-942?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Jumper reopened GUACAMOLE-942:
-----------------------------------

A customer at my day job just reported an occurrence of this issue. It looks like it is indeed possible for this to occur, but it's unclear how.

There is only one location where this might happen (noted above), and I don't yet see what would cause the set of identifiers to be empty there:

https://github.com/apache/guacamole-client/blob/475d9419cc727b59a0be50903c2c3510565e3488/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/AbstractGuacamoleTunnelService.java#L641-L644

That said, I do have some information that might be helpful:

* Manually forcing the set of identifiers to be empty, establishing a connection is not blocked. So long as the connection is correct, it works just fine, and the error has no user-visible effect.
* Given that the connection still succeeds despite the error, it seems likely that it is the connection failure that produces the circumstances for the empty set (and not the error itself causing the connection failure).

> MySQL JDBC contains an invalid SQL Query (no RDP Start possible)
> ----------------------------------------------------------------
>
>                 Key: GUACAMOLE-942
>                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-942
>             Project: Guacamole
>          Issue Type: Bug
>          Components: guacamole-auth-jdbc-mysql
>    Affects Versions: 1.1.0
>         Environment: CentOS 8
> Tomcat 9.0.30
> Guacamole 1.1.0, freshly upgraded from 0.9.14. 
> LDAP backend
> JDBC MySQL connector 5.1.46 to MariaDB.
>            Reporter: Stefan Bluhm
>            Priority: Major
>         Attachments: catalina.zip
>
>
> After logging in and selecting an RDP connection, the connection fails with:
>  
> "The remote desktop server is currently not unreachable."...
>  
> The catalona.out log shows the following error:
> {code:none}
> 17:02:02.435 [http-nio-8080-exec-3] ERROR o.a.g.rest.RESTExceptionMapper - Unexpected internal error: 
> ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND 
>  (
>  guacamole_connection_permission.entity_id = 7
>  ' at line 19
> ### The error may exist in org/apache/guacamole/auth/jdbc/connection/ConnectionMapper.xml
> ### The error may involve defaultParameterMap
> ### The error occurred while setting parameters
> ### SQL: SELECT guacamole_connection.connection_id, guacamole_connection.connection_name, parent_id, protocol, max_connections, max_connections_per_user, proxy_hostname, proxy_port, proxy_encryption_method, connection_weight, failover_only, MAX(start_date) AS last_active FROM guacamole_connection JOIN guacamole_connection_permission ON guacamole_connection_permission.connection_id = guacamole_connection.connection_id LEFT JOIN guacamole_connection_history ON guacamole_connection_history.connection_id = guacamole_connection.connection_id WHERE guacamole_connection.connection_id IN AND ( guacamole_connection_permission.entity_id = ? ) AND permission = 'READ' GROUP BY guacamole_connection.connection_id; SELECT primary_connection_id, guacamole_sharing_profile.sharing_profile_id FROM guacamole_sharing_profile JOIN guacamole_sharing_profile_permission ON guacamole_sharing_profile_permission.sharing_profile_id = guacamole_sharing_profile.sharing_profile_id WHERE primary_connection_id IN AND ( entity_id = ? ) AND permission = 'READ'; SELECT guacamole_connection_attribute.connection_id, attribute_name, attribute_value FROM guacamole_connection_attribute JOIN guacamole_connection_permission ON guacamole_connection_permission.connection_id = guacamole_connection_attribute.connection_id WHERE guacamole_connection_attribute.connection_id IN AND ( entity_id = ? ) AND permission = 'READ';
> ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND 
>  (
>  guacamole_connection_permission.entity_id = 7
>  ' at line 19
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)