Bug 1292701 - Install mysqlclient in Django scalable application [NEEDINFO]
Install mysqlclient in Django scalable application
Status: CLOSED WONTFIX
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
high Severity urgent
: ---
: ---
Assigned To: Vu Dinh
DeShuai Ma
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-18 01:58 EST by Jaspreet Kaur
Modified: 2016-08-01 11:45 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-04-22 14:40:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
vdinh: needinfo? (jkaur)


Attachments (Terms of Use)

  None (edit)
Description Jaspreet Kaur 2015-12-18 01:58:30 EST
Description of problem:

When installing mysqlclient in scalable django application it fails while it works in scalable application


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
- Creating a python 3.3 application. Add mysql cartridge.

2) Edit setup.py below :

install_requires=['Django>=1.3','MySQL-python'],

git add setup.py
git commit -m "added"
git push

3) Ssh the application:

rhc ssh <APP-Name>

- Install mysqlclient

pip install mysqlclient
 
Actual results: It fails with below error :

Collecting mysqlclient
  Downloading mysqlclient-1.3.7.tar.gz (79kB)
    100% |████████████████████████████████| 81kB 4.8MB/s 
Installing collected packages: mysqlclient
  Running setup.py install for mysqlclient
    Complete output from command /var/lib/openshift/566aed8389f5cf0a10000013/python/virtenv/venv/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-mszn_6/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-f7rdbj-record/install-record.txt --single-version-externally-managed --compile --install-headers /var/lib/openshift/566aed8389f5cf0a10000013/python/virtenv/venv/include/site/python3.3/mysqlclient:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.3
    copying _mysql_exceptions.py -> build/lib.linux-x86_64-3.3
    creating build/lib.linux-x86_64-3.3/MySQLdb
    copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.3/MySQLdb
    copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.3/MySQLdb
    copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.3/MySQLdb
    copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.3/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.3/MySQLdb
    copying MySQLdb/release.py -> build/lib.linux-x86_64-3.3/MySQLdb
    copying MySQLdb/times.py -> build/lib.linux-x86_64-3.3/MySQLdb
    creating build/lib.linux-x86_64-3.3/MySQLdb/constants
    copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.3/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.3/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.3/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.3/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.3/MySQLdb/constants
    copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-3.3/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.3/MySQLdb/constants
    running build_ext
    building '_mysql' extension
    creating build/temp.linux-x86_64-3.3
    gcc -pthread -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I/opt/rh/python33/root/usr/include-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,3,7,'final',1) -D__version__=1.3.7 -I/opt/rh/mysql55/root/usr/include/mysql -I/var/lib/openshift/566aed8389f5cf0a10000013/python/virtenv/venv/include -I/opt/rh/python33/root/usr/include/python3.3m -c _mysql.c -o build/temp.linux-x86_64-3.3/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1
    In file included from /opt/rh/python33/root/usr/include/python3.3m/pyconfig.h:6,
                     from /opt/rh/python33/root/usr/include/python3.3m/Python.h:8,
                     from _mysql.c:40:
    /opt/rh/python33/root/usr/include/python3.3m/pyconfig-64.h:548:1: warning: "HAVE_MBRTOWC" redefined
    In file included from /opt/rh/mysql55/root/usr/include/mysql/my_config.h:14,
                     from _mysql.c:29:
    /opt/rh/mysql55/root/usr/include/mysql/my_config_x86_64.h:421:1: warning: this is the location of the previous definition
    gcc -pthread -shared -L/opt/rh/python33/root/usr/lib64 -L/usr/lib6464 build/temp.linux-x86_64-3.3/_mysql.o -L/opt/rh/mysql55/root/usr/lib64/mysql -L/opt/rh/python33/root/usr/lib64 -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl -lpython3.3m -o build/lib.linux-x86_64-3.3/_mysql.cpython-33m.so
    /usr/bin/ld: cannot find -lmysqlclient
    collect2: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/var/lib/openshift/566aed8389f5cf0a10000013/python/virtenv/venv/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-mszn_6/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-f7rdbj-record/install-record.txt --single-version-externally-managed --compile --install-headers /var/lib/openshift/566aed8389f5cf0a10000013/python/virtenv/venv/include/site/python3.3/mysqlclient" failed with error code 1 in /tmp/pip-build-mszn_6/mysqlclient


Expected results:

It should work in scalable applications also

Additional info:
Comment 2 Jaspreet Kaur 2015-12-18 07:18:43 EST
Hello,

There is a correct in my statement :

When installing mysqlclient in scalable django application it fails while it works in non-scalable application

Regards,
Jaspreet
Comment 3 Jaspreet Kaur 2015-12-22 02:08:39 EST
Hello,

Can we have an update on this please so as to inform the customer if it going to be considered or not ?

Regards,
Jaspreet
Comment 4 Vu Dinh 2015-12-23 16:24:20 EST
Hi,

We are still actively working to resolve this issue. We are narrowing down the cause for this and hopefully will come up with a fix soon. However, it's holiday season so the progress has been slow unfortunately as most of engineers are on PTO. We will give you more updates as soon as we get back from the break.

Thanks,
Vu
Comment 5 Vu Dinh 2016-01-05 11:36:36 EST
Hi,

Just want to post a quick update that we are still working on this issue. In the meantime, there is a possible workaround that customer can give a try if necessary.

1. First, create the scalable app with python-3.3 without mysql-5.5 cartridge:
rhc app create <app-name> python-3.3 -s

2. Then, add django and mysqlclient to setup.py and the git push the change. Both django and mysqlclient should be installed properly.

3. Finally, add mysql-5.5 cartridge to the app:
rhc cartridge add mysql-5.5 --app <app-name>

Now, the app should have 2 gears, one for python and one for mysql as it should be.

Let me know if this workaround is suitable for customer case.

Thanks,
Vu
Comment 7 Stijn de Witt 2016-08-01 11:35:05 EDT
I had the same issue as the OP. Created a scalable app with Python 3.3 and MySQL 5.5 but mysqlclient would not install. 

I tried the workaround suggested by Vu Dinh and that works. Thanks Vu!
Comment 8 Vu Dinh 2016-08-01 11:45:07 EDT
Hi Stijn,

Thanks for letting me know and you are welcome!

Vu

Note You need to log in before you can comment on or make changes to this bug.