openshift-s2i / s2i-wildfly

Source-to-Image template for WildFly applications
http://wildfly.org/
Other
73 stars 145 forks source link

outdated mysql driver #140

Closed scarvys closed 7 years ago

scarvys commented 7 years ago

just like the postgresql the mysql driver is outdated. If I use a mysql datasource (version 5.7 is used in openshift, an outdated driver will be taken in wildfly 10.1: INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 33) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1) => the specific version is mysql-connector-java-5.1.18-bin.jar and there is a bug in that connector, see => Bug #66659: mysql 5.6.6m9 fails on OPTION SQL_SELECT_LIMIT=DEFAULT https://bugs.mysql.com/bug.php?id=66659

=> fixed in 5.1.22 and above ... => SET SQL_SELECT_LIMIT=DEFAULT

So i suggest to take the 5.1.43 or even the 6.0.6

Would it be possible to update this image? Thank you in advance

bparees commented 7 years ago

happy to accept a PR, or you can provide your own module w/ your app to override the system one, as discussed here: https://github.com/openshift-s2i/s2i-wildfly/issues/137#issuecomment-326292776

bparees commented 7 years ago

fixed by https://github.com/openshift-s2i/s2i-wildfly/pull/141

scarvys commented 7 years ago

Hi, thanks for the fix, I tried it out on openshift online v3 but the error remains . Could it be that openshift online has a delay and doesn't use the last source code? (Even I see on dockerhub that the builder image there is changed 7 hours ago ( https://hub.docker.com/r/openshift/wildfly-101-centos7/tags/) but maybe when choosing the openshift v3 wildfly 10.1 latest he doesn't use this github code directly or so?

bparees commented 7 years ago

@scarvys the online environment hasn't imported the new image yet (not sure how often they do so). You can tell this by looking at the wildfly imagestream tag:

$ oc describe is wildfly -n openshift
Name:           wildfly
Namespace:      openshift
Created:        21 hours ago
Labels:         <none>
Annotations:        openshift.io/display-name=WildFly
            openshift.io/image.dockerRepositoryCheck=2017-08-31T17:43:22Z
Docker Pull Spec:   172.30.208.107:5000/openshift/wildfly
Image Lookup:       local=false
Unique Images:      4
Tags:           5

10.1 (latest)
  tagged from openshift/wildfly-101-centos7:latest

  Build and run WildFly 10.1 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/openshift-s2i/s2i-wildfly/blob/master/README.md.
  Tags: builder, wildfly, java
  Supports: wildfly:10.1, jee, java
  Example Repo: https://github.com/openshift/openshift-jee-sample.git

  * openshift/wildfly-101-centos7@sha256:2fc34857494f1d9db6519c5356eeeb881ef46365499db97b71e51568b9e13afb
      21 hours ago

10.0
  tagged from openshift/wildfly-100-centos7:latest

  Build and run WildFly 10.0 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/openshift-s2i/s2i-wildfly/blob/master/README.md.
  Tags: builder, wildfly, java
  Supports: wildfly:10.0, jee, java
  Example Repo: https://github.com/openshift/openshift-jee-sample.git

  * openshift/wildfly-100-centos7@sha256:1477ef8fd184da43ec6803f7ae1fd2ff4ae4d740b5268bd20087a4f38de65ff8
      21 hours ago

9.0
  tagged from openshift/wildfly-90-centos7:latest

  Build and run WildFly 9.0 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/openshift-s2i/s2i-wildfly/blob/master/README.md.
  Tags: builder, wildfly, java
  Supports: wildfly:9.0, jee, java
  Example Repo: https://github.com/openshift/openshift-jee-sample.git

  * openshift/wildfly-90-centos7@sha256:0b203a391e6f4a891c1f67254c625066df6e33cc0999f76c068f60657b8a1b59
      21 hours ago

8.1
  tagged from openshift/wildfly-81-centos7:latest

  Build and run WildFly 8.1 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/openshift-s2i/s2i-wildfly/blob/master/README.md.
  Tags: builder, wildfly, java
  Supports: wildfly:8.1, jee, java
  Example Repo: https://github.com/openshift/openshift-jee-sample.git

  * openshift/wildfly-81-centos7@sha256:f935c250597cbac320160847dcf02cca745096157f9cb607725f776fb8eca877
      21 hours ago

You can create your own imagestream in your project and use that, if you don't want to wait for an import to happen.

I'm not sure how often the online environment performs an import to update the images.

scarvys commented 7 years ago

Hi, Thank you for the info; I received also a link from support :-) https://access.redhat.com/articles/2208321

So it's every 6 weeks I think, but I got following info (5 weeks ago, with you it is only 21 hours so then it will take some time...) : Name: wildfly Namespace: openshift Created: 5 weeks ago Labels: Annotations: openshift.io/display-name=WildFly openshift.io/image.dockerRepositoryCheck=2017-07-26T17:09:16Z Docker Pull Spec: 172.30.118.67:5000/openshift/wildfly Unique Images: 4 Tags: 5 10.1 (latest) tagged from openshift/wildfly-101-centos7:latest Build and run WildFly 10.1 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/openshift-s2i/s2i-wildfly/blob/master/README.md. Tags: builder, wildfly, java Supports: wildfly:10.1, jee, java Example Repo: https://github.com/openshift/openshift-jee-sample.git

