Go 报错 error obtaining VCS status: exit status 128 Use -buildvcs=false to disable VCS stamping.

新建Go项目用air进行热重载时,启动air报错“error obtaining VCS status: exit status 128 Use -buildvcs=false to disable VCS stamping”,导致build项目失败。通过在终端输入特定内容,重新启动air后启动成功。

Go 报错 error obtaining VCS status: exit status 128 Use -buildvcs=false to disable VCS stamping.

背景:

新建一个 Go 项目打算利用 air 进行热重载时,使用air启动 air ,发现报错

build 项目失败
在这里插入图片描述

error obtaining VCS status: exit status 128
        Use -buildvcs=false to disable VCS stamping.
failed to build, error: exit status 1

解决方法

终端输入
go env -w GOFLAGS=-buildvcs=false
之后重新启动 air, 启动成功。
在这里插入图片描述

Jul 18 16:31:42 localhost dockerd: time="2025-07-18T16:31:42+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.version"..." module=containerd type=io.containerd.grpc.v1 Jul 18 16:31:42 localhost dockerd: time="2025-07-18T16:31:42+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.introspection"..." module=containerd type=io.containerd.grpc.v1 Jul 18 16:31:42 localhost dockerd: time="2025-07-18T16:31:42+08:00" level=info msg=serving... address="/var/run/docker/containerd/docker-containerd-debug.sock" module="containerd/debug" Jul 18 16:31:42 localhost dockerd: time="2025-07-18T16:31:42+08:00" level=info msg=serving... address="/var/run/docker/containerd/docker-containerd.sock" module="containerd/grpc" Jul 18 16:31:42 localhost dockerd: time="2025-07-18T16:31:42+08:00" level=info msg="containerd successfully booted in 0.005146s" module=containerd Jul 18 16:31:42 localhost dockerd: time="2025-07-18T16:31:42.789469957+08:00" level=info msg="[graphdriver] using prior storage driver: overlay2" Jul 18 16:31:42 localhost dockerd: time="2025-07-18T16:31:42.793801120+08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds" Jul 18 16:31:42 localhost dockerd: time="2025-07-18T16:31:42.795538282+08:00" level=info msg="Loading containers: start." Jul 18 16:31:42 localhost dockerd: Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: COMMAND_FAILED: INVALID_IPV: 'ipv4' is not a valid backend or is unavailable Jul 18 16:31:42 localhost systemd: docker.service: main process exited, code=exited, status=1/FAILURE Jul 18 16:31:42 localhost systemd: Failed to start Docker Application Container Engine. Jul 18 16:31:42 localhost systemd: Unit docker.service entered failed state. Jul 18 16:31:42 localhost systemd: docker.service failed. Jul 18 16:31:43 localhost systemd: docker.service holdoff time over, scheduling restart. Jul 18 16:31:43 localhost systemd: Stopped Docker Application Container Engine. Jul 18 16:31:43 localhost systemd: Starting Docker Application Container Engine... Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43.247862190+08:00" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found" Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43.250571124+08:00" level=info msg="libcontainerd: started new docker-containerd process" pid=261353 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="starting containerd" module=containerd revision=773c489c9c1b21a6d78b5c538cd395416ec50f88 version=v1.0.3 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.content.v1.content"..." module=containerd type=io.containerd.content.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.snapshotter.v1.btrfs"..." module=containerd type=io.containerd.snapshotter.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.btrfs" error="path /icooper/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter" module=containerd Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.snapshotter.v1.overlayfs"..." module=containerd type=io.containerd.snapshotter.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.metadata.v1.bolt"..." module=containerd type=io.containerd.metadata.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=warning msg="could not use snapshotter btrfs in metadata plugin" error="path /icooper/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter" module="containerd/io.containerd.metadata.v1.bolt" Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.differ.v1.walking"..." module=containerd type=io.containerd.differ.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.gc.v1.scheduler"..." module=containerd type=io.containerd.gc.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.containers"..." module=containerd type=io.containerd.grpc.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.content"..." module=containerd type=io.containerd.grpc.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.diff"..." module=containerd type=io.containerd.grpc.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.events"..." module=containerd type=io.containerd.grpc.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.healthcheck"..." module=containerd type=io.containerd.grpc.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.images"..." module=containerd type=io.containerd.grpc.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.leases"..." module=containerd type=io.containerd.grpc.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.namespaces"..." module=containerd type=io.containerd.grpc.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.snapshots"..." module=containerd type=io.containerd.grpc.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.monitor.v1.cgroups"..." module=containerd type=io.containerd.monitor.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.runtime.v1.linux"..." module=containerd type=io.containerd.runtime.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.tasks"..." module=containerd type=io.containerd.grpc.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.version"..." module=containerd type=io.containerd.grpc.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.introspection"..." module=containerd type=io.containerd.grpc.v1 Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg=serving... address="/var/run/docker/containerd/docker-containerd-debug.sock" module="containerd/debug" Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg=serving... address="/var/run/docker/containerd/docker-containerd.sock" module="containerd/grpc" Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43+08:00" level=info msg="containerd successfully booted in 0.005631s" module=containerd Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43.292626579+08:00" level=info msg="[graphdriver] using prior storage driver: overlay2" Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43.298251173+08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds" Jul 18 16:31:43 localhost dockerd: time="2025-07-18T16:31:43.299760264+08:00" level=info msg="Loading containers: start." Jul 18 16:31:43 localhost dockerd: Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: COMMAND_FAILED: INVALID_IPV: 'ipv4' is not a valid backend or is unavailable Jul 18 16:31:43 localhost systemd: docker.service: main process exited, code=exited, status=1/FAILURE Jul 18 16:31:43 localhost systemd: Failed to start Docker Application Container Engine. Jul 18 16:31:43 localhost systemd: Unit docker.service entered failed state. Jul 18 16:31:43 localhost systemd: docker.service failed. Jul 18 16:31:43 localhost systemd: docker.service holdoff time over, scheduling restart. Jul 18 16:31:43 localhost systemd: Stopped Docker Application Container Engine. Jul 18 16:31:43 localhost systemd: start request repeated too quickly for docker.service Jul 18 16:31:43 localhost systemd: Failed to start Docker Application Container Engine. Jul 18 16:31:43 localhost systemd: Unit docker.service entered failed state. Jul 18 16:31:43 localhost systemd: docker.service failed.
最新发布
07-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值