bdcsv.py returns "The datetime zone id '00:00' is not recognised"
bdcsv.py returns "The datetime zone id '00:00' is not recognised"
我正在尝试 运行 bdcsv.py
:
$ sudo python /opt/bluedata/bundles/bluedata-epic-entdoc-minimal-release-3.7-2207/scripts/monitoring/bdcsv.py \
-c localhost \
-f cred.json \
-s 2018/02/07-00:00:00 \
-e 2018/02/07-23:59:59
我在使用自己的开始值和结束值时收到以下错误,因此对于此 post 我使用了 BlueData docs.
示例中的开始值和结束值
运行 上面 returns 下面的错误(我已经格式化了 json 以使其更具可读性):
processing data for virtual node: bluedata-40 ...
error: {
"error":{
"root_cause":[
{
"type":"parsing_exception",
"reason":"[date_histogram] failed to parse field [time_zone]",
"line":1,
"col":477
}
],
"type":"parsing_exception",
"reason":"[date_histogram] failed to parse field [time_zone]",
"line":1,
"col":477,
"caused_by":{
"type":"illegal_argument_exception",
"reason":"The datetime zone id '00:00' is not recognised"
}
},
"status":400
}
知道这里出了什么问题吗?
运行bdusage.py
时出现同样的错误。
时区似乎以错误的格式传递给了 ElasticSearch 查询。在这两个脚本中,您会发现以下几行(我添加了内联注释以进行说明):
tz = time.timezone / 3600 * -1
if tz < 0:
tzstr = str(tz).zfill(3) + ":00" # negative tz will produce strings like "-06:00"
else:
tzstr = str(tz).zfill(2) + ":00" # positiv tz will return e.g. "01:00"
tzstr
稍后将包含在查询中。您描述的错误仅在时差 >= 0 小时时出现,因为 ElasticSearch requires 时区的格式类似于 +01:00
或 -01:00
.
通过像这样替换上面代码中的最后一行来修复它:
tzstr = "+" + str(tz).zfill(2) + ":00" # positiv tz will now return e.g. "+01:00"
对我有用的解决方案是在我所在的机器上安装 tzlocal 运行 bdcsv.py 脚本:
sudo pip install tzlocal
我正在尝试 运行 bdcsv.py
:
$ sudo python /opt/bluedata/bundles/bluedata-epic-entdoc-minimal-release-3.7-2207/scripts/monitoring/bdcsv.py \
-c localhost \
-f cred.json \
-s 2018/02/07-00:00:00 \
-e 2018/02/07-23:59:59
我在使用自己的开始值和结束值时收到以下错误,因此对于此 post 我使用了 BlueData docs.
示例中的开始值和结束值运行 上面 returns 下面的错误(我已经格式化了 json 以使其更具可读性):
processing data for virtual node: bluedata-40 ...
error: {
"error":{
"root_cause":[
{
"type":"parsing_exception",
"reason":"[date_histogram] failed to parse field [time_zone]",
"line":1,
"col":477
}
],
"type":"parsing_exception",
"reason":"[date_histogram] failed to parse field [time_zone]",
"line":1,
"col":477,
"caused_by":{
"type":"illegal_argument_exception",
"reason":"The datetime zone id '00:00' is not recognised"
}
},
"status":400
}
知道这里出了什么问题吗?
运行bdusage.py
时出现同样的错误。
时区似乎以错误的格式传递给了 ElasticSearch 查询。在这两个脚本中,您会发现以下几行(我添加了内联注释以进行说明):
tz = time.timezone / 3600 * -1
if tz < 0:
tzstr = str(tz).zfill(3) + ":00" # negative tz will produce strings like "-06:00"
else:
tzstr = str(tz).zfill(2) + ":00" # positiv tz will return e.g. "01:00"
tzstr
稍后将包含在查询中。您描述的错误仅在时差 >= 0 小时时出现,因为 ElasticSearch requires 时区的格式类似于 +01:00
或 -01:00
.
通过像这样替换上面代码中的最后一行来修复它:
tzstr = "+" + str(tz).zfill(2) + ":00" # positiv tz will now return e.g. "+01:00"
对我有用的解决方案是在我所在的机器上安装 tzlocal 运行 bdcsv.py 脚本:
sudo pip install tzlocal