• Resolved wp_edu

    (@alemao2k6)


    I am using the latest version of wordpress and all plugins, I was trying to update some snippets today and I was surprised with errors 500, could not save the snippets, not even create new ones or import snippets.

    On my debug, I found this:

    [21-Sep-2023 06:05:21 UTC] WordPress database error Unknown column ‘revision’ in ‘field list’ for query UPDATE wp_snippets SET name =

    So I downloaded version 3.4.1 and installed it over 3.5, and now I can save the snippets.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Hi @alemao2k6,

    Did you try to update again to v3.5.0 to check whether the issue is fixed or it still persists?

    If you update and the issue persist, please check your error log in your site root folder, and take a look to the latest error logged, and share it with us to try to understand what is happening in your case.

    Thread Starter wp_edu

    (@alemao2k6)

    Hi, I uptaded again via Dashboard, same problem returns. Reverted back to 3.4.1.

    Here is the log of the error:

    2023/09/22 00:38:28 [error] 66051#66051: *1854610 FastCGI sent in stderr: “PHP message: WordPress database error Unknown column ‘revision’ in ‘field list’ for query INSERT INTO wp_snippets (name, description, code, tags, scope, priority, active, modified, revision, cloud_id) VALUES (‘New snippet’, ”, ‘$test = \”Testing\”;’, ”, ‘global’, ’10’, ‘1’, ‘2023-09-22 00:38:28’, ‘2’, NULL) made by require(‘wp-blog-header.php’), wp, WP->main, WP->parse_request, do_action_ref_array(‘parse_request’), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, Code_Snippets\REST_API\Snippets_REST_Controller->create_item, Code_Snippets\save_snippet” while reading response header from upstream, client: 189.96.229.146, server: https://www.xxxxxxxx.com.br, request: “POST /wp-json/code-snippets/v1/snippets HTTP/2.0”, upstream: “xxxxxxxxxxxx.sock:”, host: “www.xxxxxxxx.com.br:xxxx”, referrer: “https://www.xxxxxxxx.com.br/wp-admin/admin.php?page=add-snippet”

    It seems like the newest version tries to save to a column that does not exist in the database.

    Thanks for providing more details, @alemao2k6.

    Could you please share your site info in a paste here:?https://pastebin.com/?

    You can copy your site info under Dashboard > Tools > Site Health > Info > Copy site info to clipboard.

    Please note that if you create the paste being logged in, you will be able to delete it later ??

    Thread Starter wp_edu

    (@alemao2k6)

    There is a lot of information that we prefer not to share in the Site Health site info.

    But I believe this is really a problem with the plugin, seems like there is a database column or field called ‘revision’ which does not exist and is generating the error. It seems to be related to the latest changes in the plugin.

    The version 3.4.1 works fine.

    I completely understand, @alemao2k6.

    That is why I recommended to create the paste with an account, so you can delete it later.

    Anyway, I’m using the latest version and I do not have any issue, so I think maybe you do not have enought rights to create new tables or columns in your database or maybe you have to update to 3.4.2 (download here), before updating to 3.5.0?

    Plugin Author Shea Bunge

    (@bungeshea)

    @alemao2k6

    It appears that something might have failed in the upgrade process for you. I can’t be completely sure what, but if you’re able to run this PHP code on your site with v3.5.0 installed it should cause the migrations to run manually:

    \Code_Snippets\DB::create_table( 'wp_snippets' );

    I am having the same issue on our website. Ever since updating to 3.5 I can’t edit or create new snippets without a 500 error.

    Plugin Author lightbulbman

    (@lightbulbman)

    Hello @alemao2k6

    Please try to run the code that Shea has mentioned. – if not then please bear with us as the next release will include a database error resolver which will hopefully be able to resolve any similar / related issues

    Thread Starter wp_edu

    (@alemao2k6)

    Hi guys, is that code supposed to go into our theme’s functions.php?

    It is a rather different code, we’re not used to codes that begin like that.

    \Code_Snippets\DB::create_table( 'wp_snippets' );

    Thanks for the support.

    Thread Starter wp_edu

    (@alemao2k6)

    Okay, installing v3.4.2 and updating didn’t do the trick, but running the code

    \Code_Snippets\DB::create_table( 'wp_snippets' );

    on my functions.php worked. Now I can save, disable, enable my snippets normally with v3.5.0

    Thanks for the help

    • This reply was modified 1 year, 1 month ago by wp_edu.
    geistit

    (@geistit)

    How did you “run it on your functions.php?” Having the same problem, putting it somewhere in functions.php doesnt help

    Yordan Soares

    (@yordansoares)

    Hi @geistit,

    The functions.php file is located in the root directory of your active theme (wp-content/themes/your-active-theme).

    Jacky Lam

    (@jackylamhk)

    If you’re here and can’t get the code snippet to run, Code Snippets now has the option under Snippets > Settings > Debug > Upgrade Database Table that will create this column for you.

    Yordan Soares

    (@yordansoares)

    Thanks for the advice, @jackylamhk!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Error 500 when updating snippets’ is closed to new replies.