WebFaction
Community site: login faq

Hi all-

I have a few python scripts that make use of update_website() that were working several months ago, but seem to be raising the following exceptions now (below). I use these scripts to point my site to a simple static app while I'm updating, and then point it back to my django app once I'm done. This used to work great, but from the message at the bottom of the traceback, it sounds as if update_website() is trying to create a new app as opposed to using the exitsing app. Has anything changed about this call that I've missed?

Thanks! Jon

>>> server.update_website(
session_id,
'mysite_dev',
webfaction_ipaddress,
False,
['dev.mysite.com',],
('mysite_dev_static', '/'))

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/local/lib/python2.7/xmlrpclib.py", line 1578, in __request
    verbose=self.__verbose
  File "/usr/local/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/local/lib/python2.7/xmlrpclib.py", line 1297, in single_request
    return self.parse_response(response)
  File "/usr/local/lib/python2.7/xmlrpclib.py", line 1473, in parse_response
    return u.close()
  File "/usr/local/lib/python2.7/xmlrpclib.py", line 793, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: "<class 'webfaction_api.exceptions.DataError'>:[u'Site app with this Site, Path and Account already exists.']">

asked 05 Jun '13, 18:37

jreisch
364
accept rate: 100%


This seems to resolve the issue:

  • First, remove the existing mapping of web apps to paths with the following (notice no *site_apps arg):

    server.update_website( session_id, 'mysite_dev', webfaction_ipaddress, False, ['dev.mysite.com',])

  • Then, redirect the site to the new app with a subsequent call (this time with the *site_apps arg):

    server.update_website( session_id, 'mysite_dev', webfaction_ipaddress, False, ['dev.mysite.com',], ('mysite_dev_static', '/'))

Previously, the api seemed to handle this automagically with just the last call. Looking at the error message now it seems to make more more sense.

It would be helpful to see this use case added to the API Documentation here: update_website()

Hope this is helpful to others later! Jon

permanent link

answered 05 Jun '13, 19:50

jreisch
364
accept rate: 100%

edited 05 Jun '13, 19:59

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×75
×11

question asked: 05 Jun '13, 18:37

question was seen: 1,555 times

last updated: 07 Jun '13, 02:18

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM