Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google compute engine 运行google compute engine实例的关闭脚本时出错:gsutil无法将文件复制到google云存储_Google Compute Engine_Shutdown Script - Fatal编程技术网

Google compute engine 运行google compute engine实例的关闭脚本时出错:gsutil无法将文件复制到google云存储

Google compute engine 运行google compute engine实例的关闭脚本时出错:gsutil无法将文件复制到google云存储,google-compute-engine,shutdown-script,Google Compute Engine,Shutdown Script,在实例关闭之前,我使用关闭脚本备份实例上的文件。 在这个关闭脚本中,gsutil工具用于将文件发送到google云存储的存储桶 /snap/bin/gsutil -m rsync -d -r /home/ganjin/notebook gs://ganjin-computing/XXXXXXXXXXX/TEST-202104/notebook 它长时间运行良好。但最近,出现了如下错误 如果我手动运行代码,它工作得很好。似乎systemd的作业管理有问题 谁能给我一些提示吗 INFO shut

在实例关闭之前,我使用关闭脚本备份实例上的文件。 在这个关闭脚本中,gsutil工具用于将文件发送到google云存储的存储桶

/snap/bin/gsutil -m rsync -d -r /home/ganjin/notebook gs://ganjin-computing/XXXXXXXXXXX/TEST-202104/notebook
它长时间运行良好。但最近,出现了如下错误

如果我手动运行代码,它工作得很好。似乎systemd的作业管理有问题

谁能给我一些提示吗

 INFO shutdown-script: /snap/bin/gsutil -m rsync -d -r /home/ganjin/notebook gs://ganjin-computing/XXXXXXXXXXX/TEST-202104/notebook
Apr 25 03:00:41 instance-XXXXXXXXXXX systemd[1]: Requested transaction contradicts existing jobs: Transaction for snap.google-cloud-sdk.gsutil.d027e14e-3905-4c96-9e42-c1f5ee9c6b1d.scope/start is destructive (poweroff.target has 'start' job queued, but 'stop' is included in transaction).
Apr 25 03:00:41 instance-XXXXXXXXXXX shutdown-script: INFO shutdown-script: internal error, please report: running "google-cloud-sdk.gsutil" failed: cannot create transient scope: DBus error "org.freedesktop.systemd1.TransactionIsDestructive": [Transaction for snap.google-cloud-sdk.gsutil.d027e14e-3905-4c96-9e42-c1f5ee9c6b1d.scope/start is destructive (poweroff.target has 'start' job queued, but 'stop' is included in transaction).]
  • 使用-f选项更新gsutil

    更新gsutil-f

    如果上面的命令不起作用,请尝试下面的命令:

    sudo-apt-get-update&&sudo-apt-get-仅升级安装谷歌云sdk

  • 更新来宾环境并尝试关闭实例。使用下面的链接作为更新来宾环境的参考

  • 如果仍然面临问题,请强制关机:

    sudo断电-f


  • 您当前的systemd版本是什么?您使用的systemd版本与脚本上次使用的版本相同吗?请检查是否有可用的更新(
    gcloud components update
    )。更新,我认为错误会消失。当我在实例(用于创建映像文件的实例)上运行“gcloud components Update”时,会出现错误:
    error:(gcloud.components.Update)您无法执行此操作,因为此云SDK安装由外部包管理器管理。请考虑使用通过以下描述的默认机制创建的云SDK的单独安装:https://cloud.google.com/sdk/
    我正在使用Ubuntu映像:
    Linux实例-XXXXXXX 5.4.0-1036-gcp#39 Ubuntu SMP-Thu Jan 14 18:41:17 UTC 2021 x86_64 x86_64 GNU/Linux
    尝试以下步骤:1)
    gcloud版本
    。写下
    gsutil
    的版本。2)
    sudo-apt-update
    。3)
    sudo apt升级
    。4)
    gcloud版本
    。5)
    gsutil
    更新了吗?