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

Error when setting sync tab DB connection. #920

Open
4 tasks done
f4w-git opened this issue Nov 12, 2024 · 6 comments
Open
4 tasks done

Error when setting sync tab DB connection. #920

f4w-git opened this issue Nov 12, 2024 · 6 comments

Comments

@f4w-git
Copy link

f4w-git commented Nov 12, 2024

Checklist

  • I have looked into the Readme and the documentation, and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

I have installed the plugin successfully. 5.x to be specific. Trying to set the sync tab and get an error "Database Connection to sync WordPress with for non-social connections. Must begin with con_" Documentation all over Auth0 sites refer to the 4.x version of the plugin(which I installed successfully with sync capabilities. Error is as follows: [22-Oct-2024 18:52:16 UTC] PHP Fatal error: Uncaught Auth0\SDK\Exception\ArgumentException: A value for id must be provided in /home/httpd/wp-content/plugins/wordpress/vendor/auth0/auth0-php/src/Exception/ArgumentException.php:51
Stack trace:
#0 /home/httpd/wp-content/plugins/wordpress/vendor/auth0/auth0-php/src/API/Management/Connections.php(93): Auth0\SDK\Exception\ArgumentException::missing('id')
#1 /home/httpdwp-content/plugins/wordpress/src/Actions/Configuration.php(939): Auth0\SDK\API\Management\Connections->get(NULL)
#2 /home/httpdwp-includes/class-wp-hook.php(326): Auth0\WordPress\Actions\Configuration->onUpdateSync(Array)
#3 /home/httpd/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)
#4 /home/httpd/wp-includes/formatting.php(5115): apply_filters('sanitize_option...', Array, 'auth0_sync', Array)
#5 /home/httpd/wp-includes/option.php(866): sanitize_option('auth0_sync', Array)
#6 /home/httpd/wp-admin/options.php(344): update_option('auth0_sync', Array)
#7 {main}
thrown in /home/httpd/wp-content/plugins/wordpress/vendor/auth0/auth0-php/src/Exception/ArgumentException.php on line 51

Reproduction

input con_ database connection and get error.

Additional context

No response

wp-auth0 version

5.2.1

WordPress version

6.6.2

PHP version

8.3

@f4w-git
Copy link
Author

f4w-git commented Nov 12, 2024

This is upon trying to save the database connection.

@kishore7snehil
Copy link

@f4w-git I can see that the setup is working fine and I would request you to double check if you aren't putting any extra spaces while adding the connection_id.

@f4w-git
Copy link
Author

f4w-git commented Dec 4, 2024

I am not putting any spaces in. I tried it again just now. It has to be with how I am installing then. The following is how the documentation says to install it. Is the following correct?

For standard WordPress installations, this command can be run from the wp-content/plugins sub-directory.

composer require symfony/http-client nyholm/psr7 auth0/wordpress:^5.0

@kishore7snehil
Copy link

kishore7snehil commented Dec 5, 2024

@f4w-git Alternatively, you can try out downloading the plugin source code from this link and place it in your <application_name>/wp-content/plugins folder. But, I would strongly recommend to use composer to upgrade plugin versions.

Moreover, this is how an ideal database connection value should look. Please be cautious of the trailing spaces.

image

@f4w-git
Copy link
Author

f4w-git commented Dec 6, 2024

Then this has to be an install issue. 100% brand new clean wordpress install. I have used 3 different hosting solutions. Dreamhost and 2 local ubuntu installs.

Here are my install procedures for that plugin.

  1. I use this link to download. https://github.com/auth0/wordpress/releases/tag/5.2.1
  2. install the plugin using Wordpress backend. It will not activate until I run composer:
  3. CLI in the wordpress/wp-content/wordpress-5.2.1 composer require symfony/http-client nyholm/psr7 auth0/wordpress:^5.0
  4. I can then activate the plugin.
  5. input all of the domain, id and secret.
  6. Sync page put in my DB connection. no spaces. The error still occurs.

Screenshot from 2024-12-06 10-15-08
Screenshot from 2024-12-06 10-14-44

@kishore7snehil
Copy link

@f4w-git This can be then something to do with the $input['database'] data not passing correctly in the onUpdateSync

Can you put some debug points and check if the value of your connection passing correctly to the $response? If the value passed will be an empty string or null then you will face this issue.

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

2 participants