You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/01/21 17:59:41 UTC

[GitHub] [cloudstack] Slair1 opened a new issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Slair1 opened a new issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826
 
 
   <!--
   Verify first that your issue/request is not already reported on GitHub.
   Also test if the latest release and master branch are affected too.
   Always add information AFTER of these HTML comments, but no need to delete the comments.
   -->
   
   ##### ISSUE TYPE
   <!-- Pick one below and delete the rest -->
    * Bug Report
   
   ##### COMPONENT NAME
   <!--
   Categorize the issue, e.g. API, VR, VPN, UI, etc.
   -->
   ~~~
   mysql-connector-java
   ~~~
   
   ##### CLOUDSTACK VERSION
   <!--
   New line separated list of affected versions, commit ID for issues on master branch.
   -->
   
   ~~~
   4.11.3
   all
   ~~~
   
   ##### CONFIGURATION
   <!--
   Information about the configuration if relevant, e.g. basic network, advanced networking, etc.  N/A otherwise
   -->
   
   
   ##### OS / ENVIRONMENT
   <!--
   Information about the environment if relevant, N/A otherwise
   -->
   CentOS7
   
   ##### SUMMARY
   <!-- Explain the problem/feature briefly -->
   Looks like the new version (8.0.x) is stricter with conversions from Long to BigIntfor example.  Auto Increment fields in the database are of type BigInt, but in code we are using Long.  This generates the errors similar to the following at times:
   ~~~
   Can not set long field com.cloud.upgrade.dao.VersionVO.id to java.math.BigInteger
   ~~~
   ##### STEPS TO REPRODUCE
   <!--
   For bugs, show exactly how to reproduce the problem, using a minimal test-case. Use Screenshots if accurate.
   
   For new features, show how the feature would be used.
   -->
   Install any new version of mysql-connector-java
   
   <!-- Paste example playbooks or commands between quotes below -->
   ~~~
   We hit it while the database upgrade script was running 4.9.3.0 -> 4.10.0
   ~~~
   
   <!-- You can also paste gist.github.com links for larger files -->
   
   ##### EXPECTED RESULTS
   <!-- What did you expect to happen when running the steps above? -->
   
   ~~~
   Looks like older versions of mysql-connector-java did not care that we use Long in code by BigInt in the database columns
   ~~~
   
   ##### ACTUAL RESULTS
   <!-- What actually happened? -->
   We get errors such as this:
   <!-- Paste verbatim command output between quotes below -->
   ~~~
   Caused by: java.lang.IllegalArgumentException: Can not set long field com.cloud.upgrade.dao.VersionVO.id to java.math.BigInteger
           at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
           at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
           at sun.reflect.UnsafeLongFieldAccessorImpl.set(UnsafeLongFieldAccessorImpl.java:102)
   ~~~
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] cg5labs commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
cg5labs commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-612555420
 
 
   Hi, I started a small PoC on Cloudstack two days ago and followed the official Quickstart guide. Tried to install 4.13 and later 4.11.3 and ran into exactly this issue (and the Python module issue with missing dns.resolver module). 
   
   The workaround for this issue (exclude mysql-connector-java-* from MySQL community repo config) is straightforward and works. However, the Quickstart Guide and Install Manual need to include it at least until the permanent fix with 4.14 is released. 
   
   So I don't understand why this was closed without updating the documentation on the issue and workaround. As it is now, the Cloudstack install is a jarring debugging experience that only leads to this Github issue if your google-fu is good ... 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] andrijapanicsb commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
andrijapanicsb commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-612636799
 
 
   Cool - I see already an existing PR - see if there is anything to add/remove to it : https://github.com/apache/cloudstack-documentation/pull/93 
   
   Thanks

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] rhtyd commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
rhtyd commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-579097415
 
 
   Thanks for confirming the workaround @pdion891. I'll close this as it's not a blocker if the distro provided mysql java dependency is not upgraded to 8.x, further #3601 fixes this against jdk11.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] Slair1 edited a comment on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
