openlabs / magento_integration

Magento OpenERP Integration
https://openerp-magento-connector.readthedocs.org/en/develop/
80 stars 77 forks source link

Resource path is not callable. #116

Open ttwhy opened 11 years ago

ttwhy commented 11 years ago

Hello,

i have a problem on the magento module side. The base exception showed in openERP:

  File "/usr/lib/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
Fault: <Fault 4: 'Resource path is not callable.'>

my research showed that it is a problem related to the first API Call

(my overwritten Handler/Abstract.php DEBUG (7): try to load module: sales/order_api Line 282 in file /var/www/web8/html/app/code/local/Mage/Api/Model/Server/Handler/Abstract.php

From MyDebugging: 013-08-30T19:28:11+00:00 DEBUG (7): try to load module: sales/order_api Line 28 2 in file ...

normal Server Exception:

#0 /var/www/web8/html/app/code/local/Mage/Api/Model/Server/Handler/Abstract.php(
140): Mage_Api_Model_Server_Adapter_Xmlrpc->fault('1', 'Internal Error....')
#1 /var/www/web8/html/app/code/local/Mage/Api/Model/Server/Handler/Abstract.php(
48): Mage_Api_Model_Server_Handler_Abstract->_fault('internal')
#2 /var/www/web8/html/app/code/local/Mage/Api/Model/Server/Handler/Abstract.php(
284): Mage_Api_Model_Server_Handler_Abstract->handlePhpError(4096, 'Object of class...', '/var/www/web8/h...', 284, Array)
#3 [internal function]: Mage_Api_Model_Server_Handler_Abstract->call('0209dda8627a200...', 'sales_order.get...', Array)
#4 /var/www/web8/html/lib/Zend/Server/Abstract.php(232): call_user_func_array(Array, Array)
#5 /var/www/web8/html/lib/Zend/XmlRpc/Server.php(599): Zend_Server_Abstract->_dispatch(Object(Zend_Server_Method_Definition), Array)
#6 /var/www/web8/html/lib/Zend/XmlRpc/Server.php(337): Zend_XmlRpc_Server->_handle(Object(Zend_XmlRpc_Request_Http))
#7 /var/www/web8/html/app/code/local/Mage/Api/Model/Server/Adapter/Xmlrpc.php(113): Zend_XmlRpc_Server->handle()
#8 /var/www/web8/html/app/code/core/Mage/Api/Model/Server.php(138): Mage_Api_Model_Server_Adapter_Xmlrpc->run()
#9 /var/www/web8/html/app/code/core/Mage/Api/controllers/XmlrpcController.php(39): Mage_Api_Model_Server->run()
#10 /var/www/web8/html/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Api_XmlrpcController->indexAction()
#11 /var/www/web8/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#12 /var/www/web8/html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /var/www/web8/html/app/co```de/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#14 /var/www/web8/html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#15 /var/www/web8/html/index.php(104): Mage::run('', 'store')
#16 {main} Line 289 in file /var/www/web8/html/app/code/local/Mage/Api/Model/Server/Handler/Abstract.php

I am using

sharoonthomas commented 11 years ago

Can it be due to some other module in magento side which breaks the API call for sale ? are other parts working like product import/export ?

ttwhy commented 11 years ago

Hey Sharoon,

i disabled all modules which may could influence this Problem. All thats left:

app/etc/modules$ grep true *
German_LocalePackDe.xml:            <active>true</active>
Mage_All.xml:            <active>true</active>
**Mage_Api2.xml:            <active>true</active>
Mage_Api.xml:            <active>true</active>**
Mage_Authorizenet.xml:            <active>true</active>
Mage_Bundle.xml:            <active>true</active>
Mage_Captcha.xml:            <active>true</active>
Mage_Centinel.xml:            <active>true</active>
Mage_Compiler.xml:            <active>true</active>
**Mage_Connect.xml:            <active>true</active>**
Mage_CurrencySymbol.xml:            <active>true</active>
Mage_Downloadable.xml:            <active>true</active>
Mage_ImportExport.xml:            <active>true</active>
Mage_Oauth.xml:            <active>true</active>
Mage_PageCache.xml:            <active>true</active>
Mage_Persistent.xml:            <active>true</active>
Mage_Weee.xml:            <active>true</active>
Mage_Widget.xml:            <active>true</active>
**Mage_XmlConnect.xml:            <active>true</active>
Openlabs_OpenERPConnector.xml:            <active>true</active>**

i marked all modules which my harm the normal System.

ttwhy commented 11 years ago

a bit further:

2013-08-31T08:38:58+00:00 DEBUG (7): ------------- ERROR -------------
2013-08-31T08:38:58+00:00 DEBUG (7): Object of class Openlabs_OpenERPConnector_Model_Sales_Order_Api could not be converted to string/var/www/we
b8/html/app/code/local/Mage/Api/Model/Server/Handler/Abstract.php
2013-08-31T08:38:58+00:00 DEBUG (7): 'Object of class Openlabs_OpenERPConnector_Model_Sales_Order_Api could not be converted to string''/var/www
/web8/html/app/code/local/Mage/Api/Model/Server/Handler/Abstract.php

My Abstract.php file is just the normal Abstract.php with all the logging

sharoonthomas commented 11 years ago

@ttwhy are you still having the issue ?

ttwhy commented 11 years ago

hey @sharoonthomas sadly yes. till now i did not find a way around this issue. I will try to get a php debugger at the WE to deliver more information about this issue. If you have any advice, i would be happy to try this before (i do not havea php debugging environment yet).

sharoonthomas commented 11 years ago

@ttwhy Do let us know if you want our engineers to take a look or if you need support.

ttwhy commented 11 years ago

@sharoonthomas i found out a bit more. Object of class Mage_Sales_Model_Order_Api could not be converted to string/var/www/web8/html/app/code/local/Mage/Api/Model/Server/Handler/Abstract.php based on the service call Sales/Order_Api

from the Abstract.php $model = Mage::getModel($modelName)

the strange thing -> if i replace $modelName with the normal String 'sales/order_api', i get some steps further (but the next steps fail, cause they cant change the model). So basicly it should be some kind of wrong model Call. Technical support would be great.

ttwhy commented 11 years ago

@sharoonthomas today i could investigate some more hours on this problem (i really want to use this setup in my company).

Anyway -> i added a toString method like this

public function __toString(){
        return "sales/order_api";
    }

to the Sales/Order/Api.php that took me on step further:

Server Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/openerp/addons/web/session.py", line 90, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/usr/lib/pymodules/python2.6/openerp/netsvc.py", line 293, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/lib/pymodules/python2.6/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 197, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/pymodules/python2.6/openerp/addons/magento_integration/wizard/import_websites.py", line 59, in import_websites
    mag_websites = core_api.websites()
  File "/usr/lib/pymodules/python2.6/openerp/addons/magento_integration/api.py", line 25, in websites
    return self.call('ol_websites.list', [])
  File "/usr/local/lib/python2.6/dist-packages/magento-0.4-py2.6.egg/magento/api.py", line 161, in call
    return self.client.call(self.session, resource_path, arguments)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.6/xmlrpclib.py", line 1253, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "/usr/lib/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
Fault: <Fault 4: 'Resource path is not callable.'>

the thing that made me wonder: ol_websites.list

As far as i can ready, this should point to the Items method from Website.php after adding a

public function __toString(){
        return "ol_websites";
    }

i came one step further. I will try to add all toString methods. Maybe this is based on a older php version,which does not work the same way as maybe modern php versions work. More info soon.

ttwhy commented 11 years ago

things stopped on groups. Adding the toString method for ol_groups did not help. the last error message:

Server Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/openerp/addons/web/session.py", line 90, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/usr/lib/pymodules/python2.6/openerp/netsvc.py", line 293, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/lib/pymodules/python2.6/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 197, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/pymodules/python2.6/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/pymodules/python2.6/openerp/addons/magento_integration/wizard/import_websites.py", line 70, in import_websites
    {'website_id': {'=': website.magento_id}}
  File "/usr/lib/pymodules/python2.6/openerp/addons/magento_integration/api.py", line 39, in stores
    return self.call('ol_groups.list', [filters])
  File "/usr/local/lib/python2.6/dist-packages/magento-0.4-py2.6.egg/magento/api.py", line 161, in call
    return self.client.call(self.session, resource_path, arguments)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.6/xmlrpclib.py", line 1253, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "/usr/lib/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
Fault: <Fault 4: 'Resource path is not callable.'>
sharoonthomas commented 10 years ago

are you still facing the issue ? If you are please feel free to reopen the bug report.

ttwhy commented 10 years ago

@sharoonthomas the bug still exists and i did not found a solution in related bugs yet. i can't reopen the issue, cause as far as i know, this would request commit rights for this project. it would be great if you could reopen this ticket. i think there are more people facing this issue. i would bet, all of them are using a updated magento version (like i do) and the problems are based on a missing functionality. but still, it would be great if someone would review this issue.

sharoonthomas commented 10 years ago

I have reopened the ticket.

Our debs have tested with magento 1.7.XX and we have not had issues

Skrypt commented 10 years ago

I had the same problem. I went into Magento System --> Tools --> Compilation. Disabled the compilation. Synchronized Openerp connector and it worked.

If you want to enable it; you need to recompile else you will encounter this bug and it will never synchronize.

ttwhy commented 10 years ago

did not help in my case :( i will try to use a fresh / untouched version of magento. i would bet it is related to a previews update.

vishalsanwar commented 9 years ago

Hi Sharoonthomas,

I have made my custom code to add product from mother site to child site, When I run my script then some times, I am getting the "Resource Path is not Callable" issue after my save products. Can you pls let me know the solution of this problem?

Thanks Vishal