You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by ChangCheng <cc...@msn.com> on 2011/03/14 18:53:18 UTC

Can't not load file (INKfopen issue)

Hi guys. I just got some problem when i follow the SDK Guide for The Append-Transform Plugin. i Compile plugin source code(from example folder), creating a shared library. then i copy the append-transform.so into /usr/local/libexec/trafficserver/ (the default plugin floder), then, i configer my plugin.config as the Guide mentioned mentioned :append-transform.so /home/cheng.chang/file.text
when i restart my ATS, i found error from error log. it said:[append-transform] Could not load /home/cheng.chang/file.text[append-transoform] Unable to initialize plugin
no mater i changed the path of the file. i still get same error.
After i check the source code of  Append-Transform Plugin, i found the INKfopen(filename, "r") caused this problem, it's always return false i think.
So, anyone has same problem as me?  Any Suggestion?
Thanks 		 	   		  

RE: Can't not load file (INKfopen issue)

Posted by ChangCheng <cc...@msn.com>.
Hi,  Yes, this is with V2.0.1
> Date: Mon, 14 Mar 2011 11:57:23 -0600
> From: zwoop@apache.org
> To: dev@trafficserver.apache.org
> CC: ccaijay@msn.com
> Subject: Re: Can't not load file (INKfopen issue)
> 
> On 03/14/2011 11:53 AM, ChangCheng wrote:
> > Hi guys. I just got some problem when i follow the SDK Guide for The Append-Transform Plugin. i Compile plugin source code(from example folder), creating a shared library. then i copy the append-transform.so into /usr/local/libexec/trafficserver/ (the default plugin floder), then, i configer my plugin.config as the Guide mentioned mentioned :append-transform.so /home/cheng.chang/file.text
> > when i restart my ATS, i found error from error log. it said:[append-transform] Could not load /home/cheng.chang/file.text[append-transoform] Unable to initialize plugin
> > no mater i changed the path of the file. i still get same error.
> > After i check the source code of  Append-Transform Plugin, i found the INKfopen(filename, "r") caused this problem, it's always return false i think.
> > So, anyone has same problem as me?  Any Suggestion?
> > Thanks 		 	   		  
> 
> Is this with v2.0.1 ? Is there any chance you can try v2.1.6, or current
> trunk?
> 
> -- leif
> 
 		 	   		  

RE: Can't not load file (INKfopen issue)

Posted by ChangCheng <cc...@msn.com>.
Thanks your attention, i have find the problem caused error, the file path have to be inside of loacl folder, for example. i have file in /usr/local/temp/file.txt. when i write line in plug.config. the path have to be write like:/temp/file.txt. if i put path like: /usr/local/temp/file.txt. this will get "can't not load file " error.
Thanks again!
> Date: Thu, 17 Mar 2011 20:49:49 -0600
> From: zwoop@apache.org
> To: dev@trafficserver.apache.org
> CC: ccaijay@msn.com
> Subject: Re: Can't not load file (INKfopen issue)
> 
> On 03/15/2011 05:40 AM, ChangCheng wrote:
> > Hi, i have tried the version v2.1.6,I still got same problem.could not load file.AnySuggestion?
> 
> So, I tried this in a plugin (and I also looked at the code), and it
> looks fine to me. I added this to a plugin of mine:
> 
> char buf[1024];
> TSFile f = TSfopen("/tmp/conf.config", "r");
> 
> TSfread(f, buf, sizeof(buf));
> printf("TSfopen() returns %d\n", f ? 1 : 0);
> printf("TSfread() read %s\n", buf);
> TSfclose(f);
> 
> 
> and when run, I see
> 
> TSfopen() returns 1
> TSfread() read CONFIG proxy.config.http.insert_request_via_str INT 0
> 
> 
> (which is exactly as expected).
> 
> -- Leif
> 
 		 	   		  

Re: Can't not load file (INKfopen issue)

Posted by Leif Hedstrom <zw...@apache.org>.
On 03/15/2011 05:40 AM, ChangCheng wrote:
> Hi, i have tried the version v2.1.6,I still got same problem.could not load file.AnySuggestion?

So, I tried this in a plugin (and I also looked at the code), and it
looks fine to me. I added this to a plugin of mine:

char buf[1024];
TSFile f = TSfopen("/tmp/conf.config", "r");

TSfread(f, buf, sizeof(buf));
printf("TSfopen() returns %d\n", f ? 1 : 0);
printf("TSfread() read %s\n", buf);
TSfclose(f);


and when run, I see

TSfopen() returns 1
TSfread() read CONFIG proxy.config.http.insert_request_via_str INT 0


(which is exactly as expected).

-- Leif


RE: Can't not load file (INKfopen issue)

Posted by ChangCheng <cc...@msn.com>.
Hi, i have tried the version v2.1.6,I still got same problem.could not load file.AnySuggestion?

> Date: Mon, 14 Mar 2011 11:57:23 -0600
> From: zwoop@apache.org
> To: dev@trafficserver.apache.org
> CC: ccaijay@msn.com
> Subject: Re: Can't not load file (INKfopen issue)
> 
> On 03/14/2011 11:53 AM, ChangCheng wrote:
> > Hi guys. I just got some problem when i follow the SDK Guide for The Append-Transform Plugin. i Compile plugin source code(from example folder), creating a shared library. then i copy the append-transform.so into /usr/local/libexec/trafficserver/ (the default plugin floder), then, i configer my plugin.config as the Guide mentioned mentioned :append-transform.so /home/cheng.chang/file.text
> > when i restart my ATS, i found error from error log. it said:[append-transform] Could not load /home/cheng.chang/file.text[append-transoform] Unable to initialize plugin
> > no mater i changed the path of the file. i still get same error.
> > After i check the source code of  Append-Transform Plugin, i found the INKfopen(filename, "r") caused this problem, it's always return false i think.
> > So, anyone has same problem as me?  Any Suggestion?
> > Thanks 		 	   		  
> 
> Is this with v2.0.1 ? Is there any chance you can try v2.1.6, or current
> trunk?
> 
> -- leif
> 
 		 	   		  

Re: Can't not load file (INKfopen issue)

Posted by Leif Hedstrom <zw...@apache.org>.
On 03/14/2011 11:53 AM, ChangCheng wrote:
> Hi guys. I just got some problem when i follow the SDK Guide for The Append-Transform Plugin. i Compile plugin source code(from example folder), creating a shared library. then i copy the append-transform.so into /usr/local/libexec/trafficserver/ (the default plugin floder), then, i configer my plugin.config as the Guide mentioned mentioned :append-transform.so /home/cheng.chang/file.text
> when i restart my ATS, i found error from error log. it said:[append-transform] Could not load /home/cheng.chang/file.text[append-transoform] Unable to initialize plugin
> no mater i changed the path of the file. i still get same error.
> After i check the source code of  Append-Transform Plugin, i found the INKfopen(filename, "r") caused this problem, it's always return false i think.
> So, anyone has same problem as me?  Any Suggestion?
> Thanks 		 	   		  

Is this with v2.0.1 ? Is there any chance you can try v2.1.6, or current
trunk?

-- leif