Recompiling APE with latest Mysql... Error libmysac.so.0.0.

58 views
Skip to first unread message

Nicolas

unread,
Sep 2, 2014, 1:07:04 PM9/2/14
to ape-p...@googlegroups.com
Hi,

I have just installed the latest APE, but got a Mysql error. I strongly suspect that this is due to the fact that APE uses an old version of Mysac (0.4) when it should use a newer one.

So I recompiled APE with the latest Mysac (1.1.1).

I copied-pasted aped and libmod_spidermonkey.so

When running APE, I get this message:

root@server56405:/etc# [Module] Failed to load /ape_staging/modules/libmod_spidermonkey.so [Invalid library] (libmysac.so.0.0: cannot open shared object file: No such file or directory)

What should I do?

Pablo Tejada

unread,
Sep 2, 2014, 1:10:17 PM9/2/14
to ape-p...@googlegroups.com

I dont think you could just replace the MySac library. The API might have changed .

--
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to ape-p...@googlegroups.com
To unsubscribe from this group, send email to
ape-project...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

---
You received this message because you are subscribed to the Google Groups "APE Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ape-project...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nicolas

unread,
Sep 2, 2014, 1:13:20 PM9/2/14
to ape-p...@googlegroups.com
I remember compiling APE with version 0.9

and it worked.

But this does not seem to be the problem. It looks like I am missing a simlink, no?

Nicolas

unread,
Sep 2, 2014, 1:22:21 PM9/2/14
to ape-p...@googlegroups.com
Actually, I am not sure I ever recompiled with any other version than 0.4. That's what I recommended here:
but I might not have done it (as I did not have any issue).

This said, with my latest compile (normal compile from scratch with Mysac 0.4 version), I got this error message:

:TypeError: 0 is not a function

after calling some basic queries. This made me think of the bug that the mysac author had told me about (if the query returns NULL, mysac crashes). So, I wanted to try and get rid of this error by updating mysac. It may not be possible, you are right. 

But it looks like I have a simlink problem no?

Pablo Tejada

unread,
Sep 2, 2014, 2:19:43 PM9/2/14
to ape-p...@googlegroups.com
Im not proficient in C but it could be a simlink problem.

I don't have a dedicated server for APE so the way i made it work was by installing the MySQL package in my home directory.
Then modifying the Makefile in the modules directory to reference the installation lib directory:

 @$(CC) -L/home/xxxxxx/mysql/lib $(CFLAGS) $(CLFLAGS) $(DEBUGFLAGS) $(PROFILEFLAGS) -o lib/$(SPIDERMONKEYMOD) $< $(UDNS) $(FLAGS) $(MYSQL_FLAGS)

And on the bash_profile of the ssh account added this line which also references the the custom mysql lib directory:

export LD_LIBRARY_PATH=$HOME/mysql/lib

Hope it helps.

Nicolas

unread,
Sep 3, 2014, 5:44:34 AM9/3/14
to ape-p...@googlegroups.com
Thanks Pablo.

This looks a bit too complicated for me here. I have had a look at the Makefile but you probably changed it quite a bit so it makes it difficult for me to see what I would need to change. And I dont feel really comfortable here.

The good news is that I managed to recompile the main version and make it work. I was a little bit worried that I had broken my whole server.

I'll probably get in touch with the author of mysac (who might understand the problem better than me).

