[ 
https://issues.apache.org/jira/browse/GUACAMOLE-777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16821028#comment-16821028
 ] 

Nick Couchman edited comment on GUACAMOLE-777 at 4/18/19 12:30 PM:
-------------------------------------------------------------------

A couple of notes for you.  First, regarding your issue with PostgreSQL 
specifically, the documentation on upgrading the DB has a note labeled 
"Important" that details exactly the issue you're seeing with the upgrade 
process:

http://guacamole.apache.org/doc/gug/jdbc-auth.html#idm46248438612160

Second, at a higher level, the process of granting permissions to tables is not 
handled within the schema scripts - either initial install or upgrade - 
provided with Guacamole.  The biggest reason for this is that we don't make any 
assumptions about what user account is going to be used to access the database. 
 We provide an example in the documentation, but that's up to you to set, and 
thus we don't provide that in any of the scripts.

As this relates to Docker installs, we don't do much with the DB specifically 
for Guacamole within the Docker scripts or images.  We configure the 
guacamole.properties entries, and provide the output of the script needed to 
create the database, but that's about it - even with a Docker install, it's 
still up to you to maintain the database, including schema updates and 
permissions management, as documented in the manual.

Finally, I can see one potential improvement out of this - it may be worthwhile 
to provide a schema version within the database and the database modules that 
can be checked between the two and provide some more friendly error messages 
when things don't match up.  I'm not sure this would have helped you in this 
situation, as it was a permissions issue and not a schema issue, but it seems 
schema mis-match comes up with enough frequency that this could be improved a 
bit.


was (Author: [email protected]):
A couple of notes for you.  First, regarding your issue with PostgreSQL 
specifically, the documentation on upgrading the DB has a note labeled 
"Important" that details exactly the issue you're seeing with the upgrade 
process:

http://guacamole.apache.org/doc/gug/jdbc-auth.html#idm46248438612160

> Schema upgrade does not alter table permissions
> -----------------------------------------------
>
>                 Key: GUACAMOLE-777
>                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-777
>             Project: Guacamole
>          Issue Type: Bug
>          Components: guacamole
>    Affects Versions: 1.0.0
>            Reporter: Don
>            Priority: Minor
>
> When pulling a newer guacamole  images from guacamole/guacamole:latest upon 
> restart there is a critical DB error.
>  
> {{18-Apr-2019 09:08:16.895 INFO [main] 
> org.apache.catalina.startup.Catalina.start Server startup in 4397 ms}}
> {{09:09:04.896 [http-nio-8080-exec-4] ERROR o.a.g.rest.RESTExceptionMapper - 
> Unexpected internal error: }}
> {{### Error querying database.  Cause: org.postgresql.util.PSQLException: 
> ERROR: relation "guacamole_entity" does not exist}}
> {{  Position: 571}}
> {{### The error may exist in 
> org/apache/guacamole/auth/jdbc/user/UserMapper.xml}}
> {{### The error may involve defaultParameterMap}}
> {{### The error occurred while setting parameters}}
> {{### SQL: SELECT             guacamole_user.user_id,             
> guacamole_entity.entity_id,             guacamole_entity.name,             
> password_hash,             password_salt,             password_date,          
>    disabled,             expired,             access_window_start,            
>  access_window_end,             valid_from,             valid_until,          
>    timezone,             full_name,             email_address,             
> organization,             organizational_role,             MAX(start_date) AS 
> last_active         FROM guacamole_user         JOIN guacamole_entity ON 
> guacamole_user.entity_id = guacamole_entity.entity_id         LEFT JOIN 
> guacamole_user_history ON guacamole_user_history.user_id = 
> guacamole_user.user_id         WHERE             guacamole_entity.name = ?    
>          AND guacamole_entity.type = 'USER'::guacamole_entity_type         
> GROUP BY guacamole_user.user_id, guacamole_entity.entity_id;          SELECT  
>            guacamole_user_attribute.user_id,             
> guacamole_user_attribute.attribute_name,             
> guacamole_user_attribute.attribute_value         FROM 
> guacamole_user_attribute         JOIN guacamole_user ON 
> guacamole_user.user_id = guacamole_user_attribute.user_id         JOIN 
> guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id     
>     WHERE             guacamole_entity.name = ?             AND 
> guacamole_entity.type = 'USER'::guacamole_entity_type}}
> {{### Cause: org.postgresql.util.PSQLException: ERROR: relation 
> "guacamole_entity" does not exist}}
> {{  Position: 571}}
>  
>  
>  
> There ought to be some sort of sanity check when upgrading the DB schema.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to