Hi,
When turning on ZincFileLogger on a Zinc server, after some time (1h or so) I get the FileWrite error (see screenshot). I browsed through the bugs related to Zinc in the Fogbugz but couldn't find any bug related to my problem. I get the problem both on Mac (local machine) and Ubuntu (DigitalOcean instance) on Pharo 3.0 (release).
This is my code to register logging on the server events: server := ZnMultiThreadedServer startOn: 4001. logger := ZnFileLogger onFileNamed: 'server-log.txt'.
server log addListener: logger. Any pointers? tx. Usman |
On 21 May 2014, at 13:30, Usman Bhatti <[hidden email]> wrote: > Hi, > > When turning on ZincFileLogger on a Zinc server, after some time (1h or so) I get the FileWrite error (see screenshot). I browsed through the bugs related to Zinc in the Fogbugz but couldn't find any bug related to my problem. I get the problem both on Mac (local machine) and Ubuntu (DigitalOcean instance) on Pharo 3.0 (release). > > This is my code to register logging on the server events: > > server := ZnMultiThreadedServer startOn: 4001. > logger := ZnFileLogger onFileNamed: 'server-log.txt'. > server log addListener: logger. > > Any pointers? That is really weird: in the code above the file is named 'server-log.txt' while in the screenshot the file is named 'License-log.txt', how is that possible ? The error is that the file is closed, probably 'underneath' the logging code, so the question is, how is that possible, who did that ? Can it be that two file (descriptors) got swapped ? Did you save the image, move it around, across machines ? > tx. > > Usman > > <Screen Shot 2014-05-21 at 1.20.46 PM.png> |
On Wed, May 21, 2014 at 1:37 PM, Sven Van Caekenberghe <[hidden email]> wrote:
Oops. I renamed the log file name in my mail. I should have had a closer look at the screenshot before sending it :((. So, my code should have looked like it to match the error in the screenshot:
server := ZnMultiThreadedServer startOn: 4001. logger := ZnFileLogger onFileNamed: 'License-log.txt'. server log addListener: logger.
I had this doubt of moving my development image to the cloud instance so I created a script on the cloud instance to prepare my server from a freshly downloaded pharo image. But I had the same problem. Contents from the tail of the log file, if that can be of any help:
2014-05-20 21:01:03 308891 T GET /validate:123 200 18B 4ms 2014-05-20 21:01:03 308891 I Wrote a ZnResponse(200 OK text/plain;charset=utf-8 18B) 2014-05-20 21:01:03 308891 D ZnUnknownHttpMethod bad request while parsing
2014-05-20 21:01:03 308891 D ConnectionClosed: Cannot write data while writing response 2014-05-20 21:01:03 308891 D Closing stream 2014-05-20 21:06:03 817717 D Wait for accept timed out
2014-05-20 21:11:03 817717 D Wait for accept timed out 2014-05-20 21:16:03 817717 D Wait for accept timed out usman
|
On 21 May 2014, at 16:59, Usman Bhatti <[hidden email]> wrote: > > > > On Wed, May 21, 2014 at 1:37 PM, Sven Van Caekenberghe <[hidden email]> wrote: > > On 21 May 2014, at 13:30, Usman Bhatti <[hidden email]> wrote: > > > Hi, > > > > When turning on ZincFileLogger on a Zinc server, after some time (1h or so) I get the FileWrite error (see screenshot). I browsed through the bugs related to Zinc in the Fogbugz but couldn't find any bug related to my problem. I get the problem both on Mac (local machine) and Ubuntu (DigitalOcean instance) on Pharo 3.0 (release). > > > > This is my code to register logging on the server events: > > > > server := ZnMultiThreadedServer startOn: 4001. > > logger := ZnFileLogger onFileNamed: 'server-log.txt'. > > server log addListener: logger. > > > > Any pointers? > > That is really weird: in the code above the file is named 'server-log.txt' while in the screenshot the file is named 'License-log.txt', how is that possible ? > > The error is that the file is closed, probably 'underneath' the logging code, so the question is, how is that possible, who did that ? > > Oops. I renamed the log file name in my mail. I should have had a closer look at the screenshot before sending it :((. So, my code should have looked like it to match the error in the screenshot: > > server := ZnMultiThreadedServer startOn: 4001. > logger := ZnFileLogger onFileNamed: 'License-log.txt'. > server log addListener: logger. OK. > Can it be that two file (descriptors) got swapped ? > > Did you save the image, move it around, across machines ? > > I had this doubt of moving my development image to the cloud instance so I created a script on the cloud instance to prepare my server from a freshly downloaded pharo image. But I had the same problem. Contents from the tail of the log file, if that can be of any help: > > 2014-05-20 21:01:03 308891 T GET /validate:123 200 18B 4ms > 2014-05-20 21:01:03 308891 I Wrote a ZnResponse(200 OK text/plain;charset=utf-8 18B) > 2014-05-20 21:01:03 308891 D ZnUnknownHttpMethod bad request while parsing > 2014-05-20 21:01:03 308891 D ConnectionClosed: Cannot write data while writing response > 2014-05-20 21:01:03 308891 D Closing stream > 2014-05-20 21:06:03 817717 D Wait for accept timed out > 2014-05-20 21:11:03 817717 D Wait for accept timed out > 2014-05-20 21:16:03 817717 D Wait for accept timed out I have to little information to say anything. I doubt that it is related to Zn logging on itself, but who knows, anything is possible. It seems you can reproduce it quite easily. Is there more in PharoDebug.log ? In most cases I use #logToTranscript, but with something like NonInteractiveTranscript file install. on top of my start.st script. That way I can easily write other things to the same log file. Sven |
Please find the debug log file here. I hope this helps. On my side, I'll switch to Transcript logging in the meantime to see if that is not coming from any errors in my implementation of the server. tx usman
On Wed, May 21, 2014 at 5:15 PM, Sven Van Caekenberghe <[hidden email]> wrote:
|
In reply to this post by Sven Van Caekenberghe-2
On Wed, May 21, 2014 at 5:15 PM, Sven Van Caekenberghe <[hidden email]> wrote:
The problem disappears when I use Transcript logging and my image is stable. So, I'll stick to this solution.
tx. usman
|
Hi Usman,
Thanks for the feedback, there must be something wrong with ZnFileLogger then I guess. I'll put it on the todo list ;-) Sven |
Free forum by Nabble | Edit this page |