E rsync rsync: send_files failed to open "/var/lib/lxcfs/cgroup/blkio/blkio.reset_stats": Permission denied (13)
...
E rsync rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1865) [generator=3.2.7]
Error: failed to copy fs from GCP VM "petclinic-springboot": failed copying vm to "/tmp/copy-1411243774": exit status 23
E ssh init ERROR: (gcloud.compute.ssh) There was a problem refreshing your current auth tokens: ('Failed to retrieve TOKEN from the Google Compute Engine metadata service. Status: 404 Response:\nb\'"No service account scopes specified."\'', <google.auth.transport.requests._Response object at 0x7fecf5c75550>)
E ssh init Please run:
E ssh init
E ssh init $ gcloud auth login
E ssh init
E ssh init to obtain new credentials.
E ssh init
E ssh init If you have already logged in with a different account:
E ssh init
E ssh init $ gcloud config set account ACCOUNT
E ssh init
E ssh init to select an already authenticated account to use.
Error: failed to initiate a connection with GCP VM "tomcat-server": exit status 1
如要解決這個問題,請嘗試使用 gcloud 執行 copy 指令,但不要使用 sudo。
使用 Snap 版本的 Docker 時,analyze 指令會失敗
如果您使用的是 Snap 版本的 Docker,則 analyze 指令會失敗。
在這種情況下,您可能會看到類似以下的錯誤訊息:
I Unpacking file system...
I Running analysis...
Error: running analysis failed: failed to run container: Error response from daemon: invalid mount config for type "bind": bind source path does not exist: PATH
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Issues with Migrate to Containers CLI\n=====================================\n\nThis document describes workarounds for some issues that you might\nencounter while working with the Migrate to Containers CLI.\n\nCopy operation fails due to permission errors\n---------------------------------------------\n\nTo gain read access on the entire file system, the `copy` command is\nrun using a superuser on the source machine. However, sometimes the copy\noperation still fails due to permission errors. This issue occurs because in\nsome cases even the superuser doesn't have read access to some directories on\nthe source machine.\n\nIn such cases, you might see an error message similar to the following message: \n\n E rsync rsync: send_files failed to open \"/var/lib/lxcfs/cgroup/blkio/blkio.reset_stats\": Permission denied (13)\n ...\n E rsync rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1865) [generator=3.2.7]\n Error: failed to copy fs from GCP VM \"petclinic-springboot\": failed copying vm to \"/tmp/copy-1411243774\": exit status 23\n\nAs a workaround for this issue, create a custom filter to exclude such\ndirectories from the copy operation.\n\nFor example, to exclude the `/var/lib/lxcfs` directory from the copy operation,\nadd the following custom filter in the filters file: \n\n - /var/lib/lxcfs\n\nFor more information, see\n[Reduce the size of the copied file system](/migrate/containers/docs/m2c-cli/copy-file-system#reduce_the_size_of_the_copied_file_system).\n\nCopy operation using `gcloud` fails to authenticate to the machine\n------------------------------------------------------------------\n\nIf you use `gcloud` to run the `copy` command with `sudo`, then in some cases,\nthe copy operation might fail to authenticate to the source machine. This issue\noccurs because `gcloud` is run with the same superuser that runs the\nMigrate to Containers CLI, and the superuser doesn't have the same credentials as the\nstandard user.\n\nIn such cases, you might see an error message similar to the following message: \n\n E ssh init ERROR: (gcloud.compute.ssh) There was a problem refreshing your current auth tokens: ('Failed to retrieve \u003cvar class=\"readonly\" translate=\"no\"\u003eTOKEN\u003c/var\u003e from the Google Compute Engine metadata service. Status: 404 Response:\\nb\\'\"No service account scopes specified.\"\\'', \u003cgoogle.auth.transport.requests._Response object at 0x7fecf5c75550\u003e)\n E ssh init Please run:\n E ssh init\n E ssh init $ gcloud auth login\n E ssh init\n E ssh init to obtain new credentials.\n E ssh init\n E ssh init If you have already logged in with a different account:\n E ssh init\n E ssh init $ gcloud config set account ACCOUNT\n E ssh init\n E ssh init to select an already authenticated account to use.\n Error: failed to initiate a connection with GCP VM \"tomcat-server\": exit status 1\n\nAs a workaround for this issue, try running the `copy` command using `gcloud`\nwithout `sudo`.\n\nThe `analyze` command fails when using the Snap version of Docker\n-----------------------------------------------------------------\n\nIf you're using the Snap version of Docker, then the `analyze` command fails.\n\nIn such cases, you might see an error message similar to the following message: \n\n I Unpacking file system...\n I Running analysis...\n Error: running analysis failed: failed to run container: Error response from daemon: invalid mount config for type \"bind\": bind source path does not exist: \u003cvar class=\"readonly\" translate=\"no\"\u003ePATH\u003c/var\u003e\n\nAs a workaround for this issue, install Docker again without using Snap. For\nmore information, see [Install Docker Engine](https://docs.docker.com/engine/install/)."]]