Slair1 edited a comment on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-576822449
 
 
   We tried 8.0.16 through 8.0.19 and it had the same error regarding Long and BigInt.
   
   For some reason when we try 8.0.11 through 8.0.15, we have some other issue (shown below) but did not have time to troubleshoot that.
   
   "Failed to load DB driver com.mysql.jdbc.Driver"
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] Ionica commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
Ionica commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-576848004
 
 
   I had the same issue after update our CentOS 7 OS. Please see all the details for reproducing the issue here: https://lists.apache.org/thread.html/r8413e39ac991dd7f65a30f691e520c48c1c9c496fd9b5a1badbfbbea%40%3Cusers.cloudstack.apache.org%3E

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] DaanHoogland commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-611916051
 
 
   hey @coreymr , I always forget, but please google for your setup. you need to use pip (the python package manager) or your OS package manager (like yum or apt-get) for that.
   something like
   ```
   pip/yum/apt-get uninstall mysql-connector
   pip/yum/apt-get install mysql-connector-5....
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] pdion891 commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
pdion891 commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-578137725
 
 
   validated on CentOS 7  for cloudstack 4.10 and 4.12, 
   
   ```
   2020-01-22 16:14:52,643 DEBUG [c.c.u.d.T.Transaction] (localhost-startStop-1:null) (logid:) Rolling back the transaction: Time = 2903 Name =  Upgrade; called by -TransactionLegacy.rollback:889-TransactionLegacy.removeUpTo:832-TransactionLegacy.close:656-TransactionContextInterceptor.invoke:36-ReflectiveMethodInvocation.proceed:168-ExposeInvocationInterceptor.invoke:92-ReflectiveMethodInvocation.proceed:179-JdkDynamicAopProxy.invoke:213-$Proxy23.persist:-1-DatabaseUpgradeChecker.upgrade:471-DatabaseUpgradeChecker.check:548-CloudStackExtendedLifeCycle.checkIntegrity:65
   2020-01-22 16:14:52,658 ERROR [c.c.u.DatabaseUpgradeChecker] (localhost-startStop-1:null) (logid:) Unable to upgrade the database
   com.cloud.utils.exception.CloudRuntimeException: Problem with getting the ec attribute
   	at com.cloud.utils.db.GenericDaoBase.persist(GenericDaoBase.java:1430)
   ```
   
   Rollback to mysql-connector-java-5.1.47 worked fine.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] Slair1 commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
Slair1 commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-576822449
 
 
   We tried 8.0.16 through 8.0.19 and it had the same error.
   
   For some reason when we try 8.0.11 through 8.0.15, we have some other issue (shown below) but did not have time to troubleshoot that.
   
   "Failed to load DB driver com.mysql.jdbc.Driver"
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] andrijapanicsb commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
andrijapanicsb commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-612589653
 
 
   > Hi, I started a small PoC on Cloudstack two days ago and followed the official Quickstart guide. Tried to install 4.13 and later 4.11.3 and ran into exactly this issue (and the Python module issue with missing dns.resolver module).
   > 
   > The workaround for this issue (exclude mysql-connector-java-* from MySQL community repo config) is straightforward and works. However, the Quickstart Guide and Install Manual need to include it at least until the permanent fix with 4.14 is released.
   > 
   > So I don't understand why this was closed without updating the documentation on the issue and workaround. As it is now, the Cloudstack install is a jarring debugging experience that only leads to this Github issue if your google-fu is good ...
   
   That's why this is a community project and I'm challenging you to get engaged and send a documentation PR on that guide, deal? :handshake: 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] rhtyd commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
rhtyd commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-599961451
 
 
   @alexanderbazhenoff it is expected to fail with older versions, this has been fixed for 4.14/master. The next major release 4.14.0.0 will support Java11 and the new mysql java 8.x connector.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] rhtyd closed issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
rhtyd closed issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] pdion891 edited a comment on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
pdion891 edited a comment on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-578137725
 
 
   validated on CentOS 7  for cloudstack 4.10 and 4.12,  during initial start of cloudstack-management, it fail at the database upgrade scripts with following error:
   
   ```
   2020-01-22 16:14:52,643 DEBUG [c.c.u.d.T.Transaction] (localhost-startStop-1:null) (logid:) Rolling back the transaction: Time = 2903 Name =  Upgrade; called by -TransactionLegacy.rollback:889-TransactionLegacy.removeUpTo:832-TransactionLegacy.close:656-TransactionContextInterceptor.invoke:36-ReflectiveMethodInvocation.proceed:168-ExposeInvocationInterceptor.invoke:92-ReflectiveMethodInvocation.proceed:179-JdkDynamicAopProxy.invoke:213-$Proxy23.persist:-1-DatabaseUpgradeChecker.upgrade:471-DatabaseUpgradeChecker.check:548-CloudStackExtendedLifeCycle.checkIntegrity:65
   2020-01-22 16:14:52,658 ERROR [c.c.u.DatabaseUpgradeChecker] (localhost-startStop-1:null) (logid:) Unable to upgrade the database
   com.cloud.utils.exception.CloudRuntimeException: Problem with getting the ec attribute
   	at com.cloud.utils.db.GenericDaoBase.persist(GenericDaoBase.java:1430)
   ```
   
   Rollback to mysql-connector-java-5.1.47 worked fine.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] AlexanderKgr commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
AlexanderKgr commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-599894168
 
 
   > validated on CentOS 7 for cloudstack 4.10 and 4.12, during initial start of cloudstack-management, it fail at the database upgrade scripts with following error:
   > 
   > ```
   > 2020-01-22 16:14:52,643 DEBUG [c.c.u.d.T.Transaction] (localhost-startStop-1:null) (logid:) Rolling back the transaction: Time = 2903 Name =  Upgrade; called by -TransactionLegacy.rollback:889-TransactionLegacy.removeUpTo:832-TransactionLegacy.close:656-TransactionContextInterceptor.invoke:36-ReflectiveMethodInvocation.proceed:168-ExposeInvocationInterceptor.invoke:92-ReflectiveMethodInvocation.proceed:179-JdkDynamicAopProxy.invoke:213-$Proxy23.persist:-1-DatabaseUpgradeChecker.upgrade:471-DatabaseUpgradeChecker.check:548-CloudStackExtendedLifeCycle.checkIntegrity:65
   > 2020-01-22 16:14:52,658 ERROR [c.c.u.DatabaseUpgradeChecker] (localhost-startStop-1:null) (logid:) Unable to upgrade the database
   > com.cloud.utils.exception.CloudRuntimeException: Problem with getting the ec attribute
   > 	at com.cloud.utils.db.GenericDaoBase.persist(GenericDaoBase.java:1430)
   > ```
   > 
   > Rollback to mysql-connector-java-5.1.47 worked fine.
   
   which is the procedure to rollback? i am completely new to cloudstack and yesterday installed and faced this issue
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] coreymr commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
coreymr commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-611715187
 
 
   Could you share how I'd revert to using mysql-connector-java-5.1.47?  I'm new to CloudStack and also not too familiar with modifying MySQL settings.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] andrijapanicsb commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
andrijapanicsb commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-576820330
 
 
   The alternative (what we are using in Trillian) is to use mysql-connector-java from the Base CentOS 7 repo (still version 5.x) and mysql-connector-python from the Epel repo (an ancient version 1.1.6 verrsion) - i.e. forget/remove the repo.mysql.com repo.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] cg5labs commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
cg5labs commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-612636341
 
 
   > That's why this is a community project and I'm challenging you to get engaged and send a documentation PR on that guide, deal? 🤝
   
   @andrijapanicsb , sounds good. I've found the documentation repo and will send the PR tomorrow! 👍 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] Slair1 commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
Slair1 commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-576815858
 
 
   Not sure if the correct fix is to update the code to use something more compatible with BigInt or not...  But here is a band-aid, here is what our `mysql-community-connectors.repo` looks like now:
   
   ```
   [mysql-community-connectors]
   name=MySQL Community Connectors
   baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/$releasever/$basearch/
   enabled=1
   gpgcheck=1
   exclude=mysql-connector-java*
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] rhtyd commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package

Posted by GitBox <gi...@apache.org>.
rhtyd commented on issue #3826: Unsafe Field Accessor with newer mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826#issuecomment-577023193
 
 
   @Slair1 cc @andrijapanicsb @DaanHoogland @PaulAngus this has been fixed in the JDK11 branch that will include mysql-connector java dependency (no distro provided dependency needed now) and fixes the Long conversion issue:
   https://github.com/apache/cloudstack/pull/3601

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services