SID-02205: When Editing post i receive ERROR message in regex;
| Status: |
Answered |
TWiki version: |
6.0.2 |
Perl version: |
5.22.2 |
| Category: |
CategoryError |
Server OS: |
Debian |
Last update: |
10 years ago |
TWiki detected an internal error - please check your TWiki logs and webserver logs for more information. Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ^])/
from twiki/log/error.log:
[Wed Jun 01 15:01:37.630679 2016] [cgi:error] Use of uninitialized value $name in concatenation (.) or string at /usr/lib/i386-linux-gnu/perl/5.20/Encode.pm line 173., referer: http://twiki.localhost/do/edit/ITDEV/WebHome?t=1464781411;nowysiwyg=0
[Wed Jun 01 15:01:37.632691 2016] [cgi:error] Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ^])/ at (eval 111) line 1., referer: http://twiki.localhost/do/edit/ITDEV/WebHome?t=1464781411;nowysiwyg=0
[Wed Jun 01 15:01:37.632727 2016] [cgi:error] while trying to turn range: "^", referer: http://twiki.localhost/do/edit/ITDEV/WebHome?t=1464781411;nowysiwyg=0
[Wed Jun 01 15:01:37.632795 2016] [cgi:error] into code: sub {$_[0] =~ s/([^])/$char2entity{$1} || num_entity($1)/ge; }, referer: http://twiki.localhost/do/edit/ITDEV/WebHome?t=1464781411;nowysiwyg=0
[Wed Jun 01 15:01:37.632854 2016] [cgi:error] at /usr/lib/i386-linux-gnu/perl5/5.20/HTML/Entities.pm line 455., referer: http://twiki.localhost/do/edit/ITDEV/WebHome?t=1464781411;nowysiwyg=0
[Wed Jun 01 15:01:37.632941 2016] [cgi:error] Could not write "Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ^])/ at (eval 111) line 1., referer: http://twiki.localhost/do/edit/ITDEV/WebHome?t=1464781411;nowysiwyg=0
[Wed Jun 01 15:01:37.632974 2016] [cgi:error] while trying to turn range: "^", referer: http://twiki.localhost/do/edit/ITDEV/WebHome?t=1464781411;nowysiwyg=0
[Wed Jun 01 15:01:37.633040 2016] [cgi:error] into code: sub {$_[0] =~ s/([^])/$char2entity{$1} || num_entity($1)/ge; }, referer: http://twiki.localhost/do/edit/ITDEV/WebHome?t=1464781411;nowysiwyg=0
[Wed Jun 01 15:01:37.633099 2016] [cgi:error] at /usr/lib/i386-linux-gnu/perl5/5.20/HTML/Entities.pm line 455., referer: http://twiki.localhost/do/edit/ITDEV/WebHome?t=1464781411;nowysiwyg=0
[Wed Jun 01 15:01:37.633150 2016] [cgi:error] to /srv/ttwiki/data/warn201606.txt: Permission denied, referer: http://localhost/do/edit/ITDEV/WebHome?t=1464781411;nowysiwyg=0
--
Teodor Ivanov - 2016-06-01
Discussion and Answer
Likely a file permission issue. Make sure all files and directories your twiki directory and below are owned by your webserver user. I think on Debian it is usually
www-data.
--
Peter Thoeny - 2016-06-01
permisions is set: chown -R www-data:www-data /srv/twiki/
problem exist
--
Teodor Ivanov - 2016-06-02
I can editing only Twiki Web, for others Web (Main Web, Sandbox Web or Trash Web) when edit I Receive this message:
TWiki detected an internal error - please check your TWiki logs and webserver logs for more information. Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ^])/
--
Teodor Ivanov - 2016-06-02
What is the apache error log saying?
--
Peter Thoeny - 2016-06-02
If you have additional plugins installed, disable all non-core plugins to see if one of them is the culprit.
--
Peter Thoeny - 2016-06-02
The error log contains quite a bunch of hints, so let's try to follow them one by one:
-
Could not write "Unmatched [ in regex; [...] to /srv/ttwiki/data/warn201606.txt: Permission denied
- Note the
/ttwiki/ instead of /twiki/ in the path to the log file. It appears that your TWiki is installed in /srv/twiki, so please check the entry for $TWiki::cfg{WarnFileName} in configure.
- The
Unmatched [ in regex; stuff lets me make two assumptions:
- The error is thrown when you try to save the page, and
- "Raw" editing of topics works just fine, in all webs.
- If these assumptions are true, there's another question which could help narrowing it down:
- What's your setting for
{Site}{CharSet} in configure? It might be set to a charset which Encode.pm doesn't know how to handle.
- Technical background: I've found only one place in the TWiki code which can emit this error message. This place is in
/WysiwygPlugin/lib/TWiki/Plugins/WysiwygPlugin/Constants.pm, sub convertNotRepresentabletoEntity, where the WYSIWYG editor tries to convert the input from the editor to the CharSet encoding.
- If you like an adventure, then go to line 276 in this file. You should find these lines:
$_[0] =
HTML::Entities::encode_entities( $_[0],
"^$siteCharsetRepresentable" );
In the third line, insert a space between the ^ and the $, making it "^ $siteCharsetRepresentable" );. If the error goes away, we have a workaround, but not a solution.
--
Harald Jörg - 2016-06-04
ThankYou
After insert this space i receive other error:
TWiki detected an internal error - please check your TWiki logs and webserver logs for more information. Encoding name should not be undef
In the first time i have a problem with a cyrlic encoding and change something somewhere, i can't remember where and a problem has been resolved.
--
Teodor Ivanov - 2016-06-16
I make clean install on TWiki 6.0.2 to same Debian and without any posts i have same problem!
--
Teodor Ivanov - 2016-06-17
When try to save after editing a receive this error -
Unknown encoding ''
Where i can change encoding?
--
Teodor Ivanov - 2016-06-23
The character set is defined by the
{Site}{CharSet} configure setting. Default is
iso-8859-1
--
Peter Thoeny - 2016-06-24
Thanks Peter, and that was a my problem, different encoding in
LocalSite.
When i set
{Site}{Locale} = 'utf-8-strict'; and
{Site}{CharSet} = 'utf-8-strict';
everything is going fine.
No more error : TWiki detected an internal error - please check your TWiki logs and webserver logs for more information. Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ^])/
--
Teodor Ivanov - 2016-06-24
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.