You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Travis Paul <Tr...@visPaul.me> on 2011/10/27 17:36:38 UTC

Binary logs?

Any idea why the couchdb logs in /var/log/couchdb are binary files? I have
to use *strings* or *grep -a* to do anything with them... just seemed
unusual.

Also, does anyone have a custom logwatch service for couchdb they would like
to share? I'm going to be making one tomorrow if I can't find an existing
service.

Thanks!

Re: Binary logs?

Posted by CGS <cg...@gmail.com>.
What's happening if with you tell less to open it anyway?



On 10/27/2011 06:06 PM, Robert Newson wrote:
> Grep has a heuristic to detect text vs. binary by examining the first
> part of the file. I'm curious to know what you have in, say, the first
> 100 bytes.
>
> couch.log is a text file, my guess is you have some strange characters
> in your log that is fooling grep.
>
> B.
>
> On 27 October 2011 16:59, Travis Paul<Tr...@vispaul.me>  wrote:
>> If I try grep without the -a flag such as:  *grep "Thu, 27 Oct 2011"
>> couch.log*
>> I get: *Binary file couch.log matches*
>>
>> tail, and head commands work as usual, but if I want to open the file in
>> gedit I have to do something like: *strings couch.log>  couch.log.text*
>>
>> less command complains as well: *"couch.log" may be a binary file.  See it
>> anyway?*
>>
>> On Thu, Oct 27, 2011 at 11:51 AM, Robert Newson<rn...@apache.org>  wrote:
>>
>>> couch.log is a text file with lines like;
>>>
>>> [Thu, 27 Oct 2011 10:30:57 GMT] [info] [<0.15397.1>] 127.0.0.1 - - GET
>>> /db1/doc1 200
>>>
>>> What are you seeing in there?
>>>
>>> B.
>>>
>>> On 27 October 2011 16:36, Travis Paul<Tr...@vispaul.me>  wrote:
>>>> Any idea why the couchdb logs in /var/log/couchdb are binary files? I
>>> have
>>>> to use *strings* or *grep -a* to do anything with them... just seemed
>>>> unusual.
>>>>
>>>> Also, does anyone have a custom logwatch service for couchdb they would
>>> like
>>>> to share? I'm going to be making one tomorrow if I can't find an existing
>>>> service.
>>>>
>>>> Thanks!
>>>>


Re: Binary logs?

Posted by CGS <cg...@gmail.com>.
Not at all. I would do the same. Just if he still needs that log for 
finding what was wrong during his tests, he still needs that log file. 
But now his problem is solved and he can check for the errors he was after.




On 10/27/2011 09:38 PM, Keith Gable wrote:
> Honestly, I'd rm the log and go on my way. Am I horrible?
> On Oct 27, 2011 2:34 PM, "CGS"<cg...@gmail.com>  wrote:
>
>> I don't know. It may be a core dump from Erlang or other things which went
>> wrong when you started CouchDB for the first time. It is hard to say if the
>> problem cannot be reproduced.
>>
>>
>>
>> On 10/27/2011 07:04 PM, Travis Paul wrote:
>>
>>> Yeah vim shows a screen full of ^@^@^@^@ characters too, deleting them
>>> lets
>>> me view it as a test file again, but I wonder how it they got there?
>>> My other couch logs have those characters as well (i.e couch.log.1)
>>>
>>> On Thu, Oct 27, 2011 at 12:57 PM, CGS<cg...@gmail.com>   wrote:
>>>
>>>   Try to open your file with vim and delete manually those chars at the top
>>>> of your file (somehow you accumulated garbage at the top of your file).
>>>> Save
>>>> it with another name if you want to keep the original (if you want next
>>>> time
>>>> not to repeat the operation, save it over the old file) and try grep
>>>> again.
>>>>
>>>>
>>>>
>>>>
>>>> On 10/27/2011 06:51 PM, Travis Paul wrote:
>>>>
>>>>   It is likely an error in my code somewhere, I'm not too concerned about
>>>>> those errors as that app is nothing serious and needs to be taken down
>>>>> anyways.
>>>>>
>>>>> As for opening with less I see a bunch of "^@^@^@^@" characters filling
>>>>> the
>>>>> screen (maybe this means something in less?) and if I scroll down I can
>>>>> see
>>>>> normal log messages.
>>>>>
>>>>> I opened the file with hexedit and to be honest, had no idea what I was
>>>>> looking for...
>>>>>
>>>>> Using *strings* or *grep -a* works for me so, I supposed it's not a
>>>>> major
>>>>>
>>>>> issue, I can share the log file if you are interested.
>>>>>
>>>>> Thanks for your help
>>>>>
>>>>>
>>>>> On Thu, Oct 27, 2011 at 12:33 PM, Robert Newson<rn...@apache.org>
>>>>>   wrote:
>>>>>
>>>>>   Those are all normal ASCII values, though. You might need to open the
>>>>>
>>>>>> file in a hex editor to examine it safely. Grep is likely scanning for
>>>>>> bytes over 127 at the beginning of the file.
>>>>>>
>>>>>> As for the error, it looks like couchjs is crashing in your list
>>>>>> function, so perhaps you have a syntax error in your code?
>>>>>>
>>>>>> B.
>>>>>>
>>>>>> On 27 October 2011 17:30, Travis Paul<Tr...@vispaul.me>    wrote:
>>>>>>
>>>>>>   I do see some errors that are probably making grep think the file is
>>>>>>>   binary
>>>>>>   and I pasted them here http://pastebin.com/rA9kHSNF if they are at
>>>>>>> all
>>>>>>>
>>>>>>>   of
>>>>>>   interest. I am unsure of their meaning.
>>>>>>> I encountered a 'bizarre' error that I want to catch, which occurred
>>>>>>> when
>>>>>>>
>>>>>>>   I
>>>>>>   accessed the _rewrite url  to a view and Couch returned a lot of plain
>>>>>>>   text
>>>>>>   that looked like a stack trace, which a page refresh corrected and I
>>>>>>> have
>>>>>>> not been able to recreate. I don't recall the date when I encountered
>>>>>>>
>>>>>>>   that
>>>>>>   error or what the error message looked like, so I'm not sure what to
>>>>>>> look
>>>>>>> for in old logs, but I never want a user to see it so I'm trying to
>>>>>>> catch
>>>>>>>
>>>>>>>   it
>>>>>>   to see if it was something that I did or possibly a bug.
>>>>>>>
>>>>>>> On Thu, Oct 27, 2011 at 12:06 PM, Robert Newson<rn...@apache.org>
>>>>>>>
>>>>>>>   wrote:
>>>>>>   Grep has a heuristic to detect text vs. binary by examining the first
>>>>>>>> part of the file. I'm curious to know what you have in, say, the
>>>>>>>> first
>>>>>>>> 100 bytes.
>>>>>>>>
>>>>>>>> couch.log is a text file, my guess is you have some strange
>>>>>>>> characters
>>>>>>>> in your log that is fooling grep.
>>>>>>>>
>>>>>>>> B.
>>>>>>>>
>>>>>>>> On 27 October 2011 16:59, Travis Paul<Tr...@vispaul.me>    wrote:
>>>>>>>>
>>>>>>>>   If I try grep without the -a flag such as:  *grep "Thu, 27 Oct 2011"
>>>>>>>>> couch.log*
>>>>>>>>> I get: *Binary file couch.log matches*
>>>>>>>>>
>>>>>>>>> tail, and head commands work as usual, but if I want to open the
>>>>>>>>> file
>>>>>>>>>
>>>>>>>>>   in
>>>>>>> gedit I have to do something like: *strings couch.log>
>>>>>>>
>>>>>>>> couch.log.text*
>>>>>>>>
>>>>>>> less command complains as well: *"couch.log" may be a binary file.
>>>>>>>
>>>>>>>>   See
>>>>>>>>
>>>>>>> it
>>>>>>>
>>>>>>>> anyway?*
>>>>>>>>> On Thu, Oct 27, 2011 at 11:51 AM, Robert Newson<rn...@apache.org>
>>>>>>>>>
>>>>>>>>>   wrote:
>>>>>>>>   couch.log is a text file with lines like;
>>>>>>>>>> [Thu, 27 Oct 2011 10:30:57 GMT] [info] [<0.15397.1>] 127.0.0.1 - -
>>>>>>>>>>
>>>>>>>>>>   GET
>>>>>>>>   /db1/doc1 200
>>>>>>>> What are you seeing in there?
>>>>>>>>>> B.
>>>>>>>>>>
>>>>>>>>>> On 27 October 2011 16:36, Travis Paul<Tr...@vispaul.me>    wrote:
>>>>>>>>>>
>>>>>>>>>>   Any idea why the couchdb logs in /var/log/couchdb are binary
>>>>>>>>>>> files?
>>>>>>>>>>>
>>>>>>>>>>>   I
>>>>>>>>>   have
>>>>>>>> to use *strings* or *grep -a* to do anything with them... just
>>>>>>>>>>>   seemed
>>>>>>>>>   unusual.
>>>>>>>> Also, does anyone have a custom logwatch service for couchdb they
>>>>>>>>>>>   would
>>>>>>>>> like
>>>>>>>>>
>>>>>>>>>> to share? I'm going to be making one tomorrow if I can't find an
>>>>>>>>>>>   existing
>>>>>>>>> service.
>>>>>>>>>
>>>>>>>>>> Thanks!
>>>>>>>>>>>
>>>>>>>>>>>


Re: Binary logs?

Posted by Keith Gable <zi...@ignition-project.com>.
Honestly, I'd rm the log and go on my way. Am I horrible?
On Oct 27, 2011 2:34 PM, "CGS" <cg...@gmail.com> wrote:

