ckimrie / Site-Manager

Module that allows you to remotely manage ExpressionEngine sites and synchronise data
69 stars 6 forks source link

Syncing Error #11

Closed geoffcowan closed 11 years ago

geoffcowan commented 11 years ago

Hello. Thought I'd give this one a spin as it sounds an excellent idea, however I seem to of stumbled at the first hurdle.

2 servers (MAMP local & remote Lamp stack/CentOS vps), both on EE 2.5.3. Clean install of both, set up a channel, one entry on local, attempt to sync channels and get the below message

The remote site returned an error as a response: error Unknown error encountered. Unable to sync.

I'm on a MBP, running Safari 6.0.1.

Local server - PHP 5.4.3 / mySQL 5.5.20 Remote server - PHP 5.2.9 / mySQL 5.0.96-community

Any ideas, or if you need more info from me, yell :)

Geoff

ckimrie commented 11 years ago

Hi Geoff. A few things:

geoffcowan commented 11 years ago

Hi Chris

Green lights everywhere :) Yep, I can browse through local and remote site configs / channels etc. In Firebug, on the sync, I see 2 calls, one to local which gets a 200 OK, one to the remote which gets a 500 error.

The post was

POST /exp2/index.php?ACT=24&site_id=1&k=cfee32019885f6120c76e7e7acfdd342&method=create_channel HTTP/1.1 Host: snipped User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:15.0) Gecko/20100101 Firefox/15.0.1 Accept: text/plain, /; q=0.01 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Referer: http://localhost:8888/ee/admin.php?S=d1071ea083939733ebf502ba0b5883f0d4a2850a&D=cp&C=addons_modules&M=show_module_cp&module=site_manager_client&method=sync Content-Length: 1838 Origin: http://localhost:8888 Pragma: no-cache Cache-Control: no-cache

The Response

HTTP/1.1 500 Internal Server Error Date: Tue, 23 Oct 2012 09:44:52 GMT Server: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 X-Powered-By: PHP/5.2.9 Set-Cookie: exp_last_visit=1035625492; expires=Wed, 23-Oct-2013 09:44:52 GMT; path=/ exp_last_activity=1350985492; expires=Wed, 23-Oct-2013 09:44:52 GMT; path=/ Connection: close Transfer-Encoding: chunked Content-Type: text/html

ckimrie commented 11 years ago

Can you switch on debug mode in the index.php file for the site that is causing the error?

This should then spit out some more detailed error information.

Sent from my iPhone

On 23 Oct 2012, at 10:50, Geoff Cowan notifications@github.com wrote:

Hi Chris

Green lights everywhere :) Yep, I can browse through local and remote site configs / channels etc. In Firebug, on the sync, I see 2 calls, one to local which gets a 200 OK, one to the remote which gets a 500 error.

The post was

POST /exp2/index.php?ACT=24&site_id=1&k=cfee32019885f6120c76e7e7acfdd342&method=create_channel HTTP/1.1 Host: snipped User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:15.0) Gecko/20100101 Firefox/15.0.1 Accept: text/plain, /; q=0.01 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Referer: http://localhost:8888/ee/admin.php?S=d1071ea083939733ebf502ba0b5883f0d4a2850a&D=cp&C=addons_modules&M=show_module_cp&module=site_manager_client&method=sync Content-Length: 1838 Origin: http://localhost:8888 Pragma: no-cache Cache-Control: no-cache

The Response

HTTP/1.1 500 Internal Server Error Date: Tue, 23 Oct 2012 09:44:52 GMT Server: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 X-Powered-By: PHP/5.2.9 Set-Cookie: exp_last_visit=1035625492; expires=Wed, 23-Oct-2013 09:44:52 GMT; path=/ exp_last_activity=1350985492; expires=Wed, 23-Oct-2013 09:44:52 GMT; path=/ Connection: close Transfer-Encoding: chunked Content-Type: text/html

— Reply to this email directly or view it on GitHub.

geoffcowan commented 11 years ago

Hello

I've tried that on both the "Master" (ie my local machine where I am trying to manage from), and the remote. Nothing else pops up.

Interesting if I try and hit the URL that is 500ing - I get the following, not sure if that helps!

An Error Was Encountered Unable to load the requested file: mock_admin_content.php

Thanks again, and sorry for the bother!

ckimrie commented 11 years ago

OK, well thats a start!

geoffcowan commented 11 years ago

OK.. both local and remote appear o have the correct paths in, they are both essentially 'clean' installs so no custom funkiness so far!

Not running any config things, all bits and bobs are in standard places (ie /system /themes etc).

Hope that helps. If you want I'm happy to give out remote server details to you (it's just a demo/sandbox server), or I can screenshare in skype etc if you need to click about my MAMP so to speak! :)

Geoff

