In subscribe
Mansi Gokhale <[email protected]> Mon, 13 Oct 2014 17:11:58 +0530
| Newsgroups | gmane.comp.web.wiki.moin.general |
|---|---|
| Message-ID | <CANuZ4SHve9kvAH65VTit8xmRNeHmo1fTWVVUet26Tf3hS1Gp4g@mail.gmail.com> |
Help On Oct 13, 2014 5:02 PM, <[email protected]> wrote: > Send Moin-user mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/moin-user > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Moin-user digest..." > > > Today's Topics: > > 1. Re: Moin-user Digest, Vol 96, Issue 2 (Mansi Gokhale) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 13 Oct 2014 17:02:01 +0530 > From: Mansi Gokhale <[email protected]> > Subject: Re: [Moin-user] Moin-user Digest, Vol 96, Issue 2 > To: [email protected] > Message-ID: > <CANuZ4SFZsG7NDks3jkd= > [email protected]> > Content-Type: text/plain; charset="utf-8" > > Help > On Oct 13, 2014 4:27 PM, <[email protected]> wrote: > > > Send Moin-user mailing list submissions to > > [email protected] > > > > To subscribe or unsubscribe via the World Wide Web, visit > > https://lists.sourceforge.net/lists/listinfo/moin-user > > or, via email, send a message with subject or body 'help' to > > [email protected] > > > > You can reach the person managing the list at > > [email protected] > > > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of Moin-user digest..." > > > > > > Today's Topics: > > > > 1. Where to catch FileTooLong error (Nikolaus Rath) > > 2. Re: Where to catch FileTooLong error (Thomas Waldmann) > > 3. Fwd: data_underlay_dir Not being what it's supposed to be > > (Rovanion Luckey) > > 4. Re: Where to catch FileTooLong error (Nikolaus Rath) > > 5. Re: Fwd: data_underlay_dir Not being what it's supposed to be > > (Paul Boddie) > > 6. Re: Fwd: data_underlay_dir Not being what it's supposed to be > > (Rovanion Luckey) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Mon, 06 Oct 2014 17:16:21 -0700 > > From: Nikolaus Rath <[email protected]> > > Subject: [Moin-user] Where to catch FileTooLong error > > To: [email protected] > > Message-ID: <[email protected]> > > Content-Type: text/plain; charset=utf-8 > > > > Hello, > > > > Several times a day I get the errors like the following in my moinmoin > > server logs: > > > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] Traceback (most > > recent call last): > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] File > > "/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 411, in > __call__ > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] return > > self.app(environ, start_response) > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] File > > "/usr/lib/python2.7/dist-packages/MoinMoin/wsgiapp.py", line 282, in > > __call__ > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] response = > > run(context) > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] File > > "/usr/lib/python2.7/dist-packages/MoinMoin/wsgiapp.py", line 88, in run > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] response = > > dispatch(request, context, action_name) > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] File > > "/usr/lib/python2.7/dist-packages/MoinMoin/wsgiapp.py", line 136, in > > dispatch > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] response = > > handle_action(context, pagename, action_name) > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] File > > "/usr/lib/python2.7/dist-packages/MoinMoin/wsgiapp.py", line 195, in > > handle_action > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] > > handler(context.page.page_name, context) > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] File > > "/usr/lib/python2.7/dist-packages/MoinMoin/action/__init__.py", line 268, > > in do_show > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] > > content_only=content_only, > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] File > > "/usr/lib/python2.7/dist-packages/MoinMoin/Page.py", line 1134, in > send_page > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] body = > > self.data > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] File > > "/usr/lib/python2.7/dist-packages/MoinMoin/Page.py", line 246, in > get_data > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] > self.__meta, > > self.__data = wikiutil.get_processing_instructions(self.body) > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] File > > "/usr/lib/python2.7/dist-packages/MoinMoin/Page.py", line 212, in > get_body > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] f = > > codecs.open(self._text_filename(), 'rb', config.charset) > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] File > > "/usr/lib/python2.7/codecs.py", line 881, in open > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] file = > > __builtin__.open(filename, mode, buffering) > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] IOError: > > [Errno 36] File name too long: '/srv/ > > > www.rath.org/wiki/pages/mail_err(2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b)Result(3a2befbfbdefbfbd2befbfbdefbfbdefbfbdefbfbdefbfbdefbfbdefbfbd2befbfbdefbfbdefbfbdefbfbdefbfbd2befbfbdefbfbdefbfbd2befbfbdefbfbdefbfbdefbfbdefbfbdefbfbdefbfbdefbfbd3b2b)Result(3a2befbfbdefbfbd2befbfbdefbfbdefbfbdefbfbdefbfbdefbfbdefbfbd2befbfbdefbfbdefbfbdefbfbdefbfbd2befbfbdefbfbdefbfbd2befbfbdefbfbdefbfbdefbfbdefbfbdefbfbdefbfbdefbfbd3b2b)Result(3a2befbfbdefbfbd2befbfbdefbfbdefbfbdefbfbdefbfbdefbfbdefbfbd2befbfbdefbfbdefbfbdefbfbdefbfbd2befbfbdefbfbdefbfbd2befbfbdefbfbdefbfbdefbfbdefbfbdefbfbdefbfbdefbfbd3b)/revisions/99999999 > > ' > > > > I believe this is just some attempted exploit failing miserably and no > > cause for concern. However, the length of the message (and the embedded > > newlines) makes it very hard to filter, so I'm constantly getting nagged > > by my log analyzer. > > > > What would be the best way to catch this exception and log a short, > > standard message instead? > > > > > > I am proficient in Python, but not in moinmoin. So my question is mostly > > *where* to insert the necessary code, and how to generate the error > > message (just print to stderr, or is there a logging function I should > > use?). Ideally, I'd also like to change something in /etc rather than > > changing e.g. "/usr/lib/python2.7/dist-packages/MoinMoin/wsgiapp.py", so > > that the changes are not lost on the next update. > > > > Best, > > -Nikolaus > > > > -- > > GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F > > Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F > > > > ?Time flies like an arrow, fruit flies like a Banana.? > > > > > > > > ------------------------------ > > > > Message: 2 > > Date: Wed, 08 Oct 2014 14:01:12 +0200 > > From: Thomas Waldmann <[email protected]> > > Subject: Re: [Moin-user] Where to catch FileTooLong error > > To: [email protected] > > Message-ID: <[email protected]> > > Content-Type: text/plain; charset=utf-8 > > > > Moin Nikolaus, > > > > > Several times a day I get the errors like the following in my moinmoin > > > server logs: > > > > Yeah, seen them also. Not too often, not causing issues here, so I just > > ignored them. > > > > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] File > > "/usr/lib/python2.7/dist-packages/MoinMoin/Page.py", line 212, in > get_body > > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] f = > > codecs.open(self._text_filename(), 'rb', config.charset) > > > [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] IOError: > > [Errno 36] File name too long: '...' > > > > > > I believe this is just some attempted exploit failing miserably and no > > > cause for concern. > > > > Correct. > > > > Not even sure it is an exploit. Sometimes such stuff are also just > > crappy bots using links from crappy services or constructing links badly. > > > > But somehow it looks like trying a buffer overflow, yes (which can't > > happen in python). > > > > > What would be the best way to catch this exception and log a short, > > > standard message instead? > > > > I guess you could catch it at the place I quoted. Make sure you do not > > catch stuff also which you did not want to catch. Maybe check errno? > > > > Important: run your code, practically try if it really fixes the > > problem. Run our unit tests (== run ./pytest from top level dir). > > > > > I am proficient in Python, but not in moinmoin. So my question is > mostly > > > *where* to insert the necessary code, and how to generate the error > > > message (just print to stderr, or is there a logging function I should > > > use?). > > > > We use the stdlib "logging", just look in some code to find how it is > > usually imported and used (our "logging" is NOT the logging module > object). > > > > > Ideally, I'd also like to change something in /etc rather than > > > changing e.g. "/usr/lib/python2.7/dist-packages/MoinMoin/wsgiapp.py", > so > > > that the changes are not lost on the next update. > > > > If you get the changes done asap and get them adopted upstream (== by > > me), they could be in a release quicker than you think. :D > > > > Cheers, > > > > Thomas > > > > > > > > ------------------------------ > > > > Message: 3 > > Date: Sun, 12 Oct 2014 17:09:53 +0200 > > From: Rovanion Luckey <[email protected]> > > Subject: [Moin-user] Fwd: data_underlay_dir Not being what it's > > supposed to be > > To: [email protected] > > Message-ID: > > <CAAaf0CB8foxAugcvR_r4aBSFV+y6bDJE01BoCjnF= > > [email protected]> > > Content-Type: text/plain; charset="utf-8" > > > > Hi, > > I'm trying to set up MoinMoin using the packages in the Ubuntu > > repositories, nginx and uwsgi. I'm having an issue [0] where I get an > error > > stating that the underlay directory is not accessible where > > data_underlay_dir is stated to be located in a directory not set in any > > config file. > > > > You see the error [0] says that data_underlay_dir is set to ./underlay > > while the wikiconfig.py clearly sets it to a non-relative url. > > > > For completeness my site conf [2], uwsgi conf [3] and farmconf [4] is > also > > provided in the links below. > > > > I've made sure to restart uwsgi after changing the configurations related > > to moinmoin, even though a reload should suffice. The nginx conf [5] > points > > to the socket provided by uwsgi, has been restarted and .. well .. I'm > > running short of ideas. > > > > [0] http://paste.debian.net/125837/ > > [1] http://paste.ubuntu.com/8546386/ > > [2] http://paste.ubuntu.com/8546401/ > > [3] http://paste.ubuntu.com/8546403/ > > [4] http://paste.ubuntu.com/8546406/ > > [5] http://paste.ubuntu.com/8546415/ > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > > > ------------------------------ > > > > Message: 4 > > Date: Sun, 12 Oct 2014 14:18:49 -0700 > > From: Nikolaus Rath <[email protected]> > > Subject: Re: [Moin-user] Where to catch FileTooLong error > > To: [email protected] > > Message-ID: <[email protected]> > > Content-Type: text/plain; charset=utf-8 > > > > Thomas Waldmann <[email protected]> writes: > > >> [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] File > > "/usr/lib/python2.7/dist-packages/MoinMoin/Page.py", line 212, in > get_body > > >> [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] f = > > codecs.open(self._text_filename(), 'rb', config.charset) > > >> [Wed Oct 01 17:50:31 2014] [error] [client 176.194.6.204] IOError: > > [Errno 36] File name too long: '...' > > [...] > > >> What would be the best way to catch this exception and log a short, > > >> standard message instead? > > > > > > I guess you could catch it at the place I quoted. Make sure you do not > > > catch stuff also which you did not want to catch. Maybe check errno? > > > > > > Important: run your code, practically try if it really fixes the > > > problem. Run our unit tests (== run ./pytest from top level dir). > > > > > >> I am proficient in Python, but not in moinmoin. So my question is > mostly > > >> *where* to insert the necessary code, and how to generate the error > > >> message (just print to stderr, or is there a logging function I should > > >> use?). > > > > > > We use the stdlib "logging", just look in some code to find how it is > > > usually imported and used (our "logging" is NOT the logging module > > object). > > > > > >> Ideally, I'd also like to change something in /etc rather than > > >> changing e.g. "/usr/lib/python2.7/dist-packages/MoinMoin/wsgiapp.py", > so > > >> that the changes are not lost on the next update. > > > > > > If you get the changes done asap and get them adopted upstream (== by > > > me), they could be in a release quicker than you think. :D > > > > How about this patch? > > > > diff --git a/MoinMoin/Page.py b/MoinMoin/Page.py > > --- a/MoinMoin/Page.py > > +++ b/MoinMoin/Page.py > > @@ -217,6 +217,10 @@ > > # never store empty pages, so this is detectable and > > also > > # safe when passed to a function expecting a string) > > return "" > > + elif er.errno == errno.ENAMETOOLONG: > > + # If the name is too long, the page can't exist on > > this > > + # system either. > > + return "" > > else: > > raise > > > > It fixed the issue for me, and applies cleanly against the 1.9 hg > > repository. I decided against an error message and instead opted to > > treat this like a file-not-found error (which, in some way it is). > > ./pytest also runs fine with the patched source. > > > > > > Best, > > -Nikolaus > > -- > > GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F > > Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F > > > > ?Time flies like an arrow, fruit flies like a Banana.? > > > > > > > > ------------------------------ > > > > Message: 5 > > Date: Sun, 12 Oct 2014 23:44:34 +0200 > > From: Paul Boddie <[email protected]> > > Subject: Re: [Moin-user] Fwd: data_underlay_dir Not being what it's > > supposed to be > > To: [email protected] > > Message-ID: <[email protected]> > > Content-Type: Text/Plain; charset="iso-8859-15" > > > > On Sunday 12. October 2014 17.09.53 Rovanion Luckey wrote: > > > Hi, > > > I'm trying to set up MoinMoin using the packages in the Ubuntu > > > repositories, nginx and uwsgi. I'm having an issue [0] where I get an > > error > > > stating that the underlay directory is not accessible where > > > data_underlay_dir is stated to be located in a directory not set in any > > > config file. > > > > > > You see the error [0] says that data_underlay_dir is set to ./underlay > > > while the wikiconfig.py clearly sets it to a non-relative url. > > > > The wikiconfig.py file probably isn't used. See below for why I think > this > > is. > > > > > For completeness my site conf [2], uwsgi conf [3] and farmconf [4] is > > also > > > provided in the links below. > > > > > > I've made sure to restart uwsgi after changing the configurations > related > > > to moinmoin, even though a reload should suffice. The nginx conf [5] > > points > > > to the socket provided by uwsgi, has been restarted and .. well .. I'm > > > running short of ideas. > > > > > > [0] http://paste.debian.net/125837/ > > > [1] http://paste.ubuntu.com/8546386/ > > > > In this copy of the configuration (wikiconfig.py), I see the following > > lines... > > > > instance_dir = /usr/share/moin/ > > > > # Where your own wiki pages are (make regular backups of this > > directory): > > data_dir = os.path.join(instance_dir, 'data', '') # path with > trailing > > / > > > > # Where system and help pages are (you may exclude this from backup): > > data_underlay_dir = /usr/share/moin/underlay/ # path with trailing / > > > > Note that neither instance_dir nor data_underlay_dir seem to be set to > > valid > > strings. Remember that this file is a Python source file and thus these > > values > > must be valid Python syntax. > > > > Since this file seems to be for a single wiki and not for a farm (or > > instance > > thereof), I imagine that you aren't using this particular file, however. > If > > this file were being used, you'd get a syntax error from Moin, certainly. > > > > Meanwhile... > > > > > [2] http://paste.ubuntu.com/8546401/ > > > > ...in this file (mywiki.py) you might consider setting something like... > > > > data_underlay_dir = '/usr/share/moin/underlay' > > > > ...just to see if it helps. > > > > Paul > > > > > > > > ------------------------------ > > > > Message: 6 > > Date: Mon, 13 Oct 2014 12:56:09 +0200 > > From: Rovanion Luckey <[email protected]> > > Subject: Re: [Moin-user] Fwd: data_underlay_dir Not being what it's > > supposed to be > > To: Paul Boddie <[email protected]> > > Cc: moin-user <[email protected]> > > Message-ID: > > < > > CAAaf0CCZneMncL6PSwuLRiHOqd4zQoRG1Z4PMMSJCCkgx-etrg@mail.gmail.com> > > Content-Type: text/plain; charset="utf-8" > > > > Yes, thank you! Adding the line in mywiki.py about data_underlay_dir > ended > > up working! > > > > 2014-10-12 23:44 GMT+02:00 Paul Boddie <[email protected]>: > > > > > On Sunday 12. October 2014 17.09.53 Rovanion Luckey wrote: > > > > Hi, > > > > I'm trying to set up MoinMoin using the packages in the Ubuntu > > > > repositories, nginx and uwsgi. I'm having an issue [0] where I get an > > > error > > > > stating that the underlay directory is not accessible where > > > > data_underlay_dir is stated to be located in a directory not set in > any > > > > config file. > > > > > > > > You see the error [0] says that data_underlay_dir is set to > ./underlay > > > > while the wikiconfig.py clearly sets it to a non-relative url. > > > > > > The wikiconfig.py file probably isn't used. See below for why I think > > this > > > is. > > > > > > > For completeness my site conf [2], uwsgi conf [3] and farmconf [4] is > > > also > > > > provided in the links below. > > > > > > > > I've made sure to restart uwsgi after changing the configurations > > related > > > > to moinmoin, even though a reload should suffice. The nginx conf [5] > > > points > > > > to the socket provided by uwsgi, has been restarted and .. well .. > I'm > > > > running short of ideas. > > > > > > > > [0] http://paste.debian.net/125837/ > > > > [1] http://paste.ubuntu.com/8546386/ > > > > > > In this copy of the configuration (wikiconfig.py), I see the following > > > lines... > > > > > > instance_dir = /usr/share/moin/ > > > > > > # Where your own wiki pages are (make regular backups of this > > > directory): > > > data_dir = os.path.join(instance_dir, 'data', '') # path with > > trailing > > > / > > > > > > # Where system and help pages are (you may exclude this from > backup): > > > data_underlay_dir = /usr/share/moin/underlay/ # path with trailing > / > > > > > > Note that neither instance_dir nor data_underlay_dir seem to be set to > > > valid > > > strings. Remember that this file is a Python source file and thus these > > > values > > > must be valid Python syntax. > > > > > > Since this file seems to be for a single wiki and not for a farm (or > > > instance > > > thereof), I imagine that you aren't using this particular file, > however. > > If > > > this file were being used, you'd get a syntax error from Moin, > certainly. > > > > > > Meanwhile... > > > > > > > [2] http://paste.ubuntu.com/8546401/ > > > > > > ...in this file (mywiki.py) you might consider setting something > like... > > > > > > data_underlay_dir = '/usr/share/moin/underlay' > > > > > > ...just to see if it helps. > > > > > > Paul > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer > > > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS > Reports > > > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper > > > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer > > > http://p.sf.net/sfu/Zoho > > > _______________________________________________ > > > Moin-user mailing list > > > [email protected] > > > https://lists.sourceforge.net/lists/listinfo/moin-user > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > > > ------------------------------ > > > > > > > ------------------------------------------------------------------------------ > > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer > > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports > > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper > > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer > > http://p.sf.net/sfu/Zoho > > > > ------------------------------ > > > > _______________________________________________ > > Moin-user mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/moin-user > > > > > > End of Moin-user Digest, Vol 96, Issue 2 > > **************************************** > > > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > > ------------------------------------------------------------------------------ > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer > http://p.sf.net/sfu/Zoho > > ------------------------------ > > _______________________________________________ > Moin-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/moin-user > > > End of Moin-user Digest, Vol 96, Issue 3 > **************************************** > ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://p.sf.net/sfu/Zoho _______________________________________________ Moin-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/moin-user