> I don't know. It may be a core dump from Erlang or other things which went
> wrong when you started CouchDB for the first time. It is hard to say if the
> problem cannot be reproduced.
>
>
>
> On 10/27/2011 07:04 PM, Travis Paul wrote:
>
>> Yeah vim shows a screen full of ^@^@^@^@ characters too, deleting them
>> lets
>> me view it as a test file again, but I wonder how it they got there?
>> My other couch logs have those characters as well (i.e couch.log.1)
>>
>> On Thu, Oct 27, 2011 at 12:57 PM, CGS<cg...@gmail.com>  wrote:
>>
>>  Try to open your file with vim and delete manually those chars at the top
>>> of your file (somehow you accumulated garbage at the top of your file).
>>> Save
>>> it with another name if you want to keep the original (if you want next
>>> time
>>> not to repeat the operation, save it over the old file) and try grep
>>> again.
>>>
>>>
>>>
>>>
>>> On 10/27/2011 06:51 PM, Travis Paul wrote:
>>>
>>>  It is likely an error in my code somewhere, I'm not too concerned about
>>>> those errors as that app is nothing serious and needs to be taken down
>>>> anyways.
>>>>
>>>> As for opening with less I see a bunch of "^@^@^@^@" characters filling
>>>> the
>>>> screen (maybe this means something in less?) and if I scroll down I can
>>>> see
>>>> normal log messages.
>>>>
>>>> I opened the file with hexedit and to be honest, had no idea what I was
>>>> looking for...
>>>>
>>>> Using *strings* or *grep -a* works for me so, I supposed it's not a
>>>> major
>>>>
>>>> issue, I can share the log file if you are interested.
>>>>
>>>> Thanks for your help
>>>>
>>>>
>>>> On Thu, Oct 27, 2011 at 12:33 PM, Robert Newson<rn...@apache.org>
>>>>  wrote:
>>>>
>>>>  Those are all normal ASCII values, though. You might need to open the
>>>>
>>>>> file in a hex editor to examine it safely. Grep is likely scanning for
>>>>> bytes over 127 at the beginning of the file.
>>>>>
>>>>> As for the error, it looks like couchjs is crashing in your list
>>>>> function, so perhaps you have a syntax error in your code?
>>>>>
>>>>> B.
>>>>>
>>>>> On 27 October 2011 17:30, Travis Paul<Tr...@vispaul.me>   wrote:
>>>>>
>>>>>  I do see some errors that are probably making grep think the file is
>>>>>>
>>>>>>  binary
>>>>>
>>>>>  and I pasted them here http://pastebin.com/rA9kHSNF if they are at
>>>>>> all
>>>>>>
>>>>>>  of
>>>>>
>>>>>  interest. I am unsure of their meaning.
>>>>>>
>>>>>> I encountered a 'bizarre' error that I want to catch, which occurred
>>>>>> when
>>>>>>
>>>>>>  I
>>>>>
>>>>>  accessed the _rewrite url  to a view and Couch returned a lot of plain
>>>>>>
>>>>>>  text
>>>>>
>>>>>  that looked like a stack trace, which a page refresh corrected and I
>>>>>> have
>>>>>> not been able to recreate. I don't recall the date when I encountered
>>>>>>
>>>>>>  that
>>>>>
>>>>>  error or what the error message looked like, so I'm not sure what to
>>>>>> look
>>>>>> for in old logs, but I never want a user to see it so I'm trying to
>>>>>> catch
>>>>>>
>>>>>>  it
>>>>>
>>>>>  to see if it was something that I did or possibly a bug.
>>>>>>
>>>>>>
>>>>>> On Thu, Oct 27, 2011 at 12:06 PM, Robert Newson<rn...@apache.org>
>>>>>>
>>>>>>  wrote:
>>>>>
>>>>>  Grep has a heuristic to detect text vs. binary by examining the first
>>>>>>
>>>>>>> part of the file. I'm curious to know what you have in, say, the
>>>>>>> first
>>>>>>> 100 bytes.
>>>>>>>
>>>>>>> couch.log is a text file, my guess is you have some strange
>>>>>>> characters
>>>>>>> in your log that is fooling grep.
>>>>>>>
>>>>>>> B.
>>>>>>>
>>>>>>> On 27 October 2011 16:59, Travis Paul<Tr...@vispaul.me>   wrote:
>>>>>>>
>>>>>>>  If I try grep without the -a flag such as:  *grep "Thu, 27 Oct 2011"
>>>>>>>> couch.log*
>>>>>>>> I get: *Binary file couch.log matches*
>>>>>>>>
>>>>>>>> tail, and head commands work as usual, but if I want to open the
>>>>>>>> file
>>>>>>>>
>>>>>>>>  in
>>>>>>>
>>>>>> gedit I have to do something like: *strings couch.log>
>>>>>>
>>>>>>> couch.log.text*
>>>>>>>
>>>>>> less command complains as well: *"couch.log" may be a binary file.
>>>>>>
>>>>>>>  See
>>>>>>>
>>>>>> it
>>>>>>
>>>>>>> anyway?*
>>>>>>>>
>>>>>>>> On Thu, Oct 27, 2011 at 11:51 AM, Robert Newson<rn...@apache.org>
>>>>>>>>
>>>>>>>>  wrote:
>>>>>>>
>>>>>>>  couch.log is a text file with lines like;
>>>>>>>>
>>>>>>>>> [Thu, 27 Oct 2011 10:30:57 GMT] [info] [<0.15397.1>] 127.0.0.1 - -
>>>>>>>>>
>>>>>>>>>  GET
>>>>>>>>
>>>>>>>  /db1/doc1 200
>>>>>>
>>>>>>> What are you seeing in there?
>>>>>>>>>
>>>>>>>>> B.
>>>>>>>>>
>>>>>>>>> On 27 October 2011 16:36, Travis Paul<Tr...@vispaul.me>   wrote:
>>>>>>>>>
>>>>>>>>>  Any idea why the couchdb logs in /var/log/couchdb are binary
>>>>>>>>>> files?
>>>>>>>>>>
>>>>>>>>>>  I
>>>>>>>>>
>>>>>>>>  have
>>>>>>
>>>>>>> to use *strings* or *grep -a* to do anything with them... just
>>>>>>>>>>
>>>>>>>>>>  seemed
>>>>>>>>>
>>>>>>>>  unusual.
>>>>>>
>>>>>>> Also, does anyone have a custom logwatch service for couchdb they
>>>>>>>>>>
>>>>>>>>>>  would
>>>>>>>>>
>>>>>>>> like
>>>>>>>>
>>>>>>>>> to share? I'm going to be making one tomorrow if I can't find an
>>>>>>>>>>
>>>>>>>>>>  existing
>>>>>>>>>
>>>>>>>> service.
>>>>>>>>
>>>>>>>>> Thanks!
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>

Re: Binary logs?

Posted by CGS <cg...@gmail.com>.
I don't know. It may be a core dump from Erlang or other things which 
went wrong when you started CouchDB for the first time. It is hard to 
say if the problem cannot be reproduced.



On 10/27/2011 07:04 PM, Travis Paul wrote:
> Yeah vim shows a screen full of ^@^@^@^@ characters too, deleting them lets
> me view it as a test file again, but I wonder how it they got there?
> My other couch logs have those characters as well (i.e couch.log.1)
>
> On Thu, Oct 27, 2011 at 12:57 PM, CGS<cg...@gmail.com>  wrote:
>
>> Try to open your file with vim and delete manually those chars at the top
>> of your file (somehow you accumulated garbage at the top of your file). Save
>> it with another name if you want to keep the original (if you want next time
>> not to repeat the operation, save it over the old file) and try grep again.
>>
>>
>>
>>
>> On 10/27/2011 06:51 PM, Travis Paul wrote:
>>
>>> It is likely an error in my code somewhere, I'm not too concerned about
>>> those errors as that app is nothing serious and needs to be taken down
>>> anyways.
>>>
>>> As for opening with less I see a bunch of "^@^@^@^@" characters filling
>>> the
>>> screen (maybe this means something in less?) and if I scroll down I can
>>> see
>>> normal log messages.
>>>
>>> I opened the file with hexedit and to be honest, had no idea what I was
>>> looking for...
>>>
>>> Using *strings* or *grep -a* works for me so, I supposed it's not a major
>>>
>>> issue, I can share the log file if you are interested.
>>>
>>> Thanks for your help
>>>
>>>
>>> On Thu, Oct 27, 2011 at 12:33 PM, Robert Newson<rn...@apache.org>
>>>   wrote:
>>>
>>>   Those are all normal ASCII values, though. You might need to open the
>>>> file in a hex editor to examine it safely. Grep is likely scanning for
>>>> bytes over 127 at the beginning of the file.
>>>>
>>>> As for the error, it looks like couchjs is crashing in your list
>>>> function, so perhaps you have a syntax error in your code?
>>>>
>>>> B.
>>>>
>>>> On 27 October 2011 17:30, Travis Paul<Tr...@vispaul.me>   wrote:
>>>>
>>>>> I do see some errors that are probably making grep think the file is
>>>>>
>>>> binary
>>>>
>>>>> and I pasted them here http://pastebin.com/rA9kHSNF if they are at all
>>>>>
>>>> of
>>>>
>>>>> interest. I am unsure of their meaning.
>>>>>
>>>>> I encountered a 'bizarre' error that I want to catch, which occurred
>>>>> when
>>>>>
>>>> I
>>>>
>>>>> accessed the _rewrite url  to a view and Couch returned a lot of plain
>>>>>
>>>> text
>>>>
>>>>> that looked like a stack trace, which a page refresh corrected and I
>>>>> have
>>>>> not been able to recreate. I don't recall the date when I encountered
>>>>>
>>>> that
>>>>
>>>>> error or what the error message looked like, so I'm not sure what to
>>>>> look
>>>>> for in old logs, but I never want a user to see it so I'm trying to
>>>>> catch
>>>>>
>>>> it
>>>>
>>>>> to see if it was something that I did or possibly a bug.
>>>>>
>>>>>
>>>>> On Thu, Oct 27, 2011 at 12:06 PM, Robert Newson<rn...@apache.org>
>>>>>
>>>> wrote:
>>>>
>>>>> Grep has a heuristic to detect text vs. binary by examining the first
>>>>>> part of the file. I'm curious to know what you have in, say, the first
>>>>>> 100 bytes.
>>>>>>
>>>>>> couch.log is a text file, my guess is you have some strange characters
>>>>>> in your log that is fooling grep.
>>>>>>
>>>>>> B.
>>>>>>
>>>>>> On 27 October 2011 16:59, Travis Paul<Tr...@vispaul.me>   wrote:
>>>>>>
>>>>>>> If I try grep without the -a flag such as:  *grep "Thu, 27 Oct 2011"
>>>>>>> couch.log*
>>>>>>> I get: *Binary file couch.log matches*
>>>>>>>
>>>>>>> tail, and head commands work as usual, but if I want to open the file
>>>>>>>
>>>>>> in
>>>>> gedit I have to do something like: *strings couch.log>
>>>>>> couch.log.text*
>>>>> less command complains as well: *"couch.log" may be a binary file.
>>>>>>   See
>>>>> it
>>>>>>> anyway?*
>>>>>>>
>>>>>>> On Thu, Oct 27, 2011 at 11:51 AM, Robert Newson<rn...@apache.org>
>>>>>>>
>>>>>> wrote:
>>>>>>
>>>>>>> couch.log is a text file with lines like;
>>>>>>>> [Thu, 27 Oct 2011 10:30:57 GMT] [info] [<0.15397.1>] 127.0.0.1 - -
>>>>>>>>
>>>>>>> GET
>>>>>   /db1/doc1 200
>>>>>>>> What are you seeing in there?
>>>>>>>>
>>>>>>>> B.
>>>>>>>>
>>>>>>>> On 27 October 2011 16:36, Travis Paul<Tr...@vispaul.me>   wrote:
>>>>>>>>
>>>>>>>>> Any idea why the couchdb logs in /var/log/couchdb are binary files?
>>>>>>>>>
>>>>>>>> I
>>>>>   have
>>>>>>>>> to use *strings* or *grep -a* to do anything with them... just
>>>>>>>>>
>>>>>>>> seemed
>>>>>   unusual.
>>>>>>>>> Also, does anyone have a custom logwatch service for couchdb they
>>>>>>>>>
>>>>>>>> would
>>>>>>> like
>>>>>>>>> to share? I'm going to be making one tomorrow if I can't find an
>>>>>>>>>
>>>>>>>> existing
>>>>>>> service.
>>>>>>>>> Thanks!
>>>>>>>>>
>>>>>>>>>


Re: Binary logs?

Posted by Travis Paul <Tr...@visPaul.me>.
Yeah vim shows a screen full of ^@^@^@^@ characters too, deleting them lets
me view it as a test file again, but I wonder how it they got there?
My other couch logs have those characters as well (i.e couch.log.1)