I don't know how to create my own imagestream and use it in openshift online v3. I know I can use add to project and then deploy an image but don't know how it works. I have to build it with s2I I guess (https://blog.openshift.com/create-s2i-builder-image/) but I don't know if I can use docker cloud for this or something else to do it automatically. Any Tips are appreciated.

bye

bparees commented 7 years ago

which cluster are you using?

Anyway to create your own wildfly imagestream in your project, just run this:

oc tag --source=docker openshift/wildfly-101-centos7:latest mywildfly:latest

You'll then have an imagestreamtag named "mywildfly:latest" in your project that you can reference from your project. Make sure when you reference it, you are referencing your imagestreamtag, not the one in the openshift project/namespace.

scarvys commented 7 years ago

Hi, Thanks already for the great help;

I'm using https://console.pro-us-east-1.openshift.com and I'm used to the GUI, that's quite easy. I also am trying to migrate from v2 to v3 and have some difficulties...

The only thing I want to do is take the wildfly (that part I have already I think with the tag) and create my java jee app from bitbucket and build an app with it.

So just one more thing;

// I want to use a private key to acces the bitbucket git (but this doesn't work) oc set build-secret myprivatekey

//and i want to create an app based on the imagestreamtag and my source code in git(bitbucket) and specify the path to the war (because it's multimodule)

oc new-app mywildfly:latest~git@bitbucket.org:scarvy/myapp.git --build-env='ARTIFACT_DIR=relative/path/to/artifacts/dir' --build-env='MAVEN_ARGS=install -pl : -am'

but somewhere this doesn't work, i know there is a java s2i builder process but then he uses again the old version... so I'm a bit stuck :( could you point me out where it went wrong ? Thank you in advance

bparees commented 7 years ago

You likely have a complicated enough configuration that it's going to take a little customization beyond what new-app will give you, but first I need to understand where you're running into trouble.

you've defined a buildconfig, but you say your repository is private, so you need to associate a source secret in your buildconfig. It looks like maybe you at least defined the secret, but i'm not sure you referenced it from the buildconfig? see: https://docs.openshift.org/latest/dev_guide/builds/build_inputs.html#source-clone-secrets

for details on how to define a source secret for accessing a private repository, and how to reference that secret in your buildconfig.

Once you've done that, if you're still having issues, I'll need to know if your problem is:

1) the build itself is failing (in which case i'd like to see the buildconfig json (oc get yourbuildconfigname -o json) and the build logs for one of the failing builds (oc logs build/yourbuildconfigname-1). Even better is level 5 logs which you can get with oc start-build yourbuildconfigname --build-loglevel=5 -F.

or

2) issues running the application image once it's built.

bparees commented 7 years ago

btw if you haven't seen it, we have a migration guide to help w/ the process of moving from v2 to v3: https://docs.openshift.org/latest/dev_guide/migrating_applications/index.html

scarvys commented 7 years ago

I'm not so used to the cli but now i've got a step further by combining cli , the web console and also your input :-), so thank you for the help !

During the deployment I encountered an error (not warning) after using the new image concerning using ssl or not, I solved it by mentioning ?useSSL=false after the db name in the env. var MYSQL_DATABASE (I suppose I missed something but if not it's maybe better to provide an env. var for useSSL in the connection-url tag of standalone.xml ?)

After that I've still got some error messages concerning the lookup of the POSTGRESQL DATASOURCE, but I didn't specify any env. var for POSTGRESQL, I'm using MYSQL ... I know there is some checking in the standalone.conf but I don't understand why i got the error below:

WFLYCTL0013: Operation ("read-resource-description") failed - address: ([

  | ("subsystem" => "datasources"),   | ("data-source" => "${env.OPENSHIFT_POSTGRESQL_DATASOURCE}"),   | ("statistics" => "jdbc")   | ]) - failure description: "WFLYCTL0030: No resource definition is registered for address [   | (\"subsystem\" => \"datasources\"),   | (\"data-source\" => \"${env.OPENSHIFT_POSTGRESQL_DATASOURCE}\"),   | (\"statistics\" => \"jdbc\")   | ]" ... or can I ignore those errors ? (I'm afraid not because the server stops afterwards) Is there also a way to get to the wildfly logs by an ftp client like in v2, maybe that can help too ?) => https://blog.openshift.com/using-filezilla-and-sftp-on-windows-with-openshift/

bparees commented 7 years ago

the wildfly logs should be directed to stdout so everything you see via oc logs podname or via the pod logs in the webconsole is what wildfly is logging.

the postgresql datasource should be disabled, can you provide the full wildfly log? (if the pod is crashlooping, you will need to use oc logs podname -p to get the logs for the previous run.

also oc get pod podname -o yaml would be helpful so i can see how you've configured the pod in case there is an issue there.

Please provide both in a gist rather than pasting them into a comment here. Thanks!

scarvys commented 7 years ago

HI, hereby the gist (sorry, didn't know about that)

https://gist.github.com/scarvys/61a125d2595cf0e82ac2e1c3b7108d0d

bparees commented 7 years ago

i'll dig into the postgres errors later but i don't think they are the source of your problems. It's not terribly obvious what is killing the wildfly server but my first guess might be that it's a memory issue. Have you tried given the wildfly deployment more memory?

Alternatively, just to get to a known good state, have you tried building/deploying our sample wildfly app? Then you can see what "good" wildfly logs look like: https://github.com/openshift/openshift-jee-sample.git

scarvys commented 7 years ago

I forgot indeed to increase the memory, i gave it now 1 Gi and it works great now, so you made my sunday ;-)

concerning the postgress errors, they indeed didn't cause any real problems but I always try to avoid any error message in my logs, so if you find a solution about it in the future, I'm happy to receive it :)

So again, thanks for the great and very fast help, I'm out of blocking issues right now :-) have a great day too

bparees commented 7 years ago

Fantastic, very glad we could get you going!

bparees commented 7 years ago

btw if you want to get rid of the errors, at a minimum, you can always supply your own standalone.xml configuration file in your app repository. (you can use a copy of the one that's included in the image, but strip out the postgres parts). I know it's not ideal, but it's something to consider for now.