【问题标题】:ROLLBACK when I upload file more 100M to S3 via server EC2当我通过服务器 EC2 将更多 100M 的文件上传到 S3 时回滚
【发布时间】:2018-07-30 20:55:55
【问题描述】:

我可以通过 EC2 将小于 100M 的视频上传到 S3。但是当我尝试上传超过 100M 的文件时,我遇到了这个问题:

生产的尾巴.rb:

[dbe91a4c-0c42-48c2-8165-ae9f71cc39c4] Command :: file -b --mime '/tmp/RackMultipart20180220-14826-1x1yb8.mp4'
[dbe91a4c-0c42-48c2-8165-ae9f71cc39c4] [paperclip] Trying to link /tmp/RackMultipart20180220-14826-1x1yb8.mp4 to /tmp/b93945416b51d7b7076bcf9f697819dd20180220-14826-5mkak1.mp4
[dbe91a4c-0c42-48c2-8165-ae9f71cc39c4] [paperclip] Trying to link /tmp/b93945416b51d7b7076bcf9f697819dd20180220-14826-5mkak1.mp4 to /tmp/1c3b7d3617b75c8c2177c1dfde03e9ce20180220-14826-kklptr.mp4
[dbe91a4c-0c42-48c2-8165-ae9f71cc39c4] Command :: file -b --mime '/tmp/1c3b7d3617b75c8c2177c1dfde03e9ce20180220-14826-kklptr.mp4'
[dbe91a4c-0c42-48c2-8165-ae9f71cc39c4]    (0.1ms)  BEGIN
[dbe91a4c-0c42-48c2-8165-ae9f71cc39c4] [paperclip] Trying to link /tmp/b93945416b51d7b7076bcf9f697819dd20180220-14826-5mkak1.mp4 to /tmp/1c3b7d3617b75c8c2177c1dfde03e9ce20180220-14826-bw0wgm.mp4
[dbe91a4c-0c42-48c2-8165-ae9f71cc39c4] Command :: file -b --mime '/tmp/1c3b7d3617b75c8c2177c1dfde03e9ce20180220-14826-bw0wgm.mp4'
[dbe91a4c-0c42-48c2-8165-ae9f71cc39c4]    (0.1ms)  ROLLBACK
[dbe91a4c-0c42-48c2-8165-ae9f71cc39c4]   Rendering videos/new.slim within layouts/application

在文件/tmp/

total 809304
drwxrwxrwt  8 root   root        4096 Feb 20 13:15 ./
drwxr-xr-x 23 root   root        4096 Feb 13 14:54 ../
-rw-------  4 ubuntu ubuntu 133547466 Feb 20 13:09 1c3b7d3617b75c8c2177c1dfde03e9ce20180220-14826-bw0wgm.mp4
-rw-------  4 ubuntu ubuntu 133547466 Feb 20 13:09 1c3b7d3617b75c8c2177c1dfde03e9ce20180220-14826-kklptr.mp4
-rw-------  4 ubuntu ubuntu 133547466 Feb 20 13:09 b93945416b51d7b7076bcf9f697819dd20180220-14826-5mkak1.mp4
drwxrwxrwt  2 root   root        4096 Feb 13 14:54 .font-unix/
-rwx------  1 ubuntu ubuntu        93 Feb 20 12:04 git-ssh-where-film-production-dunice.sh*
drwxrwxrwt  2 root   root        4096 Feb 13 14:54 .ICE-unix/
-rw-------  1 ubuntu ubuntu 279808355 Feb 20 12:50 puma20180220-11196-cyloww
-rw-------  1 ubuntu ubuntu  14679270 Feb 20 12:50 RackMultipart20180220-11196-1t5jbyk.mp4
-rw-------  4 ubuntu ubuntu 133547466 Feb 20 13:09 RackMultipart20180220-14826-1x1yb8.mp4
drwx------  3 root   root        4096 Feb 14 06:41 systemd-private-8b23ec1f7e8644498bf0091b6fd675d2-systemd-timesyncd.service-xl7iRW/
drwxrwxrwt  2 root   root        4096 Feb 13 14:54 .Test-unix/
drwxrwxrwt  2 root   root        4096 Feb 13 14:54 .X11-unix/
drwxrwxrwt  2 root   root        4096 Feb 13 14:54 .XIM-unix/

我通过回形针上传文件。在本地运行没有问题。

这个命令 file -b --mime '/tmp/1c3b7d3617b75c8c2177c1dfde03e9ce20180221-12338-1xbpmbo.mp4'

返回这个:

application/octet-stream; charset=binary

【问题讨论】:

    标签: ruby-on-rails amazon-web-services paperclip


    【解决方案1】:

    另一个地方是检查你的服务器的 nginx 配置。

    nginx.conf 中查找client_max_body_size

    免责声明:这是服务器配置的一部分,而不是 Rails 应用程序的一部分。

    【讨论】:

    • client_max_body_size 2000M;
    【解决方案2】:

    您是否检查了存储空间或可用 RAM?

    df -h --total or free -m
    

    也检查this answer

    【讨论】:

    • 总计 : 990 已使用 : 519 免费 : 268 共享 : 36 buff/cache : 203 可用 : 278
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多