An alternative is for someone to have a look at it and recompile APE with the latest mysac. As I said, mysac has had many bug corrections (see http://www.arpalert.org/mysac.html). We use version 0.4. It would be really worth updating (as far as I am concerned, I probably have memory leaks in my application and it may come from mysac).

Thanks again.

Nicolas.

audebert christian

unread,
Sep 3, 2014, 6:45:44 AM9/3/14
to ape-p...@googlegroups.com

Try to Look at makefile to change                              makefile  found here :  https://searchcode.com/codesearch/view/7738778/

This line

libmysac.so: libmysac.a

         $(LD) -o libmysac.so -shared -soname libmysac.so.0.0 libmysac.a

 

Wich specifies libmysac version 0.0 and change it according to your library version.

You can found library  libmysac here. http://www.arpalert.org/mysac.html

 

If you can’t compil succesfully, get binaries to install. They work perfectly.

Other option : make a normal install , in VM, and test on it.

I was installed APE-SERVER 1.1.2 last month  on ubuntu 14.04 64 with mysql storage database moved in /home/mysql/mysql , and all work perfectly with binarys from the website ape-server.

 

Note :  i will ever be a newbe with linux. But, i’m searching, again, and again..

 

 

De : ape-p...@googlegroups.com [mailto:ape-p...@googlegroups.com] De la part de Pablo Tejada
Envoyé : mardi 2 septembre 2014 20:20
À : ape-p...@googlegroups.com
Objet : Re: [APE Project] Recompiling APE with latest Mysql... Error libmysac.so.0.0.

Nicolas

unread,
Sep 3, 2014, 7:04:52 AM9/3/14
to ape-p...@googlegroups.com
Thanks so much Christian.

I tried with version 1.1.1.

Should I change 0.0 to 1.1.1.?

What is weird is that mysac version was 0.4 in the first place not 0.0? So there is something wrong somewhere.

Nicolas

unread,
Sep 3, 2014, 7:09:45 AM9/3/14
to ape-p...@googlegroups.com
I suspect there might be version problems with my server (I work on my prod server).

I have a prod APE and a staging APE.

I am trying to recompile staging APE first.

But I suspect that the new staging APE is looking at the old libmysac.so?

Is it possible to have several versions of a .so on the same system?



audebert christian

unread,
Sep 3, 2014, 7:19:40 AM9/3/14
to ape-p...@googlegroups.com

Another way perhaps, look at this..

https://groups.google.com/forum/#!topic/ape-project/0_u3h_1fIaE

 

 

De : ape-p...@googlegroups.com [mailto:ape-p...@googlegroups.com] De la part de Nicolas
Envoyé : mercredi 3 septembre 2014 11:45


À : ape-p...@googlegroups.com
Objet : Re: [APE Project] Recompiling APE with latest Mysql... Error libmysac.so.0.0.

 

Thanks Pablo.

audebert christian

unread,
Sep 3, 2014, 7:47:52 AM9/3/14
to ape-p...@googlegroups.com

NEVER try on your production server !!

 

Test ALL on Virtual machine by exemple..

I have an oracle VirtualBox on my windows 7 computer with some linux virtual machine to test and try.

MAKE ALL your tests on virtual machine BEFORE !!

IT’S FREE !!  IT’S SECURE !! do  test and test again until you are SURE  that your way to do is ok  BEFORE applying it  on production server.

 

What do you will do if you broke your production server. ??

Can you repair it alone. ?? in delay ??  and your customers can stay with you if your server is down ??

Don’t tempt the stupid devil in each of us !!

 

I found other things who can be good for your problem

https://groups.google.com/forum/#!topic/ape-project/0_u3h_1fIaE

http://www.jochenhebbrecht.be/site/blogs/linux?page=3&order=created&sort=desc

http://www.techques.com/question/1-2560935/need-help-with-installing-shared-libraries-on-linux

 

search, try, but  NEVER TRY ON PRODUCTION SERVER !!!

 

De : ape-p...@googlegroups.com [mailto:ape-p...@googlegroups.com] De la part de Nicolas
Envoyé : mercredi 3 septembre 2014 13:10


À : ape-p...@googlegroups.com
Objet : Re: [APE Project] Recompiling APE with latest Mysql... Error libmysac.so.0.0.

 

I suspect there might be version problems with my server (I work on my prod server).

--

Nicolas

unread,
Sep 3, 2014, 7:50:33 AM9/3/14
to ape-p...@googlegroups.com
I changed the line to 

$(LD) -o libmysac.so -shared -soname libmysac.so.1.1.1 libmysac.a

Now if I look at libmod_spidermonkey.so by ldd libmod..., I get:

linux-vdso.so.1 =>  (0x00007fff4d989000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fc150e00000)
        libmysac.so.1.1.1 => not found              <---------------------------------------------------------------------------------------
        libmysqlclient_r.so.16 => /usr/lib/libmysqlclient_r.so.16 (0x00007fc1509ed000)
        libc.so.6 => /lib/libc.so.6 (0x00007fc150664000)
        libm.so.6 => /lib/libm.so.6 (0x00007fc1503e1000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc151648000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fc1501c9000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007fc14ffac000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007fc14fd73000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x00007fc14fb58000)
        libz.so.1 => /lib/libz.so.1 (0x00007fc14f941000)

The most surprizing here is that if I look at previous libmod_spidermonkey.so, there is no line for libmysac. This is really weird no?





Le mercredi 3 septembre 2014 11:45:44 UTC+1, christian audebert a écrit :

Nicolas

unread,
Sep 3, 2014, 8:08:09 AM9/3/14
to ape-p...@googlegroups.com
Thanks for all you have done. You are right on the production server.

I will now leave this issue on the side. It is probably a piece of cake to solve for someone who knows what he is doing, but that's not my case. Certainly, the guys who uploaded version 1.1.2 could find a solution quickly. Fingers crossed.

I'll try again to work with the release version and see if the Mysql error I got is really a problem or not. Just as a reminder, I get "0 is not a function" on one of my first calls to sql.query("SELECT 1") or sql.query("SET NAMES 'utf8'"). I really did not like that (first time I saw this error) and wanted to recompile for that reason.

Thanks again.

Nicolas.

Pablo Tejada

unread,
Sep 3, 2014, 8:10:43 AM9/3/14
to ape-p...@googlegroups.com

Nicolas,

At some point i did reached out to the mysac author but he inferred that APE server devs needed to update the library implementation. If I find the email i'll include it here.

As for using the production server to test recompiles I would not recommend it. You know you could run multiple APE instances from the same server, just need to bind them to different ports. This way you can test server in your production environment.

Nicolas

unread,
Sep 3, 2014, 8:14:08 AM9/3/14
to ape-p...@googlegroups.com
Thanks.

If APE needs to be rewritten to use latest versions of mysac, so be it. But maybe, we could use version 0.5 instead of 0.4 at least (I thought there was a 0.9 somewhere but I don't see it anymore).

As far as the production server is concerned, as I said earlier, I have two APE instances on different ports. I am only doing my experiments on the staging side. But that does not mean I can't break things down at all!

Thanks.

Edward Finlayson

unread,
Nov 24, 2014, 4:59:33 AM11/24/14
to ape-p...@googlegroups.com
Hi All,
I realise that this is quite an old thread but I though that I would share the results of my experiments with you.
I downloaded the latest version of the source code from the git repo, currently 1.1.3-DEV. Then after placing this code on my server, I cd'd into the modules/deps directory and got the latest version of the mysac with: wget http://www.arpalert.org/src/mysac-1.1.1.tar.gz , extracted with the usual tar zvxf mysac-1.1.1.tar.gz  and then when about getting it to compile. These are my changes:

modules/deps/mysac-1.1.1/Makefile:
    at line 21 change the MYSQL_LIB line to the following (because I'm running centos)
    # Use lib64 in the path below for fedora/centos/redhat type installs else use lib
         MYSQL_LIB := /usr/lib64/mysql
    
    at line 32 change the CFLAGS line to the following (the warnings being raised as errors were needless so redacted the -Werror switch)
    # Dissabled -Werror flag to silence strict fails.
    CFLAGS = -DBUILDVER=$(BUILDVER) -I$(MYSQL_INC) -O0 -g -Wall -fpic
 

modules/Makefile:
    at around line 20 changed line beginning with  MYSQL_DEP_DIR to (so that it point at the new version):
    MYSQL_DEP_DIR=deps/mysac-1.1.1
    changed the line beginning with MYSQL_LIB_DIR (again because I'm running centos) to (Make sure this points to the directory containing lmysqlclient_r):
    MYSQL_LIB_DIR := /usr/lib64/mysql
    changed the name of the dependancey in the line beginning with MYSQL_DEP (this has changed within mysac):
    MYSQL_DEP=$(MYSQL_DEP_DIR)/libmysac-static
    Ensured the MYSQL_FLAGS line pointed to the correct libraries:
    MYSQL_FLAGS=-L ./$(MYSQL_DEP_DIR)/ -L$(MYSQL_LIB_DIR) -I ./$(MYSQL_DEP_DIR)/ -lmysac-static -lmysqlclient_r

These few changes enabled me to compile ape 1.1.3 with libmysac 1.1.1 by using the build script alone. 
Please test my findings for yourselves as I would love to hear if this can now be put to bed by adopting these changes into the main build.

I suppose the acid test would be to drive MySQL via mysac-1.1.1, that is somehting I must admit I have not done.

I really hope that some finds this of some help/use and would like to ask any if they have ever managed to create a c module for libmemcached  

Cheers for now,

Fin

Edward Finlayson

unread,
Nov 24, 2014, 5:07:50 AM11/24/14
to ape-p...@googlegroups.com
BTW I forgot to mention. The line change mentioned above, regarding the following:

$(LD) -o libmysac.so -shared -soname libmysac.so.0.0 libmysac.a
Is somewhat of a red herring as it only has any bearing on the shared library (thus the -shared option and the .so in the -soname element). This is because, by default ape links against the static library and could not care less about the shared one, therefore it could be called anything you like and would affect the outcome. instead link against the static version as shown in my previous post.

Thanks,

Fin

Nicolas

unread,
Nov 24, 2014, 5:14:41 AM11/24/14
to ape-p...@googlegroups.com
Thanks so much for finding this Edward.

The author of mysac said to me that there were a few changes in the library with version 1.0 (APE used to use 0.4) so I am not sure if it will really work with a non-modified APE .

Worth a try now! Although I am not sure I will find the time to do this myself.

Thanks again.


Edward Finlayson

unread,
Nov 24, 2014, 5:19:27 AM11/24/14
to ape-p...@googlegroups.com
Hi Nicolas,
There are indeed a few function changes in 1.1.1, but all of those functions called be ape seam to be present. So as you say, it's certainly worth a try. 
I will put together a test script and give this a go this evening. I will post my finding here so that if it does work (and get rid of the NULL results set crash) then it could benefit everyone.

Fin
Reply all
Reply to author
Forward
0 new messages