ckimrie commented 11 years ago

Before we get to me directly logging in, can you go to line 675 of site_manager_server/models/local_data.php and then change:

//Load admon content controller
$this->EE->load->file(PATH_THIRD.$this->_module_name."/classes/mock_admin_content.php");

to the following:

//Load admon content controller
var_dump(PATH_THIRD.$this->_module_name."/classes/mock_admin_content.php");
$this->EE->load->file(PATH_THIRD.$this->_module_name."/classes/mock_admin_content.php");

Essentially just adding a var_dump debug command to output the path to the mock_admin_content.php file.

Can you then go the Sync Data page and attempt to sync a Fieldgroup (it will fail). In the web inspector can you try and read the debug output from the above code change? Essentially need to verify that the output path is correct for your installation.

ckimrie commented 11 years ago

I just patched another issue I encountered when doing some version sync testing. It seems to be identical to your issue.

Can you download the latest server version and install it on the remote site? Hopefully this should fix your issue.

ckimrie commented 11 years ago

Any luck?

geoffcowan commented 11 years ago

Just updated both local and remote to 0.2.1, same errors as before. I've also tried adding in the lines as instructed local_data.php

When I try and do a fieldgroup I get the following error -

Unknown error encountered. Unable to sync. Error encountered while trying to decrypt data: parsererror

ckimrie commented 11 years ago

Can you check the web inspector response preview for the AJAX requests when syncing?

In the last update I improved the debug output in order to allow the data to be viewable from the web inspector.

patpohler commented 11 years ago

Hey guys, I don't know if this is the same issue, but I had trouble syncing on my production environment too (Dreamhost). Apparently the file paths are case sensitive and a couple of libraries in Site Manager Server were being references in the wrong case. Here's a commit I did on my fork to fix the issue:

https://github.com/patpohler/Site-Manager/commit/e44b16f909ee755a82a15d9971e8490002e6574d

ckimrie commented 11 years ago

Thanks Pat! That's a very good point regarding case sensitive paths. Sloppy coding on my part.

Can you submit a pull request?

jlarrigan commented 11 years ago

We are having the exact same issue as @geoffcowan . Looking forward to a fix.

patpohler commented 11 years ago

Pull request as been submitted, anyone free feel check out my changes and do a "hot patch" on their own environments to see if it works while waiting for the master to be updated (it's just a couple of files that need to be tweaked).

ckimrie commented 11 years ago

Just implemented Pat's pull request along with some extra file path fixes throughout the module. Its not in the master branch yet, since I need to verify that this has no adverse effects.

Can you download from the issue branch and see if this solves your issue?

ckimrie commented 11 years ago

OK, just confirmed that the file path updates in 1bd5595 doesn't adversely affect case sensitive file systems, so its been merged into the main branch.

@jlarrigan & @geoffcowan: if you havent already could you download and install the latest version and let me know if this fixes your issue?

jlarrigan commented 11 years ago

I still get - Unable to load the requested file: mock_admin_content.php

I updated both server and client versions. Curious if it was fixed for @geoffcowan. My install has _ and - in the folder paths.

ckimrie commented 11 years ago

@jlarrigan Does the error output a line number?

ckimrie commented 11 years ago

Apologies guys, just found some more file paths that needed to be fixed. Hopefully this should be the last of the file path related fixes. Please checkout the latest commit, and thanks for your patience.

jlarrigan commented 11 years ago

No line numbers given but your newest commit gives me this error

Unable to load the requested file: cp.php

ckimrie commented 11 years ago

@jlarrigan well thats progress, and its led me to another case sensitive typo.

Latest commit fixes this and should hopefully get you further. Getting there!

geoffcowan commented 11 years ago

Hi, sorry for the delay.. client work / weekends in the way!

I've updated today, and success! I can sync. One small issue I came upon was that when my channels I was syncing, didn't have any fieldgroups attached to them I go the error "cannot create group "" ", when I added a fieldgroup, all was good in the world again.

Looking good to me now!

Thanks

jlarrigan commented 11 years ago

Nailed it! Works perfectly now. Thanks @ckimrie

ckimrie commented 11 years ago

@jlarrigan Glad to hear its working for you.

@geoffcowan There is a safety mechanism built in that prevents you from being able to sync a channel when the fieldgroup does not exist in the destination. This made sense to me, since if you want to move a channel you ideally want it to be automatically connected to the fieldgroup on the destination when migrated. Hence, as you saw, when attempting to sync before having migrated the fieldgroup first, an error is shown stating that you must sync the fieldgroup first.

Your error does appear to be a bit different though, since it relates to an error encountered while trying to create a fieldgroup called "". EE has a restriction that fieldgroups must have a name, so this is where that error comes from. If you encounter is error again please let me know by creating a new issue.

Thanks for the patience guys!