-
Notifications
You must be signed in to change notification settings - Fork 46
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
Save as a new version throws internal server error #113
Comments
The issue is still happening even after updating to strapi v4.12.0. It would seem like the issue comes from this file:
The function is declared here:
|
Hello @ZirixCZ, are you please able to inspect what is returned as |
I was having the same error and I managed to track it down to the use of the environment variable In my environment variables |
@craigbloodworth Thank you for the examination. That might definitely be the problem. Since there is We will put this in the readme. @ZirixCZ Could you please check whether this was the problem also for you? If so, we could close this issue. |
config/database.ts
Even though we had the above in our config, the enviromental variable |
it fixes also on version:
|
"Save as a new version" triggers an internal server error.
Clicking the "Save as a new version" button results in an internal server error.
This only happens to me when the CMS has been deployed, as the functions behave as expected locally. I am providing the logs that the CMS threw when showing an internal server error. I have the same data and configuration as on the CMS locally. I am not sure what the reason could be for getting the error message
"getLatestValueByDB is not a function or its return value is not iterable"
, so perhaps someone here can help me identify the possible causes.Steps to reproduce the behavior
Can't reproduce locally.
Expected behavior
The plugin is expected to generate a new version upon clicking the "Save as a new version" button.
System
Logs
[2023-08-10 17:27:40.167] error: getLatestValueByDB is not a function or its return value is not iterable
TypeError: getLatestValueByDB is not a function or its return value is not iterable
at createVersion (/app/node_modules/@notum-cz/strapi-plugin-content-versioning/server/services/core-api.js:74:28)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.save (/app/node_modules/@notum-cz/strapi-plugin-content-versioning/server/controllers/admin.js:39:12)
at async returnBodyMiddleware (/app/node_modules/@strapi/strapi/lib/services/server/compose-endpoint.js:52:18)
at async policiesMiddleware (/app/node_modules/@strapi/strapi/lib/services/server/policy.js:24:5)
at async /app/node_modules/@strapi/strapi/lib/middlewares/body.js:58:9
at async /app/node_modules/@strapi/strapi/lib/middlewares/powered-by.js:16:5
at async cors (/app/node_modules/@koa/cors/index.js:107:16)
at async /app/node_modules/@strapi/strapi/lib/middlewares/errors.js:13:7
at async /app/node_modules/@strapi/strapi/lib/middlewares/logger.js:9:5
[2023-08-10 17:27:40.168] http: POST /content-versioning/api::ourcontent.ourcontent/save?plugins[i18n][locale]=cs (336 ms) 500
The text was updated successfully, but these errors were encountered: