当使用“Gcloud应用程序日志读取”命令时,Gcloud崩溃并出现时间数据错误

时间:2023-02-07 15:24:38

I’m encountering an error that I’ve never seen before when I run “gcloud app logs read” after deploying my app using "gcloud app deploy".

在使用“gcloud应用程序部署”部署应用程序后,我运行“gcloud应用程序日志读取”时遇到了一个以前从未遇到过的错误。

This is the error: “ERROR: gcloud crashed (ValueError): time data '2016-09-16T19:39:42Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'”

这是错误:“错误:gcloud崩溃(ValueError):时间数据‘2016-09-16T19:39:42Z’不匹配格式‘%Y-%m-%dT%H:% m:%S.%fZ’”

I thought it might be because of some changes I made to the app, but I tried deploying a simple server and I’m still getting the same error when I try to look at the logs. Again, it does seem to be deploying, so I’m having trouble figuring out what the problem is with the logging functionality.

我认为这可能是因为我对应用程序做了一些更改,但我尝试部署一个简单的服务器,当我试图查看日志时,仍然会得到相同的错误。同样,它似乎是在部署,因此我很难弄清楚日志记录功能的问题所在。

IOW, no matter what I deploy, I get the same error.

现在,无论我部署什么,我都会得到相同的错误。

I get the same error when I deploy this:

我在部署时也遇到了同样的错误:

'use strict';

var express = require('express');

var app = express();

app.get('/', function (req, res) {
  res.status(200).send('Hello, world!');
});

// Start the server
var server = app.listen(process.env.PORT || '8080', function () {
  console.log('App listening on port %s', server.address().port);
  console.log('Press Ctrl+C to quit.');
});

If anyone has any ideas, it would be much appreciated. Thank you.

如果有人有什么想法,我将不胜感激。谢谢你!

Edit: Added code.

编辑:添加代码。

2 个解决方案

#1


2  

This is related to a known issue and should be fixed shortly. You can check the logs in the Cloud Console, or using the gcloud beta logging read command instead in the meantime.

这与已知的问题有关,应该在短期内解决。您可以检查云控制台中的日志,或者同时使用gcloud beta日志读取命令。

Update: we have a fix expected in the next Cloud SDK release.

更新:我们预期下一个云SDK版本会有一个修复。

Update: Cloud SDK 127.0.0 is out; please update your client and this should be resolved.

更新:云SDK 127.0.0退出;请更新您的客户端,这应该得到解决。

#2


1  

'2016-09-16T19:39:42Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'

'2016-09-16T19:39:42Z'不匹配格式'%Y-%m-%dT%H:% m:%S.%fZ'

Somewhere in your code, you are asking to show a datetime string with microseconds: .%f. But, the datetime element you are providing does not have the microseconds. Either remove the .%f, or make the datetime string have microseconds.

在代码中的某个地方,您要求显示一个带有微秒的datetime字符串:.%f。但是,您提供的datetime元素没有微秒。要么删除。%f,要么使datetime字符串具有微秒。

#1


2  

This is related to a known issue and should be fixed shortly. You can check the logs in the Cloud Console, or using the gcloud beta logging read command instead in the meantime.

这与已知的问题有关,应该在短期内解决。您可以检查云控制台中的日志,或者同时使用gcloud beta日志读取命令。

Update: we have a fix expected in the next Cloud SDK release.

更新:我们预期下一个云SDK版本会有一个修复。

Update: Cloud SDK 127.0.0 is out; please update your client and this should be resolved.

更新:云SDK 127.0.0退出;请更新您的客户端,这应该得到解决。

#2


1  

'2016-09-16T19:39:42Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'

'2016-09-16T19:39:42Z'不匹配格式'%Y-%m-%dT%H:% m:%S.%fZ'

Somewhere in your code, you are asking to show a datetime string with microseconds: .%f. But, the datetime element you are providing does not have the microseconds. Either remove the .%f, or make the datetime string have microseconds.

在代码中的某个地方,您要求显示一个带有微秒的datetime字符串:.%f。但是,您提供的datetime元素没有微秒。要么删除。%f,要么使datetime字符串具有微秒。