On Thu, Oct 27, 2011 at 12:57 PM, CGS <cg...@gmail.com> wrote:

> Try to open your file with vim and delete manually those chars at the top
> of your file (somehow you accumulated garbage at the top of your file). Save
> it with another name if you want to keep the original (if you want next time
> not to repeat the operation, save it over the old file) and try grep again.
>
>
>
>
> On 10/27/2011 06:51 PM, Travis Paul wrote:
>
>> It is likely an error in my code somewhere, I'm not too concerned about
>> those errors as that app is nothing serious and needs to be taken down
>> anyways.
>>
>> As for opening with less I see a bunch of "^@^@^@^@" characters filling
>> the
>> screen (maybe this means something in less?) and if I scroll down I can
>> see
>> normal log messages.
>>
>> I opened the file with hexedit and to be honest, had no idea what I was
>> looking for...
>>
>> Using *strings* or *grep -a* works for me so, I supposed it's not a major
>>
>> issue, I can share the log file if you are interested.
>>
>> Thanks for your help
>>
>>
>> On Thu, Oct 27, 2011 at 12:33 PM, Robert Newson<rn...@apache.org>
>>  wrote:
>>
>>  Those are all normal ASCII values, though. You might need to open the
>>> file in a hex editor to examine it safely. Grep is likely scanning for
>>> bytes over 127 at the beginning of the file.
>>>
>>> As for the error, it looks like couchjs is crashing in your list
>>> function, so perhaps you have a syntax error in your code?
>>>
>>> B.
>>>
>>> On 27 October 2011 17:30, Travis Paul<Tr...@vispaul.me>  wrote:
>>>
>>>> I do see some errors that are probably making grep think the file is
>>>>
>>> binary
>>>
>>>> and I pasted them here http://pastebin.com/rA9kHSNF if they are at all
>>>>
>>> of
>>>
>>>> interest. I am unsure of their meaning.
>>>>
>>>> I encountered a 'bizarre' error that I want to catch, which occurred
>>>> when
>>>>
>>> I
>>>
>>>> accessed the _rewrite url  to a view and Couch returned a lot of plain
>>>>
>>> text
>>>
>>>> that looked like a stack trace, which a page refresh corrected and I
>>>> have
>>>> not been able to recreate. I don't recall the date when I encountered
>>>>
>>> that
>>>
>>>> error or what the error message looked like, so I'm not sure what to
>>>> look
>>>> for in old logs, but I never want a user to see it so I'm trying to
>>>> catch
>>>>
>>> it
>>>
>>>> to see if it was something that I did or possibly a bug.
>>>>
>>>>
>>>> On Thu, Oct 27, 2011 at 12:06 PM, Robert Newson<rn...@apache.org>
>>>>
>>> wrote:
>>>
>>>> Grep has a heuristic to detect text vs. binary by examining the first
>>>>> part of the file. I'm curious to know what you have in, say, the first
>>>>> 100 bytes.
>>>>>
>>>>> couch.log is a text file, my guess is you have some strange characters
>>>>> in your log that is fooling grep.
>>>>>
>>>>> B.
>>>>>
>>>>> On 27 October 2011 16:59, Travis Paul<Tr...@vispaul.me>  wrote:
>>>>>
>>>>>> If I try grep without the -a flag such as:  *grep "Thu, 27 Oct 2011"
>>>>>> couch.log*
>>>>>> I get: *Binary file couch.log matches*
>>>>>>
>>>>>> tail, and head commands work as usual, but if I want to open the file
>>>>>>
>>>>> in
>>>
>>>> gedit I have to do something like: *strings couch.log>
>>>>>>
>>>>> couch.log.text*
>>>
>>>> less command complains as well: *"couch.log" may be a binary file.
>>>>>>
>>>>>  See
>>>
>>>> it
>>>>>
>>>>>> anyway?*
>>>>>>
>>>>>> On Thu, Oct 27, 2011 at 11:51 AM, Robert Newson<rn...@apache.org>
>>>>>>
>>>>> wrote:
>>>>>
>>>>>> couch.log is a text file with lines like;
>>>>>>>
>>>>>>> [Thu, 27 Oct 2011 10:30:57 GMT] [info] [<0.15397.1>] 127.0.0.1 - -
>>>>>>>
>>>>>> GET
>>>
>>>>  /db1/doc1 200
>>>>>>>
>>>>>>> What are you seeing in there?
>>>>>>>
>>>>>>> B.
>>>>>>>
>>>>>>> On 27 October 2011 16:36, Travis Paul<Tr...@vispaul.me>  wrote:
>>>>>>>
>>>>>>>> Any idea why the couchdb logs in /var/log/couchdb are binary files?
>>>>>>>>
>>>>>>> I
>>>
>>>>  have
>>>>>>>
>>>>>>>> to use *strings* or *grep -a* to do anything with them... just
>>>>>>>>
>>>>>>> seemed
>>>
>>>>  unusual.
>>>>>>>>
>>>>>>>> Also, does anyone have a custom logwatch service for couchdb they
>>>>>>>>
>>>>>>> would
>>>>>
>>>>>> like
>>>>>>>
>>>>>>>> to share? I'm going to be making one tomorrow if I can't find an
>>>>>>>>
>>>>>>> existing
>>>>>
>>>>>> service.
>>>>>>>>
>>>>>>>> Thanks!
>>>>>>>>
>>>>>>>>
>

Re: Binary logs?

Posted by CGS <cg...@gmail.com>.
Try to open your file with vim and delete manually those chars at the 
top of your file (somehow you accumulated garbage at the top of your 
file). Save it with another name if you want to keep the original (if 
you want next time not to repeat the operation, save it over the old 
file) and try grep again.



On 10/27/2011 06:51 PM, Travis Paul wrote:
> It is likely an error in my code somewhere, I'm not too concerned about
> those errors as that app is nothing serious and needs to be taken down
> anyways.
>
> As for opening with less I see a bunch of "^@^@^@^@" characters filling the
> screen (maybe this means something in less?) and if I scroll down I can see
> normal log messages.
>
> I opened the file with hexedit and to be honest, had no idea what I was
> looking for...
>
> Using *strings* or *grep -a* works for me so, I supposed it's not a major
> issue, I can share the log file if you are interested.
>
> Thanks for your help
>
>
> On Thu, Oct 27, 2011 at 12:33 PM, Robert Newson<rn...@apache.org>  wrote:
>
>> Those are all normal ASCII values, though. You might need to open the
>> file in a hex editor to examine it safely. Grep is likely scanning for
>> bytes over 127 at the beginning of the file.
>>
>> As for the error, it looks like couchjs is crashing in your list
>> function, so perhaps you have a syntax error in your code?
>>
>> B.
>>
>> On 27 October 2011 17:30, Travis Paul<Tr...@vispaul.me>  wrote:
>>> I do see some errors that are probably making grep think the file is
>> binary
>>> and I pasted them here http://pastebin.com/rA9kHSNF if they are at all
>> of
>>> interest. I am unsure of their meaning.
>>>
>>> I encountered a 'bizarre' error that I want to catch, which occurred when
>> I
>>> accessed the _rewrite url  to a view and Couch returned a lot of plain
>> text
>>> that looked like a stack trace, which a page refresh corrected and I have
>>> not been able to recreate. I don't recall the date when I encountered
>> that
>>> error or what the error message looked like, so I'm not sure what to look
>>> for in old logs, but I never want a user to see it so I'm trying to catch
>> it
>>> to see if it was something that I did or possibly a bug.
>>>
>>>
>>> On Thu, Oct 27, 2011 at 12:06 PM, Robert Newson<rn...@apache.org>
>> wrote:
>>>> Grep has a heuristic to detect text vs. binary by examining the first
>>>> part of the file. I'm curious to know what you have in, say, the first
>>>> 100 bytes.
>>>>
>>>> couch.log is a text file, my guess is you have some strange characters
>>>> in your log that is fooling grep.
>>>>
>>>> B.
>>>>
>>>> On 27 October 2011 16:59, Travis Paul<Tr...@vispaul.me>  wrote:
>>>>> If I try grep without the -a flag such as:  *grep "Thu, 27 Oct 2011"
>>>>> couch.log*
>>>>> I get: *Binary file couch.log matches*
>>>>>
>>>>> tail, and head commands work as usual, but if I want to open the file
>> in
>>>>> gedit I have to do something like: *strings couch.log>
>> couch.log.text*
>>>>> less command complains as well: *"couch.log" may be a binary file.
>>   See
>>>> it
>>>>> anyway?*
>>>>>
>>>>> On Thu, Oct 27, 2011 at 11:51 AM, Robert Newson<rn...@apache.org>
>>>> wrote:
>>>>>> couch.log is a text file with lines like;
>>>>>>
>>>>>> [Thu, 27 Oct 2011 10:30:57 GMT] [info] [<0.15397.1>] 127.0.0.1 - -
>> GET
>>>>>> /db1/doc1 200
>>>>>>
>>>>>> What are you seeing in there?
>>>>>>
>>>>>> B.
>>>>>>
>>>>>> On 27 October 2011 16:36, Travis Paul<Tr...@vispaul.me>  wrote:
>>>>>>> Any idea why the couchdb logs in /var/log/couchdb are binary files?
>> I
>>>>>> have
>>>>>>> to use *strings* or *grep -a* to do anything with them... just
>> seemed
>>>>>>> unusual.
>>>>>>>
>>>>>>> Also, does anyone have a custom logwatch service for couchdb they
>>>> would
>>>>>> like
>>>>>>> to share? I'm going to be making one tomorrow if I can't find an
>>>> existing
>>>>>>> service.
>>>>>>>
>>>>>>> Thanks!
>>>>>>>


Re: Binary logs?

Posted by Travis Paul <Tr...@visPaul.me>.
It is likely an error in my code somewhere, I'm not too concerned about
those errors as that app is nothing serious and needs to be taken down
anyways.

As for opening with less I see a bunch of "^@^@^@^@" characters filling the
screen (maybe this means something in less?) and if I scroll down I can see
normal log messages.

I opened the file with hexedit and to be honest, had no idea what I was
looking for...

Using *strings* or *grep -a* works for me so, I supposed it's not a major
issue, I can share the log file if you are interested.

Thanks for your help


On Thu, Oct 27, 2011 at 12:33 PM, Robert Newson <rn...@apache.org> wrote:

> Those are all normal ASCII values, though. You might need to open the
> file in a hex editor to examine it safely. Grep is likely scanning for
> bytes over 127 at the beginning of the file.
>
> As for the error, it looks like couchjs is crashing in your list
> function, so perhaps you have a syntax error in your code?
>
> B.
>
> On 27 October 2011 17:30, Travis Paul <Tr...@vispaul.me> wrote:
> > I do see some errors that are probably making grep think the file is
> binary
> > and I pasted them here http://pastebin.com/rA9kHSNF if they are at all
> of
> > interest. I am unsure of their meaning.
> >
> > I encountered a 'bizarre' error that I want to catch, which occurred when
> I
> > accessed the _rewrite url  to a view and Couch returned a lot of plain
> text
> > that looked like a stack trace, which a page refresh corrected and I have
> > not been able to recreate. I don't recall the date when I encountered
> that
> > error or what the error message looked like, so I'm not sure what to look
> > for in old logs, but I never want a user to see it so I'm trying to catch
> it
> > to see if it was something that I did or possibly a bug.
> >
> >
> > On Thu, Oct 27, 2011 at 12:06 PM, Robert Newson <rn...@apache.org>
> wrote:
> >
> >> Grep has a heuristic to detect text vs. binary by examining the first
> >> part of the file. I'm curious to know what you have in, say, the first
> >> 100 bytes.
> >>
> >> couch.log is a text file, my guess is you have some strange characters
> >> in your log that is fooling grep.
> >>
> >> B.
> >>
> >> On 27 October 2011 16:59, Travis Paul <Tr...@vispaul.me> wrote:
> >> > If I try grep without the -a flag such as:  *grep "Thu, 27 Oct 2011"
> >> > couch.log*
> >> > I get: *Binary file couch.log matches*
> >> >
> >> > tail, and head commands work as usual, but if I want to open the file
> in
> >> > gedit I have to do something like: *strings couch.log >
> couch.log.text*
> >> >
> >> > less command complains as well: *"couch.log" may be a binary file.
>  See
> >> it
> >> > anyway?*
> >> >
> >> > On Thu, Oct 27, 2011 at 11:51 AM, Robert Newson <rn...@apache.org>
> >> wrote:
> >> >
> >> >> couch.log is a text file with lines like;
> >> >>
> >> >> [Thu, 27 Oct 2011 10:30:57 GMT] [info] [<0.15397.1>] 127.0.0.1 - -
> GET
> >> >> /db1/doc1 200
> >> >>
> >> >> What are you seeing in there?
> >> >>
> >> >> B.
> >> >>
> >> >> On 27 October 2011 16:36, Travis Paul <Tr...@vispaul.me> wrote:
> >> >> > Any idea why the couchdb logs in /var/log/couchdb are binary files?
> I
> >> >> have
> >> >> > to use *strings* or *grep -a* to do anything with them... just
> seemed
> >> >> > unusual.
> >> >> >
> >> >> > Also, does anyone have a custom logwatch service for couchdb they
> >> would
> >> >> like
> >> >> > to share? I'm going to be making one tomorrow if I can't find an
> >> existing
> >> >> > service.
> >> >> >
> >> >> > Thanks!
> >> >> >
> >> >>
> >> >
> >>
> >
>

Re: Binary logs?

Posted by Robert Newson <rn...@apache.org>.
Those are all normal ASCII values, though. You might need to open the
file in a hex editor to examine it safely. Grep is likely scanning for
bytes over 127 at the beginning of the file.

As for the error, it looks like couchjs is crashing in your list
function, so perhaps you have a syntax error in your code?

B.

On 27 October 2011 17:30, Travis Paul <Tr...@vispaul.me> wrote:
> I do see some errors that are probably making grep think the file is binary
> and I pasted them here http://pastebin.com/rA9kHSNF if they are at all of
> interest. I am unsure of their meaning.
>
> I encountered a 'bizarre' error that I want to catch, which occurred when I
> accessed the _rewrite url  to a view and Couch returned a lot of plain text
> that looked like a stack trace, which a page refresh corrected and I have
> not been able to recreate. I don't recall the date when I encountered that
> error or what the error message looked like, so I'm not sure what to look
> for in old logs, but I never want a user to see it so I'm trying to catch it
> to see if it was something that I did or possibly a bug.
>
>
> On Thu, Oct 27, 2011 at 12:06 PM, Robert Newson <rn...@apache.org> wrote:
>
>> Grep has a heuristic to detect text vs. binary by examining the first
>> part of the file. I'm curious to know what you have in, say, the first
>> 100 bytes.
>>
>> couch.log is a text file, my guess is you have some strange characters
>> in your log that is fooling grep.
>>
>> B.
>>
>> On 27 October 2011 16:59, Travis Paul <Tr...@vispaul.me> wrote:
>> > If I try grep without the -a flag such as:  *grep "Thu, 27 Oct 2011"
>> > couch.log*
>> > I get: *Binary file couch.log matches*
>> >
>> > tail, and head commands work as usual, but if I want to open the file in
>> > gedit I have to do something like: *strings couch.log > couch.log.text*
>> >
>> > less command complains as well: *"couch.log" may be a binary file.  See
>> it
>> > anyway?*
>> >
>> > On Thu, Oct 27, 2011 at 11:51 AM, Robert Newson <rn...@apache.org>
>> wrote:
>> >
>> >> couch.log is a text file with lines like;
>> >>
>> >> [Thu, 27 Oct 2011 10:30:57 GMT] [info] [<0.15397.1>] 127.0.0.1 - - GET
>> >> /db1/doc1 200
>> >>
>> >> What are you seeing in there?
>> >>
>> >> B.
>> >>
>> >> On 27 October 2011 16:36, Travis Paul <Tr...@vispaul.me> wrote:
>> >> > Any idea why the couchdb logs in /var/log/couchdb are binary files? I
>> >> have
>> >> > to use *strings* or *grep -a* to do anything with them... just seemed
>> >> > unusual.
>> >> >
>> >> > Also, does anyone have a custom logwatch service for couchdb they
>> would
>> >> like
>> >> > to share? I'm going to be making one tomorrow if I can't find an
>> existing
>> >> > service.
>> >> >
>> >> > Thanks!
>> >> >
>> >>
>> >
>>
>

Re: Binary logs?

Posted by Travis Paul <Tr...@visPaul.me>.
I do see some errors that are probably making grep think the file is binary
and I pasted them here http://pastebin.com/rA9kHSNF if they are at all of
interest. I am unsure of their meaning.

