• Resolved vikp

    (@vikp)


    Im getting this error

    Your PHP Native Sessions table is missing a primary key. Please run?wp pantheon session add-index?and 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

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Contributor jazzs3quence

    (@jazzs3quence)

    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.txt and 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.

    Thread Starter vikp

    (@vikp)

    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 ?

    Plugin Contributor jazzs3quence

    (@jazzs3quence)

    Sure, on Pantheon with Terminus, you would use:

    terminus wp -- <site>.<env> pantheon session add-index

    I would recommend doing this on your live environment 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 on dev first, you can do that and repeat the process for each environment, since this updates the database, not the code.

    Thread Starter vikp

    (@vikp)

    okay Thanks!

    Thread Starter vikp

    (@vikp)

    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&#8217;

    but I’m getting some errors on CLI . anything wrong on this

    Plugin Contributor jazzs3quence

    (@jazzs3quence)

    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 1 year, 4 months ago by jazzs3quence.
    • This reply was modified 1 year, 4 months ago by jazzs3quence.
    Thread Starter vikp

    (@vikp)

    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]

    Plugin Contributor jazzs3quence

    (@jazzs3quence)

    The --url= value would need to match the custom domain of the site you’re trying to run the command against (so mycustomdomain.com not just mycustomdomain) and the site:env needs to actually be site.env where site is the ID of your site in pantheon and env is the environment you are running the command against (e.g. dev), see: https://docs.pantheon.io/terminus/examples#siteenv

    Does that help?

    Thread Starter vikp

    (@vikp)

    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&#8217;

    The “–url” option does not exist.

    *some special chars added automatically

    • This reply was modified 1 year, 4 months ago by vikp.
    • This reply was modified 1 year, 4 months ago by vikp.
    Plugin Contributor jazzs3quence

    (@jazzs3quence)

    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 1 year, 4 months ago by jazzs3quence.
    Thread Starter vikp

    (@vikp)

    Thank you for your support. its about some — dashes . all worked well

    Plugin Contributor jazzs3quence

    (@jazzs3quence)

    Awesome! I’m so glad I came back to add that last thought! ??

    Glad you got it working. ??

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Pantheon session add index message showing’ is closed to new replies.