maoyuan121 / elmah

Automatically exported from code.google.com/p/elmah
Apache License 2.0
0 stars 0 forks source link

MySql AllXml-column is too small #248

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Get an error on a page with a lot of text in the error message.

What is the expected output? What do you see instead?
The error is logged to the database but is truncated so I can't open it later 
on when I visit elmah.axd. 

What version of the product are you using? On what operating system?
Elmah 1.2, self compiled with a few modifications.

Please provide any additional information below.
The MySql AllXml-column is of type "text" which only handles up to 16kb of text 
which is enough for most cases but not all. It should be changed to 
"mediumtext" instead to be sure that the whole error log fits in it.

Original issue reported on code.google.com by karl.sjo...@gmail.com on 19 Aug 2011 at 9:08

GoogleCodeExporter commented 9 years ago

Original comment by azizatif on 18 Dec 2011 at 4:04

GoogleCodeExporter commented 9 years ago
What type of changes have you made? Does it add more data into the AllXML 
column? Just curious because I have never seen this problem and typically the 
16kb has been enough.

Also do you have the output or a dump of what is currently being stored in one 
of the columns that has overflowed?

Original comment by nberardi on 18 Dec 2011 at 8:58

GoogleCodeExporter commented 9 years ago
My changes were to remove the stored procedures and coding the sql queries 
directly into the mysql-classes since my host won't let me create stored 
procedures in the database.

I did a quick query and I have about 18 000 errors logged which are over 17 000 
bytes. I've already fixed my database with a "mediumtext" so I don't have any 
truncated values to show (they were simply cut off so the xml was invalid and 
crashed elmah.axd) but I've attached three samples that are all too large to 
fit in a standard "text" column.

Original comment by karl.sjo...@gmail.com on 18 Dec 2011 at 11:59

Attachments:

GoogleCodeExporter commented 9 years ago
Looks like MVC is creating some quite large stack traces there, so this is 
probably something that will need fixing!

I would suggest moving to LongText rather than MediumText though.
It seems from here: 
http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html
that the storage requirements are virtually the same (1 byte different)!!

Original comment by jamesdriscoll71 on 19 Dec 2011 at 11:23

GoogleCodeExporter commented 9 years ago
Also, I'm intrigued by the hosting policy of not allowing stored procedures.
I wonder if this is a common thing, or something that is particular to your 
host.

Just trying to get a gauge for the extent of the problem.
Any thoughts to offer??

Original comment by jamesdriscoll71 on 19 Dec 2011 at 11:26

GoogleCodeExporter commented 9 years ago
I've used 3 different hosts here in Sweden and none of them allowed stored 
procedures in mysql. One let me create the procedures but not execute them and 
the rest didn't even allow me to create them (which of course is the reasonable 
thing since creating without executing is pointless).

If you want I could share my modifications to elmah. I created a new 
ErrorLogger based on the standard mysql one so it isn't any large changes 
though.

Original comment by karl.sjo...@gmail.com on 19 Dec 2011 at 11:48

GoogleCodeExporter commented 9 years ago
Can you ask your host to enable it for you, or is this simply a blanket policy 
that they enforce regardless?

http://stackoverflow.com/a/1485047

http://stackoverflow.com/questions/6999800/mysql-stored-procedures-on-limited-sh
ared-hosting

Original comment by jamesdriscoll71 on 19 Dec 2011 at 11:56

GoogleCodeExporter commented 9 years ago
My earlier hosts wouldn't allow me to do it but I've never asked the current 
one. I've sent their support an email asking if it can be enabled. Will get 
back to you when I get an answer.

Original comment by karl.sjo...@gmail.com on 19 Dec 2011 at 2:09

GoogleCodeExporter commented 9 years ago
This is probably something we should tackle with the next release.  

Original comment by nberardi on 19 Dec 2011 at 2:12

GoogleCodeExporter commented 9 years ago
Below is the reply from my current host when I asked about using stored 
procedures on their servers.

----------
Hello,

Unfortunately this is something that require root access so you won't be able 
to use stored procedures in our environment.

Sorry if that causes problems.
----------

Now I'm pretty sure that root access isn't required and can be worked around 
but I'm not taking that discussion with them since we also can see from your 
samples from SO that this problem also exists elsewhere.

Original comment by karl.sjo...@gmail.com on 19 Dec 2011 at 7:34

GoogleCodeExporter commented 9 years ago
> If you want I could share my modifications to elmah. 
> I created a new ErrorLogger based on the standard mysql 
> one so it isn't any large changes though.

Feel free to contribute this to the ELMAH Sandbox[1] while this issue is being 
discussed.

[1] http://elmah-sandbox.googlecode.com

Original comment by azizatif on 19 Dec 2011 at 7:54

GoogleCodeExporter commented 9 years ago
> This is probably something we should tackle with the next release.

Do you mean the stored proc versus embedded SQL decision or do you mean this 
issue related to AllXml column being too small?

Original comment by azizatif on 19 Dec 2011 at 7:56