在Ubuntu上托管Cloud Foundry失败

时间:2019-12-13 05:28:34

标签: cloudfoundry ubuntu-18.04 apt

我正在尝试将我的Django应用程序托管在cloudfoundry中。

但是托管失败并出现以下错误:

 **ERROR** Error running supply: failed to apt-get update Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
      Get:2 https://packages.microsoft.com/ubuntu/18.04/prod bionic InRelease [3,959 B]
      Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
      Get:4 https://packages.microsoft.com/ubuntu/18.04/prod bionic/main amd64 Packages [166 kB]
      Err:4 https://packages.microsoft.com/ubuntu/18.04/prod bionic/main amd64 Packages
        File has unexpected size (93512 != 165979). Mirror sync in progress? [IP: 13.91.48.226 443]
        Hashes of expected file:
         - Filesize:165979 [weak]
         - SHA512:ce0cd5497cdc9242a0e841113b3c280aa381555b20cde125fb1ded717ba89d936f004d0e64c83b3b6d5e2ef42756352975feb16ae5c7271cdcf631ffe6c3872a
         - SHA256:179eb71f2afb4a72bf5b11180b4d4c9ccf1644076dd75f5a7bbf880ecefafbba
         - SHA1:381a8321619083a4063fa8381bf3aa12a2dac5a3 [weak]
         - MD5Sum:54c730dd6a33c612b2ae3c23fe0cfcb7 [weak]
        Release file created at: Thu, 12 Dec 2019 19:59:19 +0000
      Get:5 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
      Get:6 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1,344 kB]
      Get:7 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
      Get:8 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
      Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,322 kB]
      Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [1,057 kB]
      Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [10.5 kB]
      Get:12 http://archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [795 kB]
      Get:13 http://archive.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [6,781 B]
      Get:14 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages [761 kB]
      rm: cannot remove '/var/cache/apt/archives/partial/*.deb': Permission denied
      Fetched 17.2 MB in 3s (5,576 kB/s)
      Reading package lists...
      W: Conflicting distribution: https://packages.microsoft.com/ubuntu/18.04/prod bionic InRelease (expected bionic but got stable)
      E: Failed to fetch https://packages.microsoft.com/ubuntu/18.04/prod/dists/bionic/main/binary-amd64/Packages.gz  File has unexpected size (93512 != 165979). Mirror sync in progress? [IP: 13.91.48.226 443]
         Hashes of expected file:
          - Filesize:165979 [weak]
          - SHA512:ce0cd5497cdc9242a0e841113b3c280aa381555b20cde125fb1ded717ba89d936f004d0e64c83b3b6d5e2ef42756352975feb16ae5c7271cdcf631ffe6c3872a
          - SHA256:179eb71f2afb4a72bf5b11180b4d4c9ccf1644076dd75f5a7bbf880ecefafbba
          - SHA1:381a8321619083a4063fa8381bf3aa12a2dac5a3 [weak]
          - MD5Sum:54c730dd6a33c612b2ae3c23fe0cfcb7 [weak]
         Release file created at: Thu, 12 Dec 2019 19:59:19 +0000
      E: Some index files failed to download. They have been ignored, or old ones used instead.


      exit status 100
   Failed to run all supply scripts: exit status 14
   Exit status 225
   Cell c33058db-3c05-4f3f-99db-d13037e2f2d7 stopping instance f82bda74-79bc-4110-9495-161830f18ffd
   Cell c33058db-3c05-4f3f-99db-d13037e2f2d7 destroying container for instance f82bda74-79bc-4110-9495-161830f18ffd
   Cell c33058db-3c05-4f3f-99db-d13037e2f2d7 successfully destroyed container for instance f82bda74-79bc-4110-9495-161830f18ffd
Error staging application: Staging error: staging failed
FAILED

以下是我的apt.yml:

---
keys:
- https://packages.microsoft.com/keys/microsoft.asc
repos:
- deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main
packages:
- msodbcsql17
- mssql-tools
- unixodbc-dev

一直工作到昨天晚上。但是今天突然停止工作了。我尝试使用cf-login重新登录并重新启动了系统。仍然没有运气。请帮助我解决它。

2 个答案:

答案 0 :(得分:2)

原始回复

这可能与 what-causes-failed-to-fetch-file-has-unexpected-size-mirror-sync-progress。 似乎dist已于2019年12月13日01:34更新,因此您使用的镜像可能尚未更新。

尝试显式添加Microsoft注册表:

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-add-repository https://packages.microsoft.com/ubuntu/18.04/prod
sudo apt-get update

按照documentation

新回复(由开发人员修复)

已解决,请参见:https://github.com/dotnet/core/issues/3995

这不是镜像,而是存储库问题。

由于发行版是在早上(2019-12-13)进行了更新并且发行版本在前一天进行了更新,因此InRelease文件似乎不是最新的。

例如,如果您对Packages.gz手动检查了MD5,SHA256和文件大小,则会发现存在差异:

  1. MD5实际:712391F77F24F2D9962FEE41CD41C55D,已在InRelease中报告:54c730dd6a33c612b2ae3c23fe0cfcb7,用于main / binary-amd64 / Packages.gz
  2. SHA256实际值:28B8996AF9C6D5A3298F1EDC3427C1DED03E69D5EFCECF8469A075083AA01557,已发布:179eb71f2afb4a72bf5b11180b4d4c9ccf1644076dd75f5a7bbf880ecefarybaged
  3. 实际文件大小:93512字节,预期值:165979。

但是,修复后,InRelease中报告的值与手动检查相对应。

有类似问题的(2019-12-13)问题: https://github.com/dotnet/core/issues/3988

https://github.com/dotnet/core/issues/2731

https://github.com/microsoft/vscode/issues/86925

答案 1 :(得分:0)

什么也没做,没有任何变化,但是在2天后尝试了。它起作用了。