Apigee命令行导入返回带NullPointerException的500

Apigee命令行导入返回带NullPointerException的500,apigee,Apigee,我正在尝试自定义部署脚本,以允许我从命令行部署四个API代理中的每一个。它看起来与Github上的示例中提供的非常相似: #!/bin/bash if [[ $# -eq 0 ]] ; then echo 'Must provide proxy name.' exit 0 fi dirname=$1 proxyname="teamname-"$dirname source ./setup/setenv.sh echo "Enter your password for us

我正在尝试自定义部署脚本,以允许我从命令行部署四个API代理中的每一个。它看起来与Github上的示例中提供的非常相似:

#!/bin/bash

if [[ $# -eq 0 ]] ; then
    echo 'Must provide proxy name.'
    exit 0
fi

dirname=$1
proxyname="teamname-"$dirname

source ./setup/setenv.sh

echo "Enter your password for user $username in the Apigee Enterprise organization $org, followed by [ENTER]:"

read -s password

echo Deploying $proxyname to $env on $url using $username and $org

./tools/deploy.py -n $proxyname -u $username:$password -o $org -h $url -e $env -p / -d ./$dirname

echo "If 'State: deployed', then your API Proxy is ready to be invoked."
echo "Run '$ sh invoke.sh'"
echo "If you get errors, make sure you have set the proper account settings in /setup/setenv.sh"
但是,当我运行它时,会得到以下响应:

Deploying teamname-gameassets to int on https://api.enterprise.apigee.com using my-email-address and org-name
Writing ./gameassets/teamname-gameassets.xml to ./teamname-gameassets.xml
Writing ./gameassets/policies/Add-CORS.xml to policies/Add-CORS.xml
Writing ./gameassets/proxies/default.xml to proxies/default.xml
Writing ./gameassets/targets/development.xml to targets/development.xml
Writing ./gameassets/targets/production.xml to targets/production.xml
Import failed to /v1/organizations/org-name/apis?action=import&name=teamname-gameassets with status 500:
{
  "code" : "messaging.config.beans.ImportFailed",
  "message" : "Failed to import the bundle : java.lang.NullPointerException",
  "contexts" : [ ],
  "cause" : {
    "contexts" : [ ]
  }
}

在部署过程中收到错误时,应该如何进行调试?登录到Apigee后,我是否可以查看某种控制台?

我不确定您的代理是如何以这种方式结束的,但看起来顶级目录名为“gameassets”。它应该命名为“apiproxy”。如果重命名此目录,您将看到成功的部署

此外,在进行过多自定义之前,请尝试使用“apigeetool”,这是一种用于部署代理的更灵活的命令行工具:


谢谢你,格雷格。这里的问题是,因为我要部署多个代理,所以我试图重命名从Apigee下载的Apigee代理目录,但没有意识到这会影响它。我所做的是创建以代理命名的目录,然后将apiproxy目录放在其中。这意味着我可以使用如下命令成功运行apigeetool:apigeetool deployproxy-o Organization-u user-p pass-e env name-n teamname gameassets-d./teamname gameassets/