On Wed, May 21, 2014 at 1:37 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:

On 21 May 2014, at 13:30, Usman Bhatti <usman.bhatti@gmail.com> 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.
��

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

usman
��

> tx.
>
> Usman
>
> <Screen Shot 2014-05-21 at 1.20.46 PM.png>