A possible problem coming from Zinc?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

A possible problem coming from Zinc?

Usman Bhatti
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

Inline image 1
Reply | Threaded
Open this post in threaded view
|

Re: A possible problem coming from Zinc?

Sven Van Caekenberghe-2

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>


Reply | Threaded
Open this post in threaded view
|

Re: A possible problem coming from Zinc?

Usman Bhatti



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.
 

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>



Reply | Threaded
Open this post in threaded view
|

Re: A possible problem coming from Zinc?

Sven Van Caekenberghe-2

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


Reply | Threaded
Open this post in threaded view
|

Re: A possible problem coming from Zinc?

Usman Bhatti
Please find the debug log file here. I hope this helps.

https://dl.dropboxusercontent.com/u/11804892/PharoDebug.log

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:

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



Reply | Threaded
Open this post in threaded view
|

Re: A possible problem coming from Zinc?

Usman Bhatti
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:

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.

The problem disappears when I use Transcript logging and my image is stable. So, I'll stick to this solution.

tx.
usman
 

Sven



Reply | Threaded
Open this post in threaded view
|

Re: A possible problem coming from Zinc?

Sven Van Caekenberghe-2
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