Re: Max Query Length Exceeded and Field Truncated

2010-03-21 Thread Alan Buxey
Hi,

  Our network had some change somewhere and now all MySQL insert queries
  are failing

someone edited the SQL query and messed it up?  use RCS/CVS/GIT or SVN for
code/config control.

 'localhost:652027', '', 'QUESCFARM', '0.0.0.0', '0', '10.0.64.10',
 '18060', 'oscar_telecom', '172.28.18.226', '12492', '196.31.63.118',
 '15830', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
 'sip:0823246912@;

that should end

'sip:0823246912@');   

surely?


alan

PS dont CC anyone who is also on this list...it kinda annoys them :-)
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: Max Query Length Exceeded and Field Truncated

2010-03-19 Thread Alan DeKok
Robert Gabriel wrote:
 Alan, I don't appreciate your harsh response. One comes to these lists
 for help not scorn and ridicule.

  One comes to this list for help, not friendship.  Short, pointed,
answers are helpful.  Sadly, many people think such answers are rude.

  Sorry.. but I don't have time to write long flowery answers.  And you
have no right to demand them, either.  This is a public mailing list,
where you may (or may not) get help for free.  Take what help you can get.

 Character count meaning the below and as stated above (IT WAS
 SHORTENED FOR BREVITY'S SAKE)

  I see.  You posted a question for help, and *misled us* about what you
were doing.

  And *I'm* the rude one?

  Here's a hint: when you ask for help, don't lie.  Post the information
that's requested, and take the actions that are suggested.  The only
people who get upset about following instructions are the people who
think flowery language is more important than solving their problem.

 so I didn't take up the whole post with
 log lines
 and surely now we can see it is 4KB in size (so it's 4096 bytes less
 the semicolon my mistake).
 
 Am I thinking a bit?

  Starting.

  But... you edited the queries.  And you *didn't* say this in your
original message.  Another lie of omission.

  Lying about what you're doing makes it difficult to help you.  And
yes, you will likely get upset about being told you're lying.  Tough.
It's unquestionably what you did, and unquestionably the reason why my
response was think about what you posted.  So you're upset at my
response because you are the one who started out with lies.

  In any case, you edited the queries to break the server.  Either fix
the queries so they're smaller, or poke the server source code to let it
use huge queries.  Since many of the assumptions in the code are that
the queries will be small, you may have to go spelunking through large
parts of the server to get huge queries to work.

  Good luck.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


RE: Max Query Length Exceeded and Field Truncated

2010-03-19 Thread Gary Gatten
*MAYBE* some people *COULD* be a little more... cordial at times, but - I'd 
rather have my problem solved harshly vs. getting the run around by people 
who *think* they know what they're doing.

When stuff is free you take what you can get.  I'm sure if one was to pay 
commercial level support fees, one could receive cordial / warm and fuzzy 
support.



-Original Message-
From: freeradius-users-bounces+ggatten=waddell@lists.freeradius.org 
[mailto:freeradius-users-bounces+ggatten=waddell@lists.freeradius.org] On 
Behalf Of Alan DeKok
Sent: Friday, March 19, 2010 9:22 AM
To: FreeRadius users mailing list
Subject: Re: Max Query Length Exceeded and Field Truncated

Robert Gabriel wrote:
 Alan, I don't appreciate your harsh response. One comes to these lists
 for help not scorn and ridicule.

  One comes to this list for help, not friendship.  Short, pointed,
answers are helpful.  Sadly, many people think such answers are rude.

  Sorry.. but I don't have time to write long flowery answers.  And you
have no right to demand them, either.  This is a public mailing list,
where you may (or may not) get help for free.  Take what help you can get.

 Character count meaning the below and as stated above (IT WAS
 SHORTENED FOR BREVITY'S SAKE)

  I see.  You posted a question for help, and *misled us* about what you
were doing.

  And *I'm* the rude one?

  Here's a hint: when you ask for help, don't lie.  Post the information
that's requested, and take the actions that are suggested.  The only
people who get upset about following instructions are the people who
think flowery language is more important than solving their problem.

 so I didn't take up the whole post with
 log lines
 and surely now we can see it is 4KB in size (so it's 4096 bytes less
 the semicolon my mistake).
 
 Am I thinking a bit?

  Starting.

  But... you edited the queries.  And you *didn't* say this in your
original message.  Another lie of omission.

  Lying about what you're doing makes it difficult to help you.  And
yes, you will likely get upset about being told you're lying.  Tough.
It's unquestionably what you did, and unquestionably the reason why my
response was think about what you posted.  So you're upset at my
response because you are the one who started out with lies.

  In any case, you edited the queries to break the server.  Either fix
the queries so they're smaller, or poke the server source code to let it
use huge queries.  Since many of the assumptions in the code are that
the queries will be small, you may have to go spelunking through large
parts of the server to get huge queries to work.

  Good luck.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html





font size=1
div style='border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 
1.0pt 0in'
/div
This email is intended to be reviewed by only the intended recipient
 and may contain information that is privileged and/or confidential.
 If you are not the intended recipient, you are hereby notified that
 any review, use, dissemination, disclosure or copying of this email
 and its attachments, if any, is strictly prohibited.  If you have
 received this email in error, please immediately notify the sender by
 return email and delete this email from your system.
/font


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Max Query Length Exceeded and Field Truncated

2010-03-18 Thread Robert Gabriel
Hello all,

Our network had some change somewhere and now all MySQL insert queries
are failing
with the last field been truncated and the character count is always
4097 from the CDRs
been sent by our NAS (Acme Packet SBC).

Having looked at the source we see:

src/modules/rlm_sql/conf.h
src/modules/rlm_sql/rlm_sql.c

 /* SQL defines */
 #define MAX_QUERY_LEN  4096
 #define SQL_LOCK_LEN   MAX_QUERY_LEN

I'm not sure here, can we just increase to 8192 etc. or is this being stupid?
Can I edit the above and recompile?

Unfortunately we are running FreeRADIUS 1.1.7 and yes, everyone must
be screaming upgrade!
Linux klio 2.6.24-21-server #1 SMP Wed Oct 22 00:18:13 UTC 2008 i686 GNU/Linux.
MySQL 5.0.51a-3ubuntu5.4-log.

I've looked at the above files in 2.1.8 and the values are the same.
Does this mean an upgrade will not fix this?
The RADIUS RFC says a maximum length of 4096, is this what we are
breaking or something else?

Please advise as to the best solution.



FreeRADIUS log:

Wed Mar 17 16:10:50 2010 : Error: rlm_sql_mysql: MySQL error 'You have
an error in your SQL syntax; check the manual that corresponds to y
our MySQL server version for the right syntax to use near
''sip:0827355...@hugetipjhb01' at line 1'

MySQL log (shortened for brevity's sake):

INSERT into accounting (AcctStatusType, AcctTerminateCause,
CalledStationId, NASIdentifier, h323setuptime, h323connecttime,
h323disconnecttime, h323disconnectcause) values ('0', '0', '0', '0',
'0', '0', '0', 'sip:0738063...@h


From the FreeRADIUS SQL trace (shortened for brevity's sake):

INSERT into accounting (AcctStatusType, AcctTerminateCause,
CalledStationId, NASIdentifier, h323setuptime, h323connecttime,
h323disconnecttime, h323disconnectcause,  CallingRTCPMaxLatency_FS1,
CallingRTPPacketsLost_FS1, CallingRTPAvgJitter_FS1,
CallingRTPMaxJitter_FS1, SessionIngressRealm, SessionEgressRealm,
SessionProtocolType) values ('196.31.63.118', '15830', '0', '0', '0',
'0', '0', '0', '0', '0', '0', '0', 'sip:0823246912@;
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: Max Query Length Exceeded and Field Truncated

2010-03-18 Thread Alan DeKok
Robert Gabriel wrote:
 Hello all,
 
 Our network had some change somewhere and now all MySQL insert queries
 are failing
 with the last field been truncated and the character count is always
 4097 from the CDRs

  What does that mean?  What's a character count?

 been sent by our NAS (Acme Packet SBC).
 
 Having looked at the source we see:
 
 src/modules/rlm_sql/conf.h
 src/modules/rlm_sql/rlm_sql.c
 
  /* SQL defines */
  #define MAX_QUERY_LEN4096
  #define SQL_LOCK_LEN MAX_QUERY_LEN
 
 I'm not sure here, can we just increase to 8192 etc. or is this being stupid?
 Can I edit the above and recompile?

  Yes.  But I fail to see why the SQL queries are huge.  There's really
no reason for this.

 MySQL log (shortened for brevity's sake):
 
 INSERT into accounting (AcctStatusType, AcctTerminateCause,
 CalledStationId, NASIdentifier, h323setuptime, h323connecttime,
 h323disconnecttime, h323disconnectcause) values ('0', '0', '0', '0',
 '0', '0', '0', 'sip:0738063...@h

  Think a bit: that line looks truncated, but there is NO WAY it's 4K in
size.

  Something else is going on.  Find out what, and fix it.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: Max Query Length Exceeded and Field Truncated

2010-03-18 Thread Robert Gabriel
On 18 March 2010 19:07, Alan DeKok al...@deployingradius.com wrote:
 Robert Gabriel wrote:
 Hello all,

 Our network had some change somewhere and now all MySQL insert queries
 are failing
 with the last field been truncated and the character count is always
 4097 from the CDRs

  What does that mean?  What's a character count?

 been sent by our NAS (Acme Packet SBC).

 Having looked at the source we see:

 src/modules/rlm_sql/conf.h
 src/modules/rlm_sql/rlm_sql.c

  /* SQL defines */
  #define MAX_QUERY_LEN                        4096
  #define SQL_LOCK_LEN                 MAX_QUERY_LEN

 I'm not sure here, can we just increase to 8192 etc. or is this being stupid?
 Can I edit the above and recompile?

  Yes.  But I fail to see why the SQL queries are huge.  There's really
 no reason for this.

 MySQL log (shortened for brevity's sake):

 INSERT into accounting (AcctStatusType, AcctTerminateCause,
 CalledStationId, NASIdentifier, h323setuptime, h323connecttime,
 h323disconnecttime, h323disconnectcause) values ('0', '0', '0', '0',
 '0', '0', '0', 'sip:0738063...@h

  Think a bit: that line looks truncated, but there is NO WAY it's 4K in
 size.

  Something else is going on.  Find out what, and fix it.

  Alan DeKok.
 -
 List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Alan, I don't appreciate your harsh response. One comes to these lists
for help not scorn and ridicule.

Character count meaning the below and as stated above (IT WAS
SHORTENED FOR BREVITY'S SAKE) so I didn't take up the whole post with
log lines
and surely now we can see it is 4KB in size (so it's 4096 bytes less
the semicolon my mistake).

Am I thinking a bit?

$ wc -c INSERT into accounting (AcctStatusType, AcctTerminateCause,
CalledStationId, NASIdentifier, h323setuptime, h323connecttime,
h323disconnecttime, h323disconnectcause, SessionGenericId,
FlowID_FS1_F, FlowType_FS1_F, SessionIngressCallId,
SessionEgressCallId, FlowInRealm_FS1_F, FlowInSrcAddr_FS1_F,
FlowInSrcPort_FS1_F, FlowInDstAddr_FS1_F, FlowInDstPort_FS1_F,
FlowOutRealm_FS1_F, FlowOutSrcAddr_FS1_F, FlowOutSrcPort_FS1_F,
FlowOutDstAddr_FS1_F, FlowOutDstPort_FS1_F, CallingOctets_FS1,
CallingPackets_FS1, CallingRTCPPacketsLost_FS1,
CallingRTCPAvgJitter_FS1, CallingRTCPAvgLatency_FS1,
CallingRTCPMaxJitter_FS1, CallingRTCPMaxLatency_FS1,
CallingRTPPacketsLost_FS1, CallingRTPAvgJitter_FS1,
CallingRTPMaxJitter_FS1, SessionIngressRealm, SessionEgressRealm,
SessionProtocolType, CalledOctets_FS1, CalledPackets_FS1,
CalledRTCPPacketsLost_FS1, CalledRTCPAvgJitter_FS1,
CalledRTCPAvgLatency_FS1, CalledRTCPMaxJitter_FS1,
CalledRTCPMaxLatency_FS1, CalledRTPPacketsLost_FS1,
CalledRTPAvgJitter_FS1, CalledRTPMaxJitter_FS1, SessionChargingVector,
SessionChargingFunction_Address, FirmwareVersion, LocalTimeZone,
PostDialDelay, CDRSequenceNumber, SessionDisposition,
DisconnectInitiator, DisconnectCause, Intermediate_Time,
PrimaryRoutingNumber, OriginatingTrunkGroup, TerminatingTrunkGroup,
OriginatingTrunkContext, TerminatingTrunkContext, PAssertedID,
SIPDiversion, SIPStatus, IngressLocalAddr, IngressRemoteAddr,
EgressLocalAddr, EgressRemoteAddr, FlowID_FS1_R, FlowType_FS1_R,
FlowInRealm_FS1_R, FlowInSrcAddr_FS1_R, FlowInSrcPort_FS1_R,
FlowInDstAddr_FS1_R, FlowInDstPort_FS1_R, FlowOutRealm_FS1_R,
FlowOutSrcAddr_FS1_R, FlowOutSrcPort_FS1_R, FlowOutDstAddr_FS1_R,
FlowOutDstPort_FS1_R, FlowID_FS2_F, FlowType_FS2_F, FlowInRealm_FS2_F,
FlowInSrcAddr_FS2_F, FlowInSrcPort_FS2_F, FlowInDstAddr_FS2_F,
FlowInDstPort_FS2_F, FlowOutRealm_FS2_F, FlowOutSrcAddr_FS2_F,
FlowOutSrcPort_FS2_F, FlowOutDstAddr_FS2_F, FlowOutDstPort_FS2_F,
CallingOctets_FS2, CallingPackets_FS2, CallingRTCPPacketsLost_FS2,
CallingRTCPAvgJitter_FS2, CallingRTCPAvgLatency_FS2,
CallingRTCPMaxJitter_FS2, CallingRTCPMaxLatency_FS2,
CallingRTPPacketsLost_FS2, CallingRTPAvgJitter_FS2,
CallingRTPMaxJitter_FS2, FlowID_FS2_R, FlowType_FS2_R,
FlowInRealm_FS2_R, FlowInSrcAddr_FS2_R, FlowInSrcPort_FS2_R,
FlowInDstAddr_FS2_R, FlowInDstPort_FS2_R, FlowOutRealm_FS2_R,
FlowOutSrcAddr_FS2_R, FlowOutSrcPort_FS2_R, FlowOutDstAddr_FS2_R,
FlowOutDstPort_FS2_R, CalledOctets_FS2, CalledPackets_FS2,
CalledRTCPPacketsLost_FS2, CalledRTCPAvgJitter_FS2,
CalledRTCPAvgLatency_FS2, CalledRTCPMaxJitter_FS2,
CalledRTCPMaxLatency_FS2, CalledRTPPacketsLost_FS2,
CalledRTPAvgJitter_FS2, CalledRTPMaxJitter_FS2,
EgressFinalRoutingNumber ) values ('Stop', 'User-Request',
'sip:27823246...@196.30.132.98:5060', 'acmepacket', '14:47:22.831
GMT+2 MAR 12 2010', '14:47:36.670 GMT+2 MAR 12 2010', '14:50:10.179
GMT+2 MAR 12 2010', '1', '', 'localhost:652024', 'G729',
'310075-3477386742-88...@nextone-msw.mydomain.com',
'310075-3477386742-88...@nextone-msw.mydomain.com', 'oscar_telecom',
'196.31.63.118', '15826', '172.28.18.226', '12450', 'QUESCFARM',
'10.0.64.10', '18334', '10.0.32.8', '11252', '624088', '7956', '72',
'215', '1784', '263', '2045', '41', '0', '45', 'oscar_telecom',
'QUESCFARM', 'SIP', '623574', '7945', '52', '3', '873', '4', '2047',
'60',