Title: Error during resetPasswordForVirtualMachine · Issue #13387 · apache/cloudstack · GitHub
Open Graph Title: Error during resetPasswordForVirtualMachine · Issue #13387 · apache/cloudstack
X Title: Error during resetPasswordForVirtualMachine · Issue #13387 · apache/cloudstack
Description: problem Execution of resetPasswordForVirtualMachine fails when no password is provided explicitly. An error is seen in the API/UI, While debugging I could obfuscatePassword method is causing the failure https://github.com/apache/cloudsta...
Open Graph Description: problem Execution of resetPasswordForVirtualMachine fails when no password is provided explicitly. An error is seen in the API/UI, While debugging I could obfuscatePassword method is causing the fa...
X Description: problem Execution of resetPasswordForVirtualMachine fails when no password is provided explicitly. An error is seen in the API/UI, While debugging I could obfuscatePassword method is causing the fa...
Opengraph URL: https://github.com/apache/cloudstack/issues/13387
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error during resetPasswordForVirtualMachine","articleBody":"### problem\n\nExecution of resetPasswordForVirtualMachine fails ~when no password is provided explicitly~.\nAn error is seen in the API/UI,\n\n\u003cimg width=\"1156\" height=\"506\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/a9ce097a-92b6-47a1-87c5-fcbc36ce7a68\" /\u003e\n\nWhile debugging I could obfuscatePassword method is causing the failure https://github.com/apache/cloudstack/blob/main/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java#L340 \nIt wrongly trims the UserVMResponse string resulting in truncated string like,\n\n\u003cimg width=\"1329\" height=\"1258\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/8fb58b54-6d79-4bbe-a4b6-3c73eca38edd\" /\u003e\n\nThis causes failure while creating JSON object.\n\n```\n2026-06-10 04:41:39,009 ERROR [c.c.a.ApiAsyncJobDispatcher] (API-Job-Executor-5:[ctx-1f56cfeb, job-524]) (logid:4137017f) Unexpected exception while executing org.apache.cloudstack.api.command.admin.vm.ResetVMPasswordCmdByAdmin com.google.gson.JsonSyntaxException: java.io.EOFException: End of input at line 1 column 1390 path $.details.\n\tat com.google.gson.internal.Streams.parse(Streams.java:59)\n\tat com.google.gson.JsonParser.parseReader(JsonParser.java:102)\n\tat com.google.gson.JsonParser.parseReader(JsonParser.java:70)\n\tat com.google.gson.JsonParser.parseString(JsonParser.java:51)\n\tat com.google.gson.JsonParser.parse(JsonParser.java:115)\n\tat com.cloud.utils.HumanReadableJson.addElement(HumanReadableJson.java:60)\n\tat com.cloud.utils.HumanReadableJson.getHumanReadableBytesJson(HumanReadableJson.java:54)\n\tat org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl.convertHumanReadableJson(AsyncJobManagerImpl.java:430)\n\tat org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl.completeAsyncJob(AsyncJobManagerImpl.java:340)\n\tat com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:113)\n\tat org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:698)\n\tat org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)\n\tat org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)\n\tat org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)\n\tat org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)\n\tat org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46)\n\tat org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.run(AsyncJobManagerImpl.java:646)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base/java.lang.Thread.run(Thread.java:840)\nCaused by: java.io.EOFException: End of input at line 1 column 1390 path $.details.\n\tat com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1457)\n\tat com.google.gson.stream.JsonReader.doPeek(JsonReader.java:503)\n\tat com.google.gson.stream.JsonReader.hasNext(JsonReader.java:422)\n\tat com.google.gson.internal.bind.TypeAdapters$28.read(TypeAdapters.java:779)\n\tat com.google.gson.internal.bind.TypeAdapters$28.read(TypeAdapters.java:725)\n\tat com.google.gson.internal.Streams.parse(Streams.java:49)\n\t... 21 more\n```\n\n--Edited--\n\nRoot cause is async job result having password field twice, which results in a truncated String passed to JSON. This happens when VM's network VR is not running.\n`obfuscatePassword` method can be improved, and the password detail for the VM can be added with `display=false` so it doesn't end up in UserVmResponse.\n\n-------------\n\n### versions\n\n4.22.1, KVM Advanced zone but the issue could be preset for other configs as well\n\n### The steps to reproduce the bug\n\n1. Deploy a VM with a password enabled template\n2. Stop it\n3. Make sure VR for the network on which VM is deployed is not running\n4. Reset VM password without providing a password\n\n### What to do about it?\n\nFix the isssue","author":{"url":"https://github.com/shwstppr","@type":"Person","name":"shwstppr"},"datePublished":"2026-06-10T04:54:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/13387/cloudstack/issues/13387"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4f46d744-7b51-e398-7c18-fe76e767b450 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C5E8:21A353:3AFDD8:4FACD1:6A4D5D36 |
| html-safe-nonce | fa4ad642abc348eff7ae01c394b12faec2d27009e36ebec5861e3a20f3ade0b4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNUU4OjIxQTM1MzozQUZERDg6NEZBQ0QxOjZBNEQ1RDM2IiwidmlzaXRvcl9pZCI6IjgzNjI5ODM5OTA2NzIzMTc3NTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | eb8648368d53d72e8e394a5ffb7ca6d08c27c4b798a5bf214a46c17ee25f5649 |
| hovercard-subject-tag | issue:4628116338 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/cloudstack/13387/issue_layout |
| twitter:image | https://opengraph.githubassets.com/872efdc6bada123aaf4aa64ccf3cec3f9535dd2ba45f998e86f05ef567f30065/apache/cloudstack/issues/13387 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/872efdc6bada123aaf4aa64ccf3cec3f9535dd2ba45f998e86f05ef567f30065/apache/cloudstack/issues/13387 |
| og:image:alt | problem Execution of resetPasswordForVirtualMachine fails when no password is provided explicitly. An error is seen in the API/UI, While debugging I could obfuscatePassword method is causing the fa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | shwstppr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2a1443ff9733a3016431263ea73c93d8fe00c195eb4a7670ac30e7848f045441 |
| turbo-cache-control | no-preview |
| go-import | github.com/apache/cloudstack git https://github.com/apache/cloudstack.git |
| octolytics-dimension-user_id | 47359 |
| octolytics-dimension-user_login | apache |
| octolytics-dimension-repository_id | 9759448 |
| octolytics-dimension-repository_nwo | apache/cloudstack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 9759448 |
| octolytics-dimension-repository_network_root_nwo | apache/cloudstack |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f3bdd3157ea1f0fd738d408eceeead721acf1dc3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width