LSAPI bug causing site to stall?

aemadrid

Well-Known Member
#1
I get some errors installing the Ruby LSAPI gem (although it says it installed succesfully) and my Rails site does not respond. The access log reports the hit, and I can see that is being processed in the realtime admin report) but production.log does not report anything. Tried running webrick and it does work just fine so I am guessing there is a problem with the LSAPI.

UPDATE: Looks like even though the gem install says it was succesful it did not create lsapilib.so. What can I do to fix this? Are there any special requirements to build lsapi.so?

Server Specs
-------------------------------------------------------------
Red Hat Enterprise Linux ES release 2.1 (Panama)
LSWS 2.2 Standard
Ruby 1.8.4
Rails 1.1.6

Installing the gem:
-------------------------------------------------------------
# gem install ruby-lsapi
Building native extensions. This could take a while...
lsapilib.c: In function `LSAPI_ReqBodyGetLine_r':
lsapilib.c:778: parse error before `char'
lsapilib.c:780: `p' undeclared (first use in this function)
lsapilib.c:780: (Each undeclared identifier is reported only once
lsapilib.c:780: for each function it appears in.)
lsapilib.c:781: `pCur' undeclared (first use in this function)
make: *** [lsapilib.o] Error 1
lsapilib.c: In function `LSAPI_ReqBodyGetLine_r':
lsapilib.c:778: parse error before `char'
lsapilib.c:780: `p' undeclared (first use in this function)
lsapilib.c:780: (Each undeclared identifier is reported only once
lsapilib.c:780: for each function it appears in.)
lsapilib.c:781: `pCur' undeclared (first use in this function)
make: *** [lsapilib.o] Error 1
ruby extconf.rb install ruby-lsapi
checking for main() in -lsocket... no
creating Makefile

make
gcc -fPIC -g -O2 -I. -I/usr/local/lib/ruby/1.8/i686-linux -I/usr/local/lib/ruby/1.8/i686-linux -I. -c lsapilib.c

make install
gcc -fPIC -g -O2 -I. -I/usr/local/lib/ruby/1.8/i686-linux -I/usr/local/lib/ruby/1.8/i686-linux -I. -c lsapilib.c

make clean
Successfully installed ruby-lsapi-1.10

access.log:
-------------------------------------------------------------
1.2.3.4 - - [04/Oct/2006:15:44:19 -0700] "GET / HTTP/1.1" 503 401 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7" "admin.domain.com:6251"

stderror.log:
-------------------------------------------------------------
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- lsapi (MissingSourceFile)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /home/hyperxmedia.net/domains/admin.hyperxmedia.net/current/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:147:in `require'
from /usr/local/lsws/fcgi-bin/RailsRunner.rb:6
 
Last edited:

xing

LiteSpeed Staff
#2
LSAPI gem was unable to cleanly compile on your RH EL 2.1 system due to the errors shown in your gem setup stage.

Our linux test systems include Centos 4.4 and Ubuntu Breezy/Dapper.

It might be a compiler compatibility issue with the gcc that came with RHEL 2.1.

Can you give us the ouput of "rpm -qa | grep gcc".

In addition, if we cannot find a RHEL 2.1 iso to test in our vmware setup, we might need to login to your server to debug this error.
 

mistwang

LiteSpeed Staff
#4
It is because your C compiler is picky, the package has been updated to address this. gem version will be available a few hours later after mirror has been synced, the package on our web site has been updated.
 

aemadrid

Well-Known Member
#5
GCC info

LSAPI gem was unable to cleanly compile on your RH EL 2.1 system due to the errors shown in your gem setup stage.

Our linux test systems include Centos 4.4 and Ubuntu Breezy/Dapper.

It might be a compiler compatibility issue with the gcc that came with RHEL 2.1.

Can you give us the ouput of "rpm -qa | grep gcc".

In addition, if we cannot find a RHEL 2.1 iso to test in our vmware setup, we might need to login to your server to debug this error.
RH ES 2.1 is mainly ocmpatible with RH 7.3 I believe. I know when I can find an RPM for 2.1 I try 7.x and it works most of the times.

Here my gcc info:

# rpm -qa | grep gcc
gcc-2.96-129.7.2
gcc-c++-2.96-129.7.2
gcc-g77-2.96-129.7.2

---
AEM
 

aemadrid

Well-Known Member
#6
Working!

It is because your C compiler is picky, the package has been updated to address this. gem version will be available a few hours later after mirror has been synced, the package on our web site has been updated.
Thanks! I just tried installing the gem and it compiled just fine!

AEM
 

aemadrid

Well-Known Member
#7
ERROR! Domains cut short!

It is because your C compiler is picky, the package has been updated to address this. gem version will be available a few hours later after mirror has been synced, the package on our web site has been updated.
I was quick to point that the gem now compiled fine but seems to have a problem handling the domain of the request now. Here's the info:

Real Domain: admin.hyperxmedia.net

controller.request.domain : "admin.hyperxm"
controller.request.subdomains : []

I'm not a C programmer but the code that was having problems before looked like it was dealing with the domain. Could you please look at that?

Thanks,


Adrian Madrid
 

mistwang

LiteSpeed Staff
#8
Looks like something wrong with passing the request prarameter.
Can you please try the following code to dump the request parameters in a .rhtml file?

Code:
<%ENV.keys.sort.each do |key|%>
    <%=key%>=><%=ENV[key]%></br>
<%end%>
And post the result back. I need to get an idea about how bad the request parameters has been messed up.

Thanks.
 

aemadrid

Well-Known Member
#9
Report back

Here's the whole info:

DOCUMENT_ROOT => /home/mysecretdomain.com/domains/admin.mysecretdomain.com/rails/public
HTTP_ACCEPT => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP_ACCEPT_CHARSET => ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_ACCEPT_ENCODING => gzip,deflate
HTTP_ACCEPT_LANGUAGE => en-us,en;q=0.5
HTTP_CACHE_CONTROL => max-age=0
HTTP_CONNECTION => close
HTTP_COOKIE => _session_id=d86c15f55f3cf2c9f767c62942cf83c3
HTTP_HOST => admin.mysecretdomain.com:1234
HTTP_USER_AGENT => Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7
HTTP_X_FORWARDED_FOR => 4.5.6.7
HTTP_X_FORWARDED_HOST => admin.mysecre
HTTP_X_FORWARDED_SERV => admin.mysecre
PATH => /bin:/usr/bin
PATH_INFO => /
QUERY_STRING =>
RAILS_ENV => production
REMOTE_ADDR => 1.2.3.4
REMOTE_PORT => 54000
REQUEST_METHOD => GET
REQUEST_URI => /
SCRIPT_NAME => /
SERVER_ADDR => 1.2.3.4
SERVER_NAME => admin.mysecretdomain.com
SERVER_PORT => 1234
SERVER_PROTOCOL => HTTP/1.1
SERVER_SOFTWARE => LiteSpeed

PS: I changed some of the data to protect the innocent but I respected the lengths.
 

mistwang

LiteSpeed Staff
#10
Just released ruby-lsapi-1.11 to fix another bug in ruby LSAPI code, this bug causes incorrect value for " HTTP_X_FORWARDED_HOST" and " HTTP_X_FORWARDED_SERVER".
Gem version will take a little while to become availabe, you can download the latest version from our web site.
Thanks for your assistance.
 
Top