I encountered a 'bizarre' error that I want to catch, which occurred when I
accessed the _rewrite url  to a view and Couch returned a lot of plain text
that looked like a stack trace, which a page refresh corrected and I have
not been able to recreate. I don't recall the date when I encountered that
error or what the error message looked like, so I'm not sure what to look
for in old logs, but I never want a user to see it so I'm trying to catch it
to see if it was something that I did or possibly a bug.


On Thu, Oct 27, 2011 at 12:06 PM, Robert Newson <rn...@apache.org> wrote:

> Grep has a heuristic to detect text vs. binary by examining the first
> part of the file. I'm curious to know what you have in, say, the first
> 100 bytes.
>
> couch.log is a text file, my guess is you have some strange characters
> in your log that is fooling grep.
>
> B.
>
> On 27 October 2011 16:59, Travis Paul <Tr...@vispaul.me> wrote:
> > If I try grep without the -a flag such as:  *grep "Thu, 27 Oct 2011"
> > couch.log*
> > I get: *Binary file couch.log matches*
> >
> > tail, and head commands work as usual, but if I want to open the file in
> > gedit I have to do something like: *strings couch.log > couch.log.text*
> >
> > less command complains as well: *"couch.log" may be a binary file.  See
> it
> > anyway?*
> >
> > On Thu, Oct 27, 2011 at 11:51 AM, Robert Newson <rn...@apache.org>
> wrote:
> >
> >> couch.log is a text file with lines like;
> >>
> >> [Thu, 27 Oct 2011 10:30:57 GMT] [info] [<0.15397.1>] 127.0.0.1 - - GET
> >> /db1/doc1 200
> >>
> >> What are you seeing in there?
> >>
> >> B.
> >>
> >> On 27 October 2011 16:36, Travis Paul <Tr...@vispaul.me> wrote:
> >> > Any idea why the couchdb logs in /var/log/couchdb are binary files? I
> >> have
> >> > to use *strings* or *grep -a* to do anything with them... just seemed
> >> > unusual.
> >> >
> >> > Also, does anyone have a custom logwatch service for couchdb they
> would
> >> like
> >> > to share? I'm going to be making one tomorrow if I can't find an
> existing
> >> > service.
> >> >
> >> > Thanks!
> >> >
> >>
> >
>

Re: Binary logs?

Posted by Robert Newson <rn...@apache.org>.
Grep has a heuristic to detect text vs. binary by examining the first
part of the file. I'm curious to know what you have in, say, the first
100 bytes.

couch.log is a text file, my guess is you have some strange characters
in your log that is fooling grep.

B.

On 27 October 2011 16:59, Travis Paul <Tr...@vispaul.me> wrote:
> If I try grep without the -a flag such as:  *grep "Thu, 27 Oct 2011"
> couch.log*
> I get: *Binary file couch.log matches*
>
> tail, and head commands work as usual, but if I want to open the file in
> gedit I have to do something like: *strings couch.log > couch.log.text*
>
> less command complains as well: *"couch.log" may be a binary file.  See it
> anyway?*
>
> On Thu, Oct 27, 2011 at 11:51 AM, Robert Newson <rn...@apache.org> wrote:
>
>> couch.log is a text file with lines like;
>>
>> [Thu, 27 Oct 2011 10:30:57 GMT] [info] [<0.15397.1>] 127.0.0.1 - - GET
>> /db1/doc1 200
>>
>> What are you seeing in there?
>>
>> B.
>>
>> On 27 October 2011 16:36, Travis Paul <Tr...@vispaul.me> wrote:
>> > Any idea why the couchdb logs in /var/log/couchdb are binary files? I
>> have
>> > to use *strings* or *grep -a* to do anything with them... just seemed
>> > unusual.
>> >
>> > Also, does anyone have a custom logwatch service for couchdb they would
>> like
>> > to share? I'm going to be making one tomorrow if I can't find an existing
>> > service.
>> >
>> > Thanks!
>> >
>>
>

Re: Binary logs?

Posted by Travis Paul <Tr...@visPaul.me>.
If I try grep without the -a flag such as:  *grep "Thu, 27 Oct 2011"
couch.log*
I get: *Binary file couch.log matches*

tail, and head commands work as usual, but if I want to open the file in
gedit I have to do something like: *strings couch.log > couch.log.text*

less command complains as well: *"couch.log" may be a binary file.  See it
anyway?*

On Thu, Oct 27, 2011 at 11:51 AM, Robert Newson <rn...@apache.org> wrote:

> couch.log is a text file with lines like;
>
> [Thu, 27 Oct 2011 10:30:57 GMT] [info] [<0.15397.1>] 127.0.0.1 - - GET
> /db1/doc1 200
>
> What are you seeing in there?
>
> B.
>
> On 27 October 2011 16:36, Travis Paul <Tr...@vispaul.me> wrote:
> > Any idea why the couchdb logs in /var/log/couchdb are binary files? I
> have
> > to use *strings* or *grep -a* to do anything with them... just seemed
> > unusual.
> >
> > Also, does anyone have a custom logwatch service for couchdb they would
> like
> > to share? I'm going to be making one tomorrow if I can't find an existing
> > service.
> >
> > Thanks!
> >
>

Re: Binary logs?

Posted by Robert Newson <rn...@apache.org>.
couch.log is a text file with lines like;

[Thu, 27 Oct 2011 10:30:57 GMT] [info] [<0.15397.1>] 127.0.0.1 - - GET
/db1/doc1 200

What are you seeing in there?

B.

On 27 October 2011 16:36, Travis Paul <Tr...@vispaul.me> wrote:
> Any idea why the couchdb logs in /var/log/couchdb are binary files? I have
> to use *strings* or *grep -a* to do anything with them... just seemed
> unusual.
>
> Also, does anyone have a custom logwatch service for couchdb they would like
> to share? I'm going to be making one tomorrow if I can't find an existing
> service.
>
> Thanks!
>