Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not connect Jetpack #237

Closed
essentialexch opened this issue Aug 9, 2017 · 9 comments
Closed

Can not connect Jetpack #237

essentialexch opened this issue Aug 9, 2017 · 9 comments

Comments

@essentialexch
Copy link

I've opened a case with Jetpack support, but I'm curious if this might be a Project Nami issue...

I'm using Project Nami 1.6.1 installed into Azure using the PN installer.

Below is the first part of the advanced debug. I've gone so far as to reinstall the entire site and install Jetpack first (and then activate it and attempt connection). The error doesn't change. It is constant. Jetpack is installed. It is activated. I cannot 'Connect Jetpack'.

Error: {'error':'Jetpack not connected','error_description':'We were unable to find a Jetpack instance on your site. Please connect Jetpack to your WordPress.com account from within your WordPress admin.'}

Is it possible or even likely that this is because of a PN issue?

Thanks for help!

Debug Info

jQuery version: 1.12.4

CLIENT_ID:
BLOG_TOKEN:
MASTER_USER:
CERT: 0
TIME_DIFF: 1
VERSION: 5.2.1:1502245520
OLD_VERSION: 5.2.1:1502245520
PUBLIC:
USER_ID: 1
USER_TOKEN: [this user has no token]
PHP_VERSION: 7.0.21
WORDPRESS_VERSION: 4.8.1
JETPACK__VERSION: 5.2.1
JETPACK__PLUGIN_DIR: D:homesitewwwrootwp-contentpluginsjetpack/
SITE_URL: http://www.essential.exchange
HOME_URL: http://www.essential.exchange
PLAN: JetpackPlanfree

Jetpack Sync Full Status: `Array
(
[started] => Thu, 01 Jan 1970 00:00:00 +0000
[queue_finished] => Thu, 01 Jan 1970 00:00:00 +0000
[send_started] => Thu, 01 Jan 1970 00:00:00 +0000
[finished] => Thu, 01 Jan 1970 00:00:00 +0000
[sent] => Array
(
)

[queue] => Array
    (
    )

[config] => 
[total] => Array
    (
    )

)
`
Sync Queue size: 0
Sync Queue lag: 0 seconds
Full Sync Queue size: 0
Full Sync Queue lag: 0 seconds
Sync IDC URLs: {'home':'http://www.essential.exchange','siteurl':'http://www.essential.exchange','WP_HOME':'','WP_SITEURL':''}
Sync error IDC option: false
Sync IDC Optin: 1

HTTP_HOST: www.essential.exchange
SERVER_PORT: 80
HTTPS: off
HTTP_X_FORWARDED_FOR: 107.77.97.130:62259
REMOTE_ADDR: 107.77.97.130
PROTECT_TRUSTED_HEADER: false

TEST RESULTS:

HTTP: PASS
HTTPS: PASS
IDENTITY_CRISIS: PASS
SELF: FAIL

@patrickebates
Copy link
Member

It might be a PN issue. We do have to make some translation effort with a few Jetpack calls.

If you FTP into the site, you can find the LogFiles folder. Within it, you should have php_error.log and translate.log. If you find anything with a timestamp around your Jetpack issues, let us know here.

@essentialexch
Copy link
Author

OK, it does appear to be PN:

"INSERT IGNORE" is not supported by MS SQL Server.

I am 100% certain that you know more about SQL than I do, but I did examine these resources on the topic:
https://stackoverflow.com/questions/2513174/how-to-avoid-duplicates-in-insert-into-select-query-in-sql-server
https://stackoverflow.com/questions/21220753/what-is-a-insert-ignore-equivalent-in-ms-sql-server

How soon can I get a fix? :-)

Thanks!

php_errors.log:
[10-Aug-2017 00:42:52 UTC] WordPress database error [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near the keyword 'INTO'. Code - 156 for query INSERT IGNORE INTO wp_options ( option_name, option_value, autoload ) VALUES ( 'jetpack_secrets', 'a:1:{s:18:"jetpack_register_1";a:3:{s:8:"secret_1";s:32:"NbXdhgorxpqMUWj3NxADEQGHjwyRyoVH";s:8:"secret_2";s:32:"34BS63XljMhtKQRp0h0FNxgkIHDf0sIz";s:3:"exp";i:1502326372;}}', 'no' ) made by do_action('load-toplevel_page_jetpack'), WP_Hook->do_action, WP_Hook->apply_filters, Jetpack_Admin_Page->admin_page_load, Jetpack->admin_page_load, Jetpack::try_registration, Jetpack::register, Jetpack::generate_secrets, Jetpack_Options::update_raw_option

translate.log:
2017-08-10 00:42:52 Error Code: 156 -- Begin Query translation attempt:
INSERT IGNORE INTO wp_options ( option_name, option_value, autoload ) VALUES ( 'jetpack_secrets', 'a:1:{s:18:"jetpack_register_1";a:3:{s:8:"secret_1";s:32:"NbXdhgorxpqMUWj3NxADEQGHjwyRyoVH";s:8:"secret_2";s:32:"34BS63XljMhtKQRp0h0FNxgkIHDf0sIz";s:3:"exp";i:1502326372;}}', 'no' )
2017-08-10 00:42:52 -- Translation result:
INSERT IGNORE INTO wp_options ( option_name, option_value, autoload ) VALUES ( 'jetpack_secrets', 'a:1:{s:18:"jetpack_register_1";a:3:{s:8:"secret_1";s:32:"NbXdhgorxpqMUWj3NxADEQGHjwyRyoVH";s:8:"secret_2";s:32:"34BS63XljMhtKQRp0h0FNxgkIHDf0sIz";s:3:"exp";i:1502326372;}}', 'no' )

@patrickebates
Copy link
Member

It's almost funny... This would work if it made the API call rather than going directly to the DB.

We'll see what we can do.

@essentialexch
Copy link
Author

Asking your opinion here.

It appears that this is putting a single record into the wp_options table, populating three fields. Can I manually inject this into the table without a fear of it screwing something up badly, in order to get Jetpack working?

Thanks.

@patrickebates
Copy link
Member

If you want to try a quick fix, then here you go. You need to edit two files, in both places you will remove the two words IGNORE INTO.

/class.jetpack-options.php Line 369
/sync/class.jetpack-sync-module-full-sync.php Line 330

YMMV, but if the calls just before those are working properly, that should work. If it doesn't, I can give you a couple of longer edits to make.

@essentialexch
Copy link
Author

You Are The Man!

Thank you very much.

@jeherve
Copy link

jeherve commented Oct 26, 2017

One should now be able to solve the issue by adding the following to the site's wp-config.php:

define( 'JETPACK_DISABLE_RAW_OPTIONS', true );

See Automattic/jetpack#7875 for more info.

@patrickebates
Copy link
Member

Thanks for that update. We may look at including that as a default value with new PN deployments going forward.

@patrickebates
Copy link
Member

Fixed by 8769db8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants