【问题标题】:json.exception.parse_error when calling google::cloud::storage::Client调用 google::cloud::storage::Client 时出现 json.exception.parse_error
【发布时间】:2018-10-03 10:58:58
【问题描述】:

https://github.com/GoogleCloudPlatform/google-cloud-cpp/ https://github.com/GoogleCloudPlatform/google-cloud-cpp/blob/master/google/cloud/storage/examples/storage_quickstart.cc

构建所有可用库后,运行 storage_quickstart

/home/google-cloud-cpp/build-output/google/cloud/storage/examples/storage_quickstart bucket_name project_id

得到这个

Standard C++ exception raised: [json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input; expected '[', '{', or a literal

错误

namespace gcs = google::cloud::storage;
gcs::Client client;

有什么想法吗?

【问题讨论】:

    标签: c++ google-cloud-storage google-cloud-cpp


    【解决方案1】:

    您的GOOGLE_APPLICATION_DEFAULT_CREDENTIALS 似乎未设置,或者指向的文件格式错误。希望这里的文档:

    https://googlecloudplatform.github.io/google-cloud-cpp/latest/storage/index.html

    可以帮助您解决此问题。如果您需要更多帮助,请随时在 GitHub 页面中打开错误。

    【讨论】:

    • 我的环境变量设置不正确。非常感谢。
    • 值得一提的是,我们合并了#1212,从现在开始应该会产生更好的错误消息。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-14
    • 2016-04-18
    • 2014-02-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多