You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by Andy Pattrick <an...@horiba.com> on 2016/09/22 14:36:40 UTC

Apply theme extension to docker container

Hi,



I'm trying to apply the example theme extension jar from this thread https://sourceforge.net/p/guacamole/discussion/1110834/thread/be2a6785/ to my running guacamole docker container. This is to customise the logo and title etc as supported by https://glyptodon.org/jira/browse/GUAC-587



I copy the example jar file to my container /root/.guacamole/extensions/ using docker cp and I can see the file is there after the copy but nothing changes when I reload the web page. I figured that the web server has to be restarted somehow to load up the new images and translations.



If I stop and start the docker container then the jar file vanishes from the folder.



I tried copying the jar file and then immediately doing a docker commit to create my own customised image but again when I run this in a container the jar file has vanished!



Does anyone know what I'm doing wrong? Why is the extension jar file vanishing? How do I apply the example extension to my docker container?



Many thanks, Andy.

Re: Apply theme extension to docker container

Posted by Mike Jumper <mi...@guac-dev.org>.
On Thu, Nov 24, 2016 at 7:26 AM, Andy Pattrick <an...@horiba.com> wrote:
>
> However, when I login, I get the exception shown below. I was running the
> mjumper/guacamole:latest  image against my existing GUACD and MySQL running
> containers. Am I right in thinking that the database schema has changed and
> I'm going to need to update my MySQL container from a new image?

Yes.

>  If that's correct, how would I go about doing that without losing my existing
> database content such as user accounts, connections etc? My apologies if
> this is actually a 'howto docker upgrade' question rather than a guacamole
> upgrade question.

Make a backup of your database first, just in case, and then run the
schema upgrade script. To upgrade your MySQL database from the 0.9.9
schema to 0.9.10-incubating-RC1, you would use:

https://raw.githubusercontent.com/apache/incubator-guacamole-client/0.9.10-incubating-RC1/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/upgrade/upgrade-pre-0.9.10.sql

The need for that script is more explicitly listed in the manual, and
is included in a more obvious path within the .tar.gz of the database
extension, so you can expect this to be clearer when the release is
actually out.

Though there is a convenience script included within guacamole-docker
for producing the schema creation SQL script ("initdb.sh"), there is
currently no similar script for conveniently producing the upgrade
script(s). They still need to be pulled either from git or from the
released .tar.gz for the extension.

Keep in mind that if your database is older than 0.9.9, you will need
to run the other relevant upgrade-pre-*.sql scripts first, as each
script applies only the changes made between two releases.

- Mike

RE: Apply theme extension to docker container

Posted by Andy Pattrick <an...@horiba.com>.
Hi Mike,



I pulled mjumper/guacamole:latest and managed to get the customisation extension working via a mapped GUACAMOLE_HOME so thanks so much for your help on that.



However, when I login, I get the exception shown below. I was running the mjumper/guacamole:latest  image against my existing GUACD and MySQL running containers. Am I right in thinking that the database schema has changed and I'm going to need to update my MySQL container from a new image? If that's correct, how would I go about doing that without losing my existing database content such as user accounts, connections etc? My apologies if this is actually a 'howto docker upgrade' question rather than a guacamole upgrade question.



Cheers Andy.



15:18:13.529 [http-nio-8080-exec-1] INFO  o.a.g.r.auth.AuthenticationService - User "guacadmin" successfully authenticated from <snip>.
15:18:13.845 [http-nio-8080-exec-7] ERROR o.a.g.rest.RESTExceptionWrapper - Unexpected internal error:
### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'guacamole_db.guacamole_sharing_profile' doesn't exist
### 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             connection_id,             connection_name,             parent_id,             protocol,             max_connections,             max_connections_per_user         FROM guacamole_connection         WHERE connection_id IN              (                   ?              ,                  ?              ,                  ?              ,                  ?              ,                  ?              ,                  ?              ,                  ?              ,                  ?              ) ;          SELECT primary_connection_id, sharing_profile_id         FROM guacamole_sharing_profile         WHERE primary_connection_id IN              (                   ?              ,                  ?              ,                  ?              ,                  ?              ,                  ?              ,                  ?              ,                  ?              ,                  ?              ) ;
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'guacamole_db.guacamole_sharing_profile' doesn't exist
24-Nov-2016 15:18:13.845 SEVERE [http-nio-8080-exec-7] com.sun.jersey.spi.container.ContainerResponse.logException Mapped exception to response: 500 (Internal Server Error)
 org.apache.guacamole.rest.APIException
        at org.apache.guacamole.rest.RESTExceptionWrapper.invoke(RESTExceptionWrapper.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
        at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
        at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
        at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659)
        at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)

