OpenVBX upgrade problem

106 views
Skip to first unread message

James Cuzella

unread,
Aug 23, 2011, 3:31:32 PM8/23/11
to OpenVBX Development
Hello,

I have tried manually upgrading a customer's OpenVBX install from 0.91
to 1.0.3, and it was unsuccessful. During the database migration step
through the url: [OpenVBX URL]/upgrade , we encountered this JSON
error:

{"success":false,"message":"The requested resource was not
found","step":0,"tplvars":{"originalVersion":"47","version":
52,"updates":[{"type":"sql","filename":"48.sql","revision":"48"},
{"type":"php","filename":"49.php","revision":"49"},
{"type":"php","filename":"50.php","revision":"50"},
{"type":"sql","filename":"51.sql","revision":"51"},
{"type":"sql","filename":"52.sql","revision":"52"}]}}

It appears that these files do exist in the 'updates' folder. Has
anyone else encountered this error before?
I've got a valuable customer that really wants this upgrade, so help
would be greatly appreciated!

Thanks,

- James

Shawn Parker

unread,
Aug 23, 2011, 3:46:21 PM8/23/11
to OpenVBX Development
James,

We'll look in to this to see what's going on. Can you tell us what the
PHP Version and Hosting environment you're working in?

Thanks!

Shawn
sh...@twilio.com


On Aug 23, 12:31 pm, James Cuzella <james.cuze...@standingcloud.com>
wrote:

James Cuzella

unread,
Aug 23, 2011, 4:29:48 PM8/23/11
to openv...@googlegroups.com
Shawn,

Yes, we are running it on an Ubuntu 10.04 system using the standard LAMP stack with these versions:

$ php --version
PHP 5.3.2-1ubuntu4.9 with Suhosin-Patch (cli) (built: May  3 2011 00:45:52) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
$ mysql --version
mysql  Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (x86_64) using readline 6.1
$ apache2 -v
Server version: Apache/2.2.14 (Ubuntu)
Server built:   Nov 18 2010 21:19:09

- James

James Cuzella

unread,
Aug 24, 2011, 5:28:49 PM8/24/11
to openv...@googlegroups.com
Shawn,

Good news...  I've setup xdebug on a local VM and traced the issue back to a REST request to the twilio API in '/updates/50.php' on line 34 during the 'create_application' function.

The request is being made for a tenant named 'mim' which our client set up on his system.  It looks like $twilio_sid and $twilio_token are empty for this tenant... which is probably why the API server returns a 404.

Here's the response from api.twilio.com/2010-04-01:

<?xml version="1.0"?>
<TwilioResponse><RestException><Status>404</Status><Message>The requested resource was not found</Message></RestException></TwilioResponse>


It looks like this is what's holding up the upgrade process for our client.  Is this a simple misconfiguration issue on his part, or should the REST requests not even be made for users without a $twilio_sid?

James Cuzella
Jr Systems Administrator
Standing Cloud, Inc.
(303) 747-3844 x 907


On Tue, Aug 23, 2011 at 1:46 PM, Shawn Parker <sh...@twilio.com> wrote:

Shawn Parker

unread,
Aug 24, 2011, 6:20:47 PM8/24/11
to OpenVBX Development
Sweet, thanks for the detective work!

That's a tough call.
The client had to have nulled those values manually to get to that
state.

I do agree that a tenant without a valid Sid and Token pair shouldn't
be given an application, but this also leaves then in an awkward state
of not having an application. I guess here its safe to assume that
nulled Sid & Token pairs on a tenant should indicate an inactive
tenant. And we deal with that later (if it ever comes up again).

I'm working on upgrading the Twilio REST library in OpenVBX (am
working on the upgrade routine now, actually) and I'll skip over
tenants that don't have a valid sid/token pair.


On a side note, you might ask your client if he/she remembers doing
this and what the reason was. It very well could be that tenants
currently can't be deleted or disabled. Providing that option in the
future would probably get around running in to this again. I'll put
that on our list of things to do (a very long list!).

Shawn


On Aug 24, 2:28 pm, James Cuzella <james.cuze...@standingcloud.com>
wrote:
> Shawn,
>
> Good news...  I've setup xdebug on a local VM and traced the issue back to a
> REST request to the twilio API in '/updates/50.php' on line 34 during the '*
> create_application*' function.
>
> The request is being made for a tenant named 'mim' which our client set up
> on his system.  It looks like $twilio_sid and $twilio_token are empty for
> this tenant... which is probably why the API server returns a 404.
>
> Here's the response from api.twilio.com/2010-04-01:
>
> <?xml version="1.0"?>
> <TwilioResponse><RestException><Status>404</Status><Message>The requested
> resource was not found</Message></RestException></TwilioResponse>
>
> It looks like this is what's holding up the upgrade process for our client.
>  Is this a simple misconfiguration issue on his part, or should the REST
> requests not even be made for users without a $twilio_sid?
>
> James Cuzella
> Jr Systems Administrator
> Standing Cloud, Inc.
> (303) 747-3844 x 907http://www.standingcloud.com/

James Cuzella

unread,
Aug 25, 2011, 3:46:05 PM8/25/11
to openv...@googlegroups.com
Shawn,

Is there a way I can safely delete a tenant manually?  The client was just testing out the feature with a couple dummy accounts, and gave me the ok to get rid of them.

Thanks!

James Cuzella
Jr Systems Administrator
Standing Cloud, Inc.
(303) 747-3844 x 907



Shawn Parker

