ProtocolError for 127.0.0.1/magento/index.php/api/xmlrpc/: 302 Found

Asked by Holger Adelman

I have never gotten magentoerpconnect to work, I simply cannot get past the ”Synchronize Referential Settings”. I always get:
ProtocolError: <ProtocolError for 127.0.0.1/magento/index.php/api/xmlrpc/: 302 Found>

I have tried both OpenERP 5 and 6, Magento 1.5 and 1.6, Ubuntu LAMP and XAMPP 1.7.7, and Ubuntu 8.04LTS and 10.04LTS.
Nothing works! Now I'm gonna show all the steps I take during a fresh setup and hopefully someone can give me some helpful input :)

This is how I setup an Ubuntu 10.04LTS, OpenERP 6, XAMPP 1.7.7 and Magento 1.5 box ending with error.

# Ubuntu 10.04LTS i386 installation
IP: 192.168.1.1
Mask: 255.255.255.0
Gateway: 192.168.1.254
Name server: 81.216.34.100

Hostname: store
Domain name: xxxxxx.com

Username: openerp
Password: openerp

Software selection: OpenSSH server and PostgreSQL database

# XAMPP 1.7.7 installation
I download xampp-linux-1.7.7.tar.gz
sudo tar xvfz xampp-linux-1.7.7.tar.gz -C /opt
sudo /opt/lampp/lampp start

# Magento 1.5.1.0 installation
I download magento-1.5.1.0.tar.gz
sudo tar xvfz magento-1.5.1.0.tar.gz -C /opt/lampp/htdocs/
sudo chown -R nobody:root /opt/lampp/htdocs/magento

I go to http://store.xxxxxx.com/phpmyadmin and create a database called: magento

Now to http://store.xxxxxx.com/magento and go through the Installation Wizard.

I just leave the Locale settings as default for now:
Locale: English
Time Zone: Pacific Standard Time
Default Currency: US Dollar

Database Connection
Host: localhost
Database Name: magento
User Name: root
User Password: (blank)
Tables Prefix: (blank)

Web access options
Base URL: http://store.xxxxxx.com/magento/
Admin Path: admin
Enable Charts: checked
Skip Base URL Validation Before the Next Step: (blank)
Use Web Server (Apache) Rewrites: (blank)
Use Secure URLs (SSL): (blank)

Session Storage Options
Save Session Data In: File System

Login Information
Username: admin
Password: admin67

# Magento 1.5.1.0 setup
Now to http://store.xxxxxx.com/magento/index.php/admin/
And in “Magento Connect Manager” I change “Preferred State” to Beta
and now install extension http://connect20.magentocommerce.com/community/Openlabs_OpenERPConnector
It looks successful: Package community/Openlabs_OpenERPConnector 1.3.1 installed successfully

Now I add a new Web Service Role: admin
and set Resource Access to: All

And now add new Web Service User with User Name: openerp
and API Key: openerp
and select admin as User Role

Now to Index Management and Select All then Reindex Data.
Now to Cache Storage Management and Select All then Refresh.

# PostgreSQL preparation
sudo su postgres

postgres@store:/$ createuser openerp
Shall the new role be a superuser? (y/n) y

postgres@store:/$ psql template1

template1=# alter role openerp with password 'postgres';
ALTER ROLE

# OpenERP 6.0.3 installation
sudo apt-get update

sudo apt-get install python-lxml python-mako python-dateutil python-psycopg2 python-pychart python-pydot python-tz python-reportlab python-yaml python-vobject python-setuptools

wget http://www.openerp.com/download/stable/source/openerp-server-6.0.3.tar.gz
tar -xzf openerp-server-6.0.3.tar.gz
cd openerp-server-6.0.3
sudo python setup.py install

cd /usr/local/lib/python2.6/dist-packages/openerp-server/addons/

sudo wget http://apps.openerp.com/addon/get_module_as_zip/1187/base_external_referentials.zip
sudo wget http://apps.openerp.com/addon/get_module_as_zip/1159/base_sale_multichannels.zip
sudo wget http://apps.openerp.com/addon/get_module_as_zip/1294/product_images_olbs.zip
sudo wget http://apps.openerp.com/addon/get_module_as_zip/5665/product_links.zip
sudo wget http://apps.openerp.com/addon/get_module_as_zip/1224/product_m2mcategories.zip
sudo wget http://apps.openerp.com/addon/get_module_as_zip/6398/magentoerpconnect.zip

Now start the server: openerp-server

# OpenERP 6.0.3 setup
From a GTK client I create a new database
New Database Name: demo1
Load Demonstration Data: checked
Default Language: English (US)
Administrator Password: admin

I leave the default Company Information (OpenERP S.A.)

I select Warehouse Management and Sales Management.

Go with the default Belgium Chart of Accounts and the default on all other windows.

When done I go to Modules and select magentoerpconnect for installation.

Now to Magento Instances and create new with following data
Name: My local magento
Referential Type: Magento Version 1.3.2.4+
Location: http://127.0.0.1/magento
User Name: openerp
Password: openerp
Default Product Category: All products / Sellable
Default Language: English

Then I push “1 – Reload Referential Mapping Templates”
and now “2 – Synchronize Referential Settings”

This is where it fails with:

Environment Information :
System : Windows-XP-5.1.2600-SP3
OS Name : nt
Operating System Release : XP
Operating System Version : 5.1.2600
Operating System Architecture : 32bit
Operating System Locale : sv_SE.cp1252
Python Version : 2.5.2
OpenERP-Client Version : 6.0.3
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 599, in dispatch
    res = fn(db, uid, *params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/magentoerpconnect.zip/magentoerpconnect/magerp_core.py", line 64, in core_sync
    core_imp_conn = self.external_connection(cr, uid, inst, DEBUG)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/magentoerpconnect.zip/magentoerpconnect/magerp_osv.py", line 85, in external_connection
    return attr_conn.connect() and attr_conn or False
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/magentoerpconnect.zip/magentoerpconnect/magerp_osv.py", line 33, in connect
    self.session = self.ser.login(self.username, self.password)
  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 1243, in request
    headers
ProtocolError: <ProtocolError for 127.0.0.1/magento/index.php/api/xmlrpc/: 302 Found>

Question information

Language:
English Edit question
Status:
Solved
For:
Magento OpenERP Connector Edit question
Assignee:
No assignee Edit question
Solved by:
Holger Adelman
Solved:
Last query:
Last reply:
Revision history for this message
Holger Adelman (crazyzed) said :
#1

I finally got it working :)
Turns out I need to use the url http://store.xxxxxx.com/magento and NOT http://127.0.0.1/magento ,in the Magento module, even though Magento is run on the same server as OpenERP.
This might be common knowledge but I didn't know this!