Pantheon session add index message showing
-
Im getting this error
Your PHP Native Sessions table is missing a primary key. Please run
wp pantheon session add-indexand verify that the process completes successfully and that this message goes away to resolve this issue on your live environment.How to solve this error. please share detailed solution where we have to run this command
wp pantheon session add-index
-
Hi @vikp —
This command should be run via WP-CLI. Your host might already have WP-CLI installed, in which case you should be able to open a terminal connection and follow the steps described in the admin (and in the readme (linked here but the same information is in your
readme.txtand on the plugin page).If your host does not already have WP-CLI installed, you may be able to contact them to get support in getting it set up.
The notice itself is harmless, but it identifies an inefficiency in the database that could slow down your site, particularly if it gets a lot of traffic or is under heavy load that the new WP-CLI commands resolve.
Could you please share the command for terminus :
terminus wp site:env wp pantheon session add-index
Is it something like this
for pantheon do we need to apply this on every environment from dev to live ?
Sure, on Pantheon with Terminus, you would use:
terminus wp -- <site>.<env> pantheon session add-indexI would recommend doing this on your
liveenvironment first and then pulling the database down to the lower environments once you’ve gone through the process, but if you feel more comfortable running it ondevfirst, you can do that and repeat the process for each environment, since this updates the database, not the code.okay Thanks!
Hi Chris
After I updated into 1.4.1 again I’m getting the error notice top with add-index message
I have run following command
$ terminus wp site.env pantheon session add-index –url=’https://site.com’
but I’m getting some errors on CLI . anything wrong on this
That all looks pretty good to me (besides the unicode characters in the URL, but I assume that’s a forum editor thing and not what you’re using in CLI), what are the errors you’re getting?
Although, the terminus command should be:
terminus wp site.env — pantheon session add-index –url='https://site.com'so you might be missing some dashes.
-
This reply was modified 2 years, 2 months ago by
Chris Reynolds.
-
This reply was modified 2 years, 2 months ago by
Chris Reynolds.
Thanks for the reply.
I’m getting below error. Also im using custom domains for my development multisites
site .pantheonsite.io’ not found. Verify
--url=<url>matches an existing site.
[notice] Command: site:env — wp — pantheon session add-index –url=mycustomdomain [Exit: 1][error]
The
--url=value would need to match the custom domain of the site you’re trying to run the command against (somycustomdomain.comnot justmycustomdomain) and thesite:envneeds to actually besite.envwheresiteis the ID of your site in pantheon andenvis the environment you are running the command against (e.g.dev), see: https://docs.pantheon.io/terminus/examples#siteenvDoes that help?
Yes I have replaced all those things. I removed my original site details security reasons.
$ terminus wp oursite.dev pantheon session add-index –url=’https://mydomain.com’
The “–url” option does not exist.
*some special chars added automatically
It looks like you’re missing some dashes in your terminus command, it should be:
terminus wp oursite.dev — pantheon session add-index –url=whatever.com
That’s probably why you are getting the “The –url option does not exist” now. But, the previous error, “site .pantheonsite.io’ not found.” might be happening is the url you are passing to the –url flag does not actually exist in the environment in which you are running the command, e.g. if you are running this on dev, you would need to use whatever domains exist in the dev environment, not the domains that exist in the live environment. (Although, if you are only doing this on dev, the changes won’t apply to your live environment. You can run it on dev, but once you can verify that it works, you should be running this on live so your live environment benefits from the added database indexes.)
(And, because auto-formatting is fun, that’s two dashes, not a single one, in the command. 😅)
-
This reply was modified 2 years, 2 months ago by
Chris Reynolds.
Thank you for your support. its about some — dashes . all worked well
Awesome! I’m so glad I came back to add that last thought! 😁
Glad you got it working. 🙂
-
This reply was modified 2 years, 2 months ago by
The topic ‘Pantheon session add index message showing’ is closed to new replies.