无法加载资源(err 500)lib.min.js尝试击中浏览器的云运行终点
我有一个带有Docker的节点应用程序。该代码在Localhost和Docker容器(带有Docker Run命令)上运行绝对不错,但是当将其部署到GCP Cloud Run时,它会出现一个错误,即在我单击URL之后,它无法加载lib.min.js文件。该文件称为lib.min.js是该网站的缩小版本,并按照webpack.config.js中指定的github页面加载。在浏览器中进行调试(尝试击中云运行终点时),我可以在源中看到其他构建文件(这些文件是从库库本身访问的(例如,块/gui.src)已加载,但只有此文件(但只有此文件( lib.min.js)未能加载500个错误
。使用以下链接固定了出站IP( https://cloud.google。 com/run/doc/configuring/static-outbound-ip ),因为我认为问题可能在于云运行实例无法访问Internet(由于动态IP而引起的服务,因此来自服务的出站/出口流量,因此没有能够加载lib.min.js),但这无济于事,问题保持不变,我添加了一些防火墙规则,以允许所有出口/入口流量通过此服务帐户,但也无济于事。该应用程序使用端口8601,这是Dockerfile中指定的内容,并且云运行部署也是如此。
问题可能在其他地方(例如端口或其他任何地方),还是我需要采取其他一些步骤?如果有人可以给任何指针,那就太好了。
(此外,在此错误之前也有警告)
2022-06-12 18:20:44.712 IST
警告:响应大小太大。请考虑减少响应尺寸。
2022-06-12 18:20:44.713 IST
错误:获取500 174 MS Chrome 81.0.4044.92 https://test-service-5ywoz37xea-uc.a.run.app/lib.min.js
I have a node app build with docker. The code runs absolutely fine on localhost and docker container (with docker run command) but when this is deployed to GCP cloud run it gives an error that it cannot load the lib.min.js file after I click on the url. This file called lib.min.js is a minified version of the website and is loaded in run time from github pages as specified in webpack.config.js. Debugging in the browser (when trying to hit the cloud run end point) I could see the other build files in the source (that were accessed locally from the repo itself (eg. chunks/gui.src) being loaded but only this file (lib.min.js) fails to load and it gives the 500 error. The gcp logs don't give any other extra information than the fact that this is a 500 error.
I tried to setup serverless vpc access and configured NAT to use static fixed outbound IP using the following link (https://cloud.google.com/run/docs/configuring/static-outbound-ip) as I thought the problem might be with cloud run instance not being able to access internet (outbound/egress traffic from the service due to dynamic IPs and hence not being able to load lib.min.js), but it did not help and the problem remained the same. Then, I added some firewall rules to allow all egress/ingress traffic through this service account but it did not help either. The app uses port 8601 and this is what is specified in the Dockerfile and the cloud run deployment as well.
Could the problem be somewhere else (eg. port or anything else) or I need to take some other steps? It would be great if someone could give any pointers.
(Also, just before this error there is a warning as well)
2022-06-12 18:20:44.712 IST
Warning: Response size was too large. Please consider reducing response size.
2022-06-12 18:20:44.713 IST
Error:GET 500 174 ms Chrome 81.0.4044.92 https://test-service-5ywoz37xea-uc.a.run.app/lib.min.js
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
传输编码:大于32MB的文件可能需要块状
标题。The
Transfer-Encoding: chunked
header might be required for files larger than 32mb.