unread,
Aug 25, 2011, 3:54:29 PM8/25/11
to openv...@googlegroups.com
We don't currently, but we recently received a pull request from someone who has implemented the functionality. You can view the pull request here: https://github.com/twilio/OpenVBX/pull/148

I'm hoping to be able to give that an in-depth review soon because OpenVBX needs this functionality. The trick with deleting tenants is that you can delete them from OpenVBX fairly easily by emptying out some database entries, but the sub-account in Twilio will still remain and there's currently no interface for deleting sub-accounts.

---

Shawn Parker
Twilio, Inc

James Cuzella

unread,
Aug 25, 2011, 4:42:49 PM8/25/11
to openv...@googlegroups.com
I'll go ahead and delete these sub-accounts for him in the database so that I can proceed with the upgrade.   Is it too much of a problem to have some dangling twilio sub-accounts at the moment? (That's assuming there isn't a way to manually delete them?)

It looks like there are only 2 unnecessary tenants that that have a sid & token stored in the clients database, and the 1 that was originally created, but has the cleared out sid & token.  (The one that caused the upgrade problem).

James Cuzella
Jr Systems Administrator
Standing Cloud, Inc.
(303) 747-3844 x 907



Shawn Parker

unread,
Aug 25, 2011, 4:46:30 PM8/25/11
to openv...@googlegroups.com
No, it won't cause a problem at all. Those sub-accounts will simply sit idle.


---

Shawn Parker
Twilio, Inc



James Cuzella

unread,
Aug 25, 2011, 7:54:14 PM8/25/11
to openv...@googlegroups.com
Shawn,

I just deleted these tenants from the client's database, and the upgrade went successfully.  However, when he first logs in as the tenant user, the following error is displayed:

An unknown error occurred. Please contact your OpenVBX provider. Unable to complete request: http://< CLIENT'S_DOMAIN_HERE >/mim2devices/send_iphone_guide

After this box popped up, it looks like it was trying to send the iphone guide to his email address.  Can this safely be ignored?

James Cuzella
Jr Systems Administrator
Standing Cloud, Inc.
(303) 747-3844 x 907



Shawn Parker

unread,
Aug 25, 2011, 7:59:27 PM8/25/11
to openv...@googlegroups.com
I don't think I understand here. You removed the tenant from OpenVBX and then logged in as that tenant that was just removed?
Also, the iPhone guide shouldn't get emailed unless the "Start the Install" button has been clicked on the Devices screen.


---

Shawn Parker
Twilio, Inc



James Cuzella

unread,
Aug 25, 2011, 8:18:41 PM8/25/11
to openv...@googlegroups.com
No, I removed all but one as the client had asked.  He logged in as that remaining tenant.


James Cuzella
Jr Systems Administrator
Standing Cloud, Inc.
(303) 747-3844 x 907



Shawn Parker

unread,
Aug 26, 2011, 1:46:43 AM8/26/11
to openv...@googlegroups.com
Gotcha, so this is new, unrelated to the other issue, right?
Might indicate the potential for some other failure. Is there anything in the PHP error log corresponding to the time of the error?


---

Shawn Parker
Twilio, Inc



James Cuzella

unread,
Aug 26, 2011, 6:48:45 PM8/26/11
to openv...@googlegroups.com
Shawn,

I've checked the customer's access and error logs, and found the time when he'd logged into the site as the 'mim2' tenant user... There are no PHP errors there, but I did find a couple 404 errors.

It looks like his browser was making requests to pages without the trailing slash '/' after 'mim2' in the url.  For example:

__IP_SCRUBBED__ - - [25/Aug/2011:22:25:01 +0000] "POST /mim2devices/send_iphone_guide HTTP/1.1" 404 1069 "http://__DOMAIN_SCRUBBED__/mim2/devices" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1"
__IP_SCRUBBED__ - - [26/Aug/2011:00:53:52 +0000] "POST /mim2devices/number/add HTTP/1.1" 404 1070 "http://__DOMAIN_SCRUBBED__/mim2/devices" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1"

I've had mixed results reproducing this, and I've got a hunch that the request may be made by some old version of some javascript from v0.91 hanging around in the client's browser cache.  I'll check with the client to see if clearing the cache helps.

James Cuzella
Jr Systems Administrator
Standing Cloud, Inc.
(303) 747-3844 x 907



Shawn Parker

unread,
Aug 29, 2011, 11:55:01 AM8/29/11
to openv...@googlegroups.com
Yeah, that's certainly odd. That code was changed a while back.

---

Shawn Parker
Twilio, Inc



James Cuzella

unread,
Sep 12, 2011, 7:56:50 PM9/12/11
to openv...@googlegroups.com
Shawn,

We are currently working on updating our system to support OpenVBX version 1.0.4.  I've implemented a patch to the updates/50.php file that will only call the create_application function if both the twilio_sid and twilio_token values are not empty.

This seems to workaround the upgrade issue we encountered.  I hope to add this patch to our 1.0.4 upgrade scripts, so let me know if this would cause any unforeseen problems on the Twilio end.

James Cuzella
Jr Systems Administrator
Standing Cloud, Inc.
openvbx-upgrade.patch

Shawn Parker

unread,
Sep 12, 2011, 8:22:29 PM9/12/11
to openv...@googlegroups.com
We've already got this fix in develop. So, no, you won't have an issue with it ;)

--- 
Shawn Parker
Twilio, Inc
Attachments:
- openvbx-upgrade.patch

Reply all
Reply to author
Forward
0 new messages