Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql module failed with an error zlib.error: Error -2 while preparing to decompress data: inconsistent stream state #47927

Closed
nitinkansal1984 opened this issue Nov 1, 2018 · 16 comments

Comments

@nitinkansal1984
Copy link

@nitinkansal1984 nitinkansal1984 commented Nov 1, 2018

SUMMARY

mysql module failed zlib.error: Error -2 while preparing to decompress data: inconsistent stream state

failed: [server] (item=server) => {"chang
ed": false, "item": "server", "module_stderr": "Shared connection to server closed.\r\n", "module_stdout": "Traceback (most recent
call last):\r\n File "/tmp/ansible_Aq1IFy/ansible_module_mysql_user.py", line 206, in \r\n from ansible.module_utils.basic impor
t AnsibleModule\r\nzlib.error: Error -2 while preparing to decompress data: inconsistent stream state\r\n", "msg": "MODULE FAILURE", "rc": 1}

ISSUE TYPE
  • Bug Report
  • Feature Idea
  • Documentation Report
COMPONENT NAME

mysql_user.py

ANSIBLE VERSION
ansible 2.6.4
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, May 3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]
CONFIGURATION

OS / ENVIRONMENT
STEPS TO REPRODUCE
- name: Lock down root user by changing default root user to a local user
         mysql_user:
           check_implicit_admin=yes
           login_user="{{mysql_root_user}}"
           login_password="{{mysql_root_password}}"
           name="{{mysql_root_user}}"
           password="{{mysql_root_password}}"
           host="{{item}}"
           priv="*.*:ALL,GRANT"
         with_items:
            - "localhost"
            - "server FQDN"
            - "server IP"
            - "server"
         become: no
EXPECTED RESULTS
ACTUAL RESULTS

@ansibot

This comment has been minimized.

Copy link
Contributor

@ansibot ansibot commented Nov 1, 2018

Hi @nitinkansal1984, thank you for submitting this issue!

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

@ansibot ansibot commented Nov 1, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@nitinkansal1984

This comment has been minimized.

Copy link
Author

@nitinkansal1984 nitinkansal1984 commented Nov 1, 2018

yes the file name is /usr/lib/python2.7/site-packages/ansible/modules/database/mysql/mysql_user.py

@ansible ansible deleted a comment from nitinkansal1984 Nov 1, 2018
@cachemeoutside

This comment has been minimized.

Copy link

@cachemeoutside cachemeoutside commented Nov 2, 2018

Not sure if this is related, but we've experienced similar messages and debugged our problem to be described in following MySQLchangelog. We were using mysql 5.6.41 from the community repo, but it looks like 5.6.42 requires zlib 1.2.11+ now. Our RHEL7 systems are using zlib 1.2.7, so there seems to be a version incompatibility.

https://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-42.html

@abernalreply

This comment has been minimized.

Copy link

@abernalreply abernalreply commented Nov 13, 2018

I also faced this issue and solved as @cachemeoutside said (because of the reason that he mentioned), updating zlib.

Just for reference if you want to update the zlib from 1.2.7 to 1.2.11, I followed this procedure within the server

1 Download the version of zlib that we want to update to

wget https://zlib.net/zlib-1.2.11.tar.gz

2 Unpack the source

tar -xzf zlib-1.2.11.tar.gz

3 Get into the source

cd zlib-1.2.11/

4 Configure it

Executing the next command. The prefix "/usr" is used to configure the library under this path, usually at the end it will be within "/usr/lib"

./configure --shared --prefix=/usr

5 Execute the "make" command

make

6 Execute the "make install" command

make install

7 Check symbolic links on /usr/lib

cd /usr/lib
ls -l libz*

*** Sample Output ***

-rw-r--r--. 1 root root 147170 Nov  8 01:20 libz.a
lrwxrwxrwx. 1 root root     24 Nov  8 01:21 libz.so -> ../../lib/libz.so.1.2.11
lrwxrwxrwx. 1 root root     14 Nov  8 01:20 libz.so.1 -> libz.so.1.2.11
-rwxr-xr-x. 1 root root 117592 Nov  8 01:20 libz.so.1.2.11

