Parse error for workers.properties

Bug #592576 reported by Oliver Siegmar on 2010-06-11
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libapache-mod-jk (Debian)
Fix Released
Unknown
libapache-mod-jk (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: libapache-mod-jk

I'm running libapache-mod-jk 1.2.28-2 on Ubuntu 10.04 and I have this content in my workers.properties file:

worker.list = dev
worker.dev.type = ajp13
worker.dev.host = localhost
worker.dev.port = 8009

Apache doesn't start and my mod_jk.log shows this error:

[Fri Jun 11 10:57:26.414 2010] [4853:2129983296] [error] wc_create_worker::jk_worker.c (139): Unknown worker type aj113 for worker dev
[Fri Jun 11 10:57:26.414 2010] [4853:2129983296] [error] build_worker_map::jk_worker.c (262): failed to create worker dev

Do you see the "aj113" instead of "ajp13"? When I remove the space char before and after the equal char in the corresponding line, I get this im my logs:

[Fri Jun 11 10:59:05.457 2010] [4889:3785144128] [error] ajp_validate::jk_ajp_common.c (2526): worker dev can't resolve tomcat address localhsst
[Fri Jun 11 10:59:05.457 2010] [4889:3785144128] [error] wc_create_worker::jk_worker.c (163): validate failed for dev
[Fri Jun 11 10:59:05.457 2010] [4889:3785144128] [error] build_worker_map::jk_worker.c (262): failed to create worker dev

Do you see the "localhsst" instead of "localhost"? When I remove all spaces in my workers.properties, Apache starts without any errors. My config now contains:

worker.list=dev
worker.dev.type=ajp13
worker.dev.host=localhost
worker.dev.port=8009

I haven't changed this config for years and it worked flawlessly with all previous mod_jk versions.

This bug could be critical for people updating a production machine from a previous Ubuntu release to lucid lynx, because it takes some time to recognize that you have to remove spaces to get mod_jk up again.

I had the same problem on 10.04 LTS, but I built apache 2.2-17 and mod_jk 1.2.31 myself.
For example the mod_jk parser read socket_tieout instead of timeout.
Removing all whitespaces from the beginning of all lines solved it.

This is also tracked in the ASF Bugzilla under

https://issues.apache.org/bugzilla/show_bug.cgi?id=50339

Could you try the following patch:

Index: common/jk_map.c
===================================================================
--- common/jk_map.c (revision 1032021)
+++ common/jk_map.c (working copy)
@@ -630,6 +630,7 @@
 static size_t trim(char *s)
 {
     size_t i;
+ size_t off;

     /* check for empty strings */
     if (!(i = strlen(s)))
@@ -646,7 +647,10 @@
          isspace((int)((unsigned char)s[i])); i++);

     if (i > 0) {
- strcpy(s, &s[i]);
+ for (off = i; '\0' != s[i]; i++); {
+ s[i - off] = s[i];
+ }
+ s[i - off] = s[i];
     }

Tanks.

Rainer

The patch provided in comment #2 is wrong.
Now fixed upstreams. Will be part of mod_jk version 1.2.32.

Details provided at

https://issues.apache.org/bugzilla/show_bug.cgi?id=50339

and

http://svn.apache.org/viewvc?view=revision&revision=1042364

Regards,

Rainer

Changed in libapache-mod-jk (Debian):
status: Unknown → Confirmed
Changed in libapache-mod-jk (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.