• Just did a test. One new post and one new page were deployed successfully on production. However, after deployment, I was logged out on production. Logging in gives me “You do not have sufficient permissions to access this page.” error, so can’t view any of the wp-admin pages.

    Interestingly, new post and new page shows the admin bar on top saying I’m logged-in, but going to the dashboard or my profile editing page gives the same error. Not sure if this is caused by something on my production site, or by this plugin and/or a bug in the deployment process.

    FYI, this is a dummy DEV/TEST/LIVE environments, and I’m deploying content batch from a 4th environment, let’s call it CONTENT. So, no actual harm was done other than me not being able to access my dummy production environment.

    https://www.ads-software.com/plugins/content-staging/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author stenberg.me

    (@stenbergme)

    Thanks for reporting this!

    Authors of the posts that you deploy will automatically be included in the batch. Sounds like your user has been replaced, you are still able to login, but you do not have permission to do anything.

    Thinking about it, we do not sync wp_user_roles (from wp_options), might be related.

    In this dummy environment, do you have more then one user? Any plugin or code that might modify user roles?

    Thanks!

    Thread Starter Bowo

    (@qriouslad)

    Thanks for the quick reply!

    Only one user with same username, password and email on both environments. However, I was trying out a scenario where the site I deployed from is not a ‘staging’ (copy) of the ‘production’ site. Different site with “Content Staging” plugin configured per instructed. Would that be the cause?

    I’m doing this thinking that “Content Staging” only deals with ‘posts’ and not the rest of the site (on both environments), so, should be able to pull it off. True enough, posts were deployed, but hence, the login issue.

    Also doing it in relation to a workflow requirements I mentioned in:
    https://www.ads-software.com/support/topic/deploy-to-both-live-and-dev-environments

    If this login issue is resolved (i.e. possible to deploy from non-staging site), and deploying to more than one environment (production and dev) is possible, this may very well the solution I’m looking for. But I realize this most probably is an edge case, so, not expecting you to solve for an edge case.

    Thanks!
    Bowo
    p.s. I have one more question that I’ll write down in a new thread.

    I actually also am running into this issue.

    What I have found after some research is that in my wp_usermeta table, there are some keys that use the db prefix, and this prefix varies from staging to production. (I do not have control over this, as I am hosting with Mediatemple and the staging site is a service they provide.)

    So after deploying a batch, if I check the wp_usermeta table in WP, I can see that those prefixes have been changed from the production prefix to the staging one.

    So wp_bmrcf2zpf2_capabilities becomes wp_cksfie4ndk2_capabilities

    If I edit them all and change them all back, I can again login.

    I hope this helps offer some insight. Does this seem like a resolvable issue? I’d love to be able to keep using this plugin, but obviously having to change these values after every deploy isn’t workable.

    Thanks!
    Philip

    Plugin Author stenberg.me

    (@stenbergme)

    Thanks @phillyj8.

    This could probably be handled by the plugin somehow, I’ll have a look at it.

    Plugin Author stenberg.me

    (@stenbergme)

    @qriouslad Content Staging should actually work even if it is not a plain copy of the production site.

    I’ll see if I can come up with anything that fixes the issue you experience with permissions. Is it the same thing for you that wp_capabilities has a prefix in the wp_options table (e.g. wp_bmrcf2zpf2_capabilities)?

    Thread Starter Bowo

    (@qriouslad)

    Thanks for chipping in @phillyj8! That’s useful debug info.

    @stenberg.mee:
    Great to know the ‘staging’ site doesn’t need to be a replica of ‘production’ for this plugin to work.

    Sorry can’t check wp_options table as I’ve deleted the dummy environments and their DBs the other day. But the way I built them as three separate installs mirrored using BackupBuddy full site migration (not using host’s staging functionality), they should have the same table prefix, and nothing I’ve done should be meddling with wp_capabilities.

    Hope that helps.

    Plugin Author stenberg.me

    (@stenbergme)

    @qriouslad @phillyj8

    I’ve pushed new code to the GitHub repo that will hopefully fix the permission issues you are experiencing after deploying a batch.

    To give it a try, grab the latest code from the develop branch:
    https://github.com/stenberg/content-staging/tree/develop

    Would be really grateful if you reported back whether this solves the issue or not.

    Thanks!

    Thank you, that did seem to fix this issue.

    When testing it, I created a batch with just one page, and after deploying it, rather than updating that page on Production, it duplicated it. Do you know why this might be? I assume the plugin is meant to handle updates to existing pages & posts?

    Also, will it handle theme-specific settings within post/pages? For example, the theme I’m using has settings within pages to list posts from specific categories, etc.

    Thanks again!

    Plugin Author stenberg.me

    (@stenbergme)

    Thank you @phillyj8 for verifying!

    The plugin handles updating posts, I have a theory on what’s going on.

    Could you please open up a new support thread for this issue and I’ll answer in there?

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘After deploying a batch, can't access WP admin on production’ is closed to new replies.