________________________________
From: Mike Jumper [mike.jumper@guac-dev.org]
Sent: 24 November 2016 09:32
To: user@guacamole.incubator.apache.org
Subject: Re: Apply theme extension to docker container

On Wed, Nov 23, 2016 at 9:17 AM, Andy Pattrick <an...@horiba.com>> wrote:
Hi Mike

If I wanted to try this out do I pull https://hub.docker.com/r/mjumper/guacamole/ or do I have to build a docker image myself from the source?


You can pull from "mjumper/guacamole", sure.

The images I have under my Docker Hub account are configured to automatically build from master (or at least my development fork of it), and those changes were merged recently.

- Mike




Click here<https://www.mailcontrol.com/sr/qY7H+H8K62LGX2PQPOmvUjDF5G4QKHNhjxlPVQZEoGdp9uY8bYTN8iv2s2FwXXQM0kidIu9VHtIoKRuEdgZyEA==> to report this email as spam.

Re: Apply theme extension to docker container

Posted by Mike Jumper <mi...@guac-dev.org>.
On Wed, Nov 23, 2016 at 9:17 AM, Andy Pattrick <an...@horiba.com>
wrote:

> Hi Mike
>
> If I wanted to try this out do I pull https://hub.docker.com/r/
> mjumper/guacamole/ or do I have to build a docker image myself from the
> source?
>
>
You can pull from "mjumper/guacamole", sure.

The images I have under my Docker Hub account are configured to
automatically build from master (or at least my development fork of it),
and those changes were merged recently.

- Mike

RE: Apply theme extension to docker container

Posted by Andy Pattrick <an...@horiba.com>.
Hi Mike

If I wanted to try this out do I pull https://hub.docker.com/r/mjumper/guacamole/ or do I have to build a docker image myself from the source?

Thanks Andy.

________________________________________
From: Andy Pattrick [andy.pattrick@horiba.com]
Sent: 28 September 2016 10:31
To: user@guacamole.incubator.apache.org
Subject: RE: Apply theme extension to docker container

Thanks for the detailed explanation Mike. I understand now. I'll try to give that a go when I have a moment.

Cheers Andy.

________________________________________
From: Mike Jumper [mike.jumper@guac-dev.org]
Sent: 27 September 2016 02:06
To: user@guacamole.incubator.apache.org
Subject: Re: Apply theme extension to docker container

On Thu, Sep 22, 2016 at 7:36 AM, Andy Pattrick <an...@horiba.com> wrote:
> Hi,
>
> I'm trying to apply the example theme extension jar from this thread
> https://sourceforge.net/p/guacamole/discussion/1110834/thread/be2a6785/ to
> my running guacamole docker container. This is to customise the logo and
> title etc as supported by https://glyptodon.org/jira/browse/GUAC-587
>
> I copy the example jar file to my container /root/.guacamole/extensions/
> using docker cp and I can see the file is there after the copy but nothing
> changes when I reload the web page. I figured that the web server has to be
> restarted somehow to load up the new images and translations.
>
> If I stop and start the docker container then the jar file vanishes from the
> folder.
>
> I tried copying the jar file and then immediately doing a docker commit to
> create my own customised image but again when I run this in a container the
> jar file has vanished!
>
> Does anyone know what I'm doing wrong? Why is the extension jar file
> vanishing? How do I apply the example extension to my docker container?
>

The .jar file is vanishing because the startup script for the
Guacamole Docker container recreates GUACAMOLE_HOME every time the
container starts, auto-generating the configuration and copying in any
required extensions based on the environment variables set when the
container was created.

There are WIP changes which will allow you to define a base
GUACAMOLE_HOME which the Docker container will use as a template prior
to generating its own configuration. You can use that to provide your
own extension(s) or arbitrary config:

https://issues.apache.org/jira/browse/GUACAMOLE-100

Those changes will not be making their way to git master until the
release is finally out (we are under code freeze until then), but you
can give them a shot as-is by using branch containing the changes:

https://github.com/mike-jumper/incubator-guacamole-client/tree/docker-guacamole-home

With the above, the "GUACAMOLE_HOME" environment variable can be used
to specify an arbitrary location to be copied into the real
GUACAMOLE_HOME just prior to auto-generating the configuration.
GUACAMOLE_HOME will still be wiped out each time the image starts, but
your custom GUACAMOLE_HOME will remain untouched and will still be
used as a basis. If you mount a local directory within the image and
specify that for GUACAMOLE_HOME, then external changes will be
reflected within the image whenever it is restarted, and things should
be pretty convenient.

- Mike

RE: Apply theme extension to docker container

Posted by Andy Pattrick <an...@horiba.com>.
Thanks for the detailed explanation Mike. I understand now. I'll try to give that a go when I have a moment.

Cheers Andy.

________________________________________
From: Mike Jumper [mike.jumper@guac-dev.org]
Sent: 27 September 2016 02:06
To: user@guacamole.incubator.apache.org
Subject: Re: Apply theme extension to docker container

On Thu, Sep 22, 2016 at 7:36 AM, Andy Pattrick <an...@horiba.com> wrote:
> Hi,
>
> I'm trying to apply the example theme extension jar from this thread
> https://sourceforge.net/p/guacamole/discussion/1110834/thread/be2a6785/ to
> my running guacamole docker container. This is to customise the logo and
> title etc as supported by https://glyptodon.org/jira/browse/GUAC-587
>
> I copy the example jar file to my container /root/.guacamole/extensions/
> using docker cp and I can see the file is there after the copy but nothing
> changes when I reload the web page. I figured that the web server has to be
> restarted somehow to load up the new images and translations.
>
> If I stop and start the docker container then the jar file vanishes from the
> folder.
>
> I tried copying the jar file and then immediately doing a docker commit to
> create my own customised image but again when I run this in a container the
> jar file has vanished!
>
> Does anyone know what I'm doing wrong? Why is the extension jar file
> vanishing? How do I apply the example extension to my docker container?
>

The .jar file is vanishing because the startup script for the
Guacamole Docker container recreates GUACAMOLE_HOME every time the
container starts, auto-generating the configuration and copying in any
required extensions based on the environment variables set when the
container was created.

There are WIP changes which will allow you to define a base
GUACAMOLE_HOME which the Docker container will use as a template prior
to generating its own configuration. You can use that to provide your
own extension(s) or arbitrary config:

https://issues.apache.org/jira/browse/GUACAMOLE-100

Those changes will not be making their way to git master until the
release is finally out (we are under code freeze until then), but you
can give them a shot as-is by using branch containing the changes:

https://github.com/mike-jumper/incubator-guacamole-client/tree/docker-guacamole-home

With the above, the "GUACAMOLE_HOME" environment variable can be used
to specify an arbitrary location to be copied into the real
GUACAMOLE_HOME just prior to auto-generating the configuration.
GUACAMOLE_HOME will still be wiped out each time the image starts, but
your custom GUACAMOLE_HOME will remain untouched and will still be
used as a basis. If you mount a local directory within the image and
specify that for GUACAMOLE_HOME, then external changes will be
reflected within the image whenever it is restarted, and things should
be pretty convenient.

- Mike

Re: Apply theme extension to docker container

Posted by Mike Jumper <mi...@guac-dev.org>.
On Thu, Sep 22, 2016 at 7:36 AM, Andy Pattrick <an...@horiba.com> wrote:
> Hi,
>
> I'm trying to apply the example theme extension jar from this thread
> https://sourceforge.net/p/guacamole/discussion/1110834/thread/be2a6785/ to
> my running guacamole docker container. This is to customise the logo and
> title etc as supported by https://glyptodon.org/jira/browse/GUAC-587
>
> I copy the example jar file to my container /root/.guacamole/extensions/
> using docker cp and I can see the file is there after the copy but nothing
> changes when I reload the web page. I figured that the web server has to be
> restarted somehow to load up the new images and translations.
>
> If I stop and start the docker container then the jar file vanishes from the
> folder.
>
> I tried copying the jar file and then immediately doing a docker commit to
> create my own customised image but again when I run this in a container the
> jar file has vanished!
>
> Does anyone know what I'm doing wrong? Why is the extension jar file
> vanishing? How do I apply the example extension to my docker container?
>

The .jar file is vanishing because the startup script for the
Guacamole Docker container recreates GUACAMOLE_HOME every time the
container starts, auto-generating the configuration and copying in any
required extensions based on the environment variables set when the
container was created.

There are WIP changes which will allow you to define a base
GUACAMOLE_HOME which the Docker container will use as a template prior
to generating its own configuration. You can use that to provide your
own extension(s) or arbitrary config:

https://issues.apache.org/jira/browse/GUACAMOLE-100

Those changes will not be making their way to git master until the
release is finally out (we are under code freeze until then), but you
can give them a shot as-is by using branch containing the changes:

https://github.com/mike-jumper/incubator-guacamole-client/tree/docker-guacamole-home

With the above, the "GUACAMOLE_HOME" environment variable can be used
to specify an arbitrary location to be copied into the real
GUACAMOLE_HOME just prior to auto-generating the configuration.
GUACAMOLE_HOME will still be wiped out each time the image starts, but
your custom GUACAMOLE_HOME will remain untouched and will still be
used as a basis. If you mount a local directory within the image and
specify that for GUACAMOLE_HOME, then external changes will be
reflected within the image whenever it is restarted, and things should
be pretty convenient.

- Mike