问题描述
我一直遵循https://cube.dev/docs/deployment#express-with-basic-passport-authentication上的指南将Cube.js部署到Lambda。我使它针对Athena数据库工作,以使//investor relationship
public function staff()
{
return $this->morphToMany(User::class,'staff')
->withPivot(['role'])
->withTimestamps();
}
//user relationship
public function investors()
{
return $this->morphedByMany(Investor::class,'staff');
}
端点能够成功工作并返回架构。
但是,当尝试在Lambda中查询Athena数据时,所有请求都会导致504网关超时。检查CloudWatch日志,我看到一个一致的错误:
screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
知道这可能是什么吗?
这是我的服务器。yml:
docker run -it --rm --privileged --pid=host alpine nsenter -t 1 -m -u -n -i sh
解决方法
即使此hostname
错误消息也记录在日志中,但这不是问题原因。
您最有可能遇到here所述的问题。
@cubejs-backend/serverless使用Internet连接来访问消息传递API以及VPC中的Redis,以管理队列和缓存。 其中之一在您的环境中不起作用。
此类超时通常表示internet connection或Redis connection存在问题。如果是Redis,通常在cubejs
和cubejsProcess
函数中都将在5分钟左右后看到超时。如果是互联网连接,您将不会在cubejsProcess
函数中看到任何查询处理日志。
根据更改日志this issue should have been fixed in 0.10.59,检查所使用的cube.js版本。
最有可能归因于cube.js的依赖关系,假设它将在其中运行的所有环境都可以运行hostname
shell命令(看起来好像正在使用node-machine-id。