After this procedure I execute the recipe again and it worked

@ansibot

This comment has been minimized.

Copy link
Contributor

@ansibot ansibot commented Dec 12, 2018

@hwali

This comment has been minimized.

Copy link

@hwali hwali commented Jan 30, 2019

Akasurde which solution do u mean installing zlib-1.2.11.tar? and do this implemented on mysql server(remote)

@hwali

This comment has been minimized.

Copy link

@hwali hwali commented Jan 30, 2019

./configure --shared --prefix=/usr
[root@db01 zlib-1.2.11]# ./configure --shared --prefix=/usr
Checking for gcc...
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.

@ansibot ansibot added the test label Jan 30, 2019
@Akasurde

This comment has been minimized.

Copy link
Member

@Akasurde Akasurde commented Jan 30, 2019

@hwali it seems that you don't have gcc installed on machine

# ./configure
Checking for gcc...
Checking for shared library support...
Building shared library libz.so.1.2.11 with gcc.
Checking for size_t... Yes.
Checking for off64_t... Yes.
Checking for fseeko... Yes.
Checking for strerror... Yes.
Checking for unistd.h... Yes.
Checking for stdarg.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for attribute(visibility) support... Yes.
# pwd
/root/zlib-1.2.11

@hwali

This comment has been minimized.

Copy link

@hwali hwali commented Jan 30, 2019

[root@osboxes9 ansible2]# curl db01
curl: (7) Failed connect to db01:80; Connection refused
[root@osboxes9 ansible2]#

[root@osboxes9 ansible2]# curl osboxes1/db
(_mysql_exceptions.OperationalError) (2003, "Can't connect to MySQL server on 'db01' (13)")
[root@osboxes9 ansible2]#

[root@db01 ~]# systemctl status mysqld
● mysqld.service - MySQL Community Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: activating (start-post) since Wed 2019-01-30 13:07:11 EST; 1min 7s ago
Process: 23182 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
Process: 23166 ExecStartPre=/usr/bin/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 23182 (code=exited, status=0/SUCCESS); : 23183 (mysql-systemd-s)
Tasks: 2
CGroup: /system.slice/mysqld.service
└─control
├─23183 /bin/bash /usr/bin/mysql-systemd-start post
└─23441 sleep 1

Jan 30 13:07:11 db01 systemd[1]: mysqld.service holdoff time over, scheduling restart.
Jan 30 13:07:11 db01 systemd[1]: Stopped MySQL Community Server.
Jan 30 13:07:11 db01 systemd[1]: Starting MySQL Community Server...
Jan 30 13:07:23 db01 mysqld_safe[23182]: 190130 13:07:23 mysqld_safe Logging to '/var/log/mysqld.log'.
Jan 30 13:07:23 db01 mysqld_safe[23182]: 190130 13:07:23 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
[root@db01 ~]#

@ansibot

This comment has been minimized.

@ansibot ansibot added the database label Feb 15, 2019
@ansibot

This comment has been minimized.

Copy link
Contributor

@ansibot ansibot commented Feb 23, 2019

@hwali

This comment has been minimized.

Copy link

@hwali hwali commented May 17, 2019

Admin this case can close as issue resolved with some changes done my end

@Akasurde

This comment has been minimized.

Copy link
Member

@Akasurde Akasurde commented May 23, 2019

@nitinkansal1984 Could you please confirm if the solution provided works for you and let us know ? Thanks.

@pratikgadiya12 Thanks for investigating.

needs_info

@ansibot ansibot added the needs_info label May 23, 2019
@nitinkansal1984

This comment has been minimized.

Copy link
Author

@nitinkansal1984 nitinkansal1984 commented May 24, 2019

@ansibot ansibot removed the needs_info label May 24, 2019
@Akasurde

This comment has been minimized.

Copy link
Member

@Akasurde Akasurde commented May 24, 2019

Closing this as per #47927 (comment). Please feel free to open a new issue problem persists. Thanks.

@Akasurde Akasurde closed this May 24, 2019
@ansible ansible locked and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
8 participants
You can’t perform that action at this time.