Forum OpenACS Q&A: apm error

Collapse
Posted by Adam Shimali on
  
Hello all,      
I'm using    
OACS 4.5    
Mandrake 8.2    
Postgres 7.2    
AOLServer 3.4.2     
    
I'm having a problem creating a package. I get the folling error ..     
    
 
Database operation "0or1row" failed (exception NSDB, "Query was not    
a statement returning rows.")    
    while executing    
"ns_pg_bind 0or1row nsdb0 {    
        select case when count(*) = 0 then 0 else 1 end from    
apm_package_versions    
        where version_id = :version_id    
        
      }"     
 
I've left out the rest of the error messages since I think the  
problem is the query. I read this   
(https://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=0005Di&topic_id=11&topic=OpenACS)   
and wiondered if this is a problem with the   
apm-procs-postgresql.xql, but also noticed that the patch supplied   
was rejected. Anyone hava any ideas?   
Thanks   
Adam  
 
Collapse
2: Response to apm error (response to 1)
Posted by Dan Wickstrom on
The query looks harmless and it should work in oracle or postgresql if the data-model installed correctly.

Try checking to see if the apm_package_versions table exists from psql:

   openacs45=# \d apm_package_versions

And then try running the query from psql:

openacs45=# select case when count(*) = 0 then 0 else 1 end from apm_package_versions;
 case 
------
    1
(1 row)


You'll probably find that something is not installed correctly.
Collapse
3: Response to apm error (response to 1)
Posted by Cathy Sarisky on
Check ownership of all the files in your packages directory.  If you followed the installation instructions, they're all nsadmin.web.  You need to be running aolserver with -u nsadmin -g web, if that's the case.
Collapse
4: Response to apm error (response to 1)
Posted by Adam Shimali on
Hi Cathy and Dan, I've checked on both your suggestions and the apm_package_versions table exists, all the file permissions are correct and aolserver is running with -u nsadmin -g web. Do you think it's a problem with running postgres 7.2 as opposed to 7.1? Thanks
Collapse
5: Response to apm error (response to 1)
Posted by Dan Wickstrom on
Okay if the table exists, what is the error message that you get when you run the query in psql?  Or is it the case that you don't get an error message when performing it in psql?
Collapse
6: Response to apm error (response to 1)
Posted by Adam Shimali on
Sorry I should have mentioned that the query works fine from psql.