Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker部署完成后,出现了应用文件上传失败。 #575

Closed
robinchen opened this issue Sep 4, 2021 · 44 comments
Closed

docker部署完成后,出现了应用文件上传失败。 #575

robinchen opened this issue Sep 4, 2021 · 44 comments
Labels
question Further information is requested wontfix This will not be worked on

Comments

@robinchen
Copy link

docker部署完成后,出现了应用文件上传失败,是哪里设置有问题吗?安装步骤完全按照文档进行

@welcome
Copy link

welcome bot commented Sep 4, 2021

感谢你提交的问题或反馈,我会在有时间的时候回复在此期间你可以看看之前被解决的反馈说不定有你需要的答案。

@robinchen
Copy link
Author

提示 上传应用解析发现未知异常,原始错误:File /tmp/d20210905-335-1740fda/AppInfo-ios-9f6426e4294a01acfa3874b3b4435d51/Payload/UZApp.app/Info.plist not readable! 这个错误

@robinchen
Copy link
Author

image
安卓上传提示这个

@robinchen
Copy link
Author

robinchen commented Sep 5, 2021

# Generated on Sat Sep  4 13:55:22 CST 2021
# USE SSL: false
version: "3.8"

x-restart-policy: &restart_policy
  restart: unless-stopped

x-defaults: &defaults
  <<: *restart_policy
  image: ghcr.io/tryzealot/zealot:4.2.0
  depends_on:
    - redis
    - postgres
  env_file: .env
  volumes:
    - zealot-uploads:/app/public/uploads
    - zealot-backup:/app/public/backup
    - ./log:/app/log
  healthcheck:
    test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost/health || exit 1"]
  logging:
    driver: "json-file"
    options:
      max-size: "1g"
      max-file: "10"
      max-buffer-size: "4m"
      mode: "non-blocking"

services:
  redis:
    <<: *restart_policy
    image: redis:5-alpine
    command: redis-server
    volumes:
      - zealot-redis:/var/lib/redis/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
  postgres:
    <<: *restart_policy
    image: postgres:12-alpine
    volumes:
      - zealot-postgres:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: ze@l0t
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "postgres"]
  zealot:
    <<: *defaults
    ports:
      - "8080:80"

volumes:
  zealot-uploads:
    external: true
  zealot-backup:
    external: true
  zealot-redis:
    external: true
  zealot-postgres:
    external: true

@robinchen
Copy link
Author

上面是docker-compose文件

@icyleaf
Copy link
Member

icyleaf commented Sep 6, 2021

收到,看描述目前是 iOS 和 Android 都无法正常解析对吧?我明天来看下哈。

@robinchen
Copy link
Author

是的, 安卓和 IOS 都无法正常解析

@icyleaf
Copy link
Member

icyleaf commented Sep 7, 2021

提示 上传应用解析发现未知异常,原始错误:File /tmp/d20210905-335-1740fda/AppInfo-ios-9f6426e4294a01acfa3874b3b4435d51/Payload/UZApp.app/Info.plist not readable! 这个错误

这问题看似是你 iOS 包的 Info.plist 文件找不到或不可读,请检查这个文件是否正常;能把 ios 和 android 的包发到 https://cowtransfer.com/ 一份吗,我这边复现不到。

@robinchen
Copy link
Author

是不是 docker部署的时候没有权限访问?

@icyleaf
Copy link
Member

icyleaf commented Sep 7, 2021

不太可能,zealot-docker 已经帮你创建了外部的 volumes 持久化,看你的这样的部署方式只有 iOS 无法在设备上安装这个问题,因为你配置可被信任的 ssl 证书

@robinchen
Copy link
Author

安卓的也不行

@robinchen
Copy link
Author

image

@robinchen
Copy link
Author

日志里面也没有对应的错误信息

@icyleaf
Copy link
Member

icyleaf commented Sep 7, 2021

上图的情况默认应该会匿名把错误日志上报到 Sentry 的,我也没看到有任何崩溃日志 😞

@robinchen
Copy link
Author

那不知道什么问题了。奇怪了, 就是完全按照部署文档上面的来的。

@icyleaf
Copy link
Member

icyleaf commented Sep 7, 2021

如果不能提供文件的话帮忙确认下以下情况:

  1. 请提供下 zealot-docker 目录在执行 deploy 之后生成的 zealot_install_log-***.txt 文件内容
  2. ipa 文件解压缩后查看 Payload/UZApp.app/Info.plist 文件是否存在并能够正常打开(一个 xml 文件)
  3. apk 文件是否做过安全加固处理

@robinchen
Copy link
Author

robinchen commented Sep 7, 2021

▶ Parsing command line ...
  ______          _       _
 |___  /         | |     | |
    / / ___  __ _| | ___ | |_
   / / / _ \/ _` | |/ _ \| __|
  / /_|  __/ (_| | | (_) | |_
 /_____\___|\__,_|_|\___/ \__|

▶ Setting up error handling ...
ZEALOT_CLEAN_UP=false

▶ Checking requirements ...
which: no docker.io in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
which: no docker.io in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
Current OS: Linux x86_64
Docker version: 20.10.8
Docker Compose version: 1.29.2

▶ Generating .env file ...
Creating .env file

▶ Generating secret key ...
Secret key written to .env

▶ Generating domain ...
Input zealot domain, without http(s):// (eg, zealot.test).
ZEALOT_DOMAIN=Domain written to .env

▶ Configuring cert file(s) ...
How do you deploy?
  Use [L]et's Encryt SSL (default)
  Use [S]elf-signed SSL
  Do [n]ot use SSL? 


▶ Generating docker-compose.file ...
Generated docker-compose.yml

▶ Configuring Docker volumes ...
scripts/configure-volumes.sh: line 75: [: too many arguments
Which way do you choose to storage zealot data?
  Use Docker [V]olumes (default)
  Use [L]ocal file system

Created zealot-uploads.
Created zealot-backup.
Created zealot-postgres.
Created zealot-redis.
Exteral volumes write to file: docker-compose.yml

▶ Fetching Docker images ...
Pulling redis    ... 
Pulling postgres ... 
Pulling zealot   ... 
Pulling zealot   ... pulling from tryzealot/zealot
Pulling zealot   ... digest: sha256:20c4bad39b0233e2d2...
Pulling zealot   ... status: image is up to date for g...
Pulling zealot   ... done
Pulling redis    ... pulling from library/redis
Pulling postgres ... pulling from library/postgres
Pulling redis    ... digest: sha256:fea243676a4d2d67f5...
Pulling redis    ... status: image is up to date for r...
Pulling redis    ... done
Pulling postgres ... digest: sha256:de0effb7ca62f39616...
Pulling postgres ... status: image is up to date for p...
Pulling postgres ... done
Docker images pulled

▶ Turning things off ...
Removing network zealot_default
Network zealot_default not found.


-----------------------------------------------------------------

You're all done! Run the following command to get Zealot running:

  [sudo] docker-compose up -d

-----------------------------------------------------------------

@robinchen
Copy link
Author

http://www.360buys.cn 这是网址,账号密码 没动过, 你也可以试一下

@icyleaf
Copy link
Member

icyleaf commented Sep 7, 2021

通过安装日志发现有如下可能问题:

  1. 你的域名没被正确配置,请再 .env 文件修改 ZEALOT_DOMAIN 变量
  2. scripts/configure-volumes.sh 脚本执行有点问题,我来确认下是啥问题,

@robinchen
Copy link
Author

image
当前是这样配置的

@icyleaf
Copy link
Member

icyleaf commented Sep 7, 2021

我看你用 nginx 做了一次反向代理?

@robinchen
Copy link
Author

对,外面有一层nginx。

@robinchen
Copy link
Author

location ~* ^(/assets|/favicon.ico) {
access_log off;
expires max;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
    expires      30d;
    error_log /dev/null;
    access_log /dev/null;
    proxy_pass         http://127.0.0.1:8080;
}

location ~ .*\.(js|css)?$
{
    expires      12h;
    error_log /dev/null;
    access_log /dev/null; 
    proxy_pass         http://127.0.0.1:8080;
}

location / {
  proxy_redirect     off;
  proxy_set_header   Host               $host:$server_port;
  proxy_set_header   X-Forwarded-Host   $host:$server_port;
  proxy_set_header   X-Forwarded-Port   $server_port;
  proxy_set_header   X-Forwarded-Server $host;
  proxy_set_header   X-Real-IP          $remote_addr;
  proxy_set_header   X-Forwarded-For    $proxy_add_x_forwarded_for;
  proxy_buffering    on;
  proxy_pass         http://127.0.0.1:8080;
}

@robinchen
Copy link
Author

这是 nginx配置

@icyleaf
Copy link
Member

icyleaf commented Sep 7, 2021

你把 ghcr.io/tryzealot/zealot:4.2.0 改为 ghcr.io/tryzealot/zealot:nightly tag 再部署下看看,我确认下 sentry 有没有上报错误日志同时确认下没有关闭匿名错误日志。

@robinchen
Copy link
Author

现在启用的就是 nightly 版本

@robinchen
Copy link
Author

Generated on Sat Sep 4 13:55:22 CST 2021

USE SSL: false

version: "3.8"

x-restart-policy: &restart_policy
restart: unless-stopped

x-defaults: &defaults
<<: *restart_policy
image: ghcr.io/tryzealot/zealot:nightly
depends_on:
- redis
- postgres
env_file: .env
volumes:
- zealot-uploads:/app/public/uploads
- zealot-backup:/app/public/backup
- ./log:/app/log
healthcheck:
test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost/health || exit 1"]
logging:
driver: "json-file"
options:
max-size: "1g"
max-file: "10"
max-buffer-size: "4m"
mode: "non-blocking"

services:
redis:
<<: *restart_policy
image: redis:5-alpine
command: redis-server
volumes:
- zealot-redis:/var/lib/redis/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
postgres:
<<: *restart_policy
image: postgres:12-alpine
volumes:
- zealot-postgres:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ze@l0t
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
zealot:
<<: *defaults
user: "root"
ports:
- "8080:80"

volumes:
zealot-uploads:
external: true
zealot-backup:
external: true
zealot-redis:
external: true
zealot-postgres:
external: true

@icyleaf
Copy link
Member

icyleaf commented Sep 7, 2021

呃...你第一份 docker-compose.yml 是用的 4.2.0 版本的,请你自己好好看看...

@robinchen
Copy link
Author

对,第一份是4.2.0的。出现了问题。 所以我后面又重新部署了一遍。用的是nightly

@robinchen
Copy link
Author

image

@icyleaf
Copy link
Member

icyleaf commented Sep 7, 2021

你再重新拉取下 nightly tag

@robinchen
Copy link
Author

好的

@robinchen
Copy link
Author

已经重新拉取 部署了

@robinchen
Copy link
Author

image
依然是这个错误

@robinchen
Copy link
Author

image

@icyleaf
Copy link
Member

icyleaf commented Sep 7, 2021

sentry 也没有收到任何日志,你尝试配置下 https 吧,如果还不行我爱莫能助了,尴尬。

@icyleaf icyleaf added the question Further information is requested label Sep 7, 2021
@robinchen
Copy link
Author

配置了https的

@robinchen
Copy link
Author

你也是docker部署的吗?

@icyleaf
Copy link
Member

icyleaf commented Sep 7, 2021

当然的呢,问题怎么反馈我肯定原环境复原

@robinchen
Copy link
Author

好吧,相当神奇。这个和文件权限有关系吗? 之前我是修改了文件权限为777,有些功能就正常了。

@icyleaf
Copy link
Member

icyleaf commented Sep 7, 2021

你是怎么修改的文件权限?

@robinchen
Copy link
Author

进入docker容器。然后 chmod -R 777 /tmp
chmod 777 /app

@icyleaf
Copy link
Member

icyleaf commented Sep 7, 2021

容器用的是 root 用户在没有任何其他设置的情况文件系统没有不能读写的,除非是 volumes 挂载的是有其他权限

@stale
Copy link

stale bot commented Sep 22, 2021

由于太长时间没有得到回复本问题会自动被关闭,如果您还有问题可以重新开启或提交新问题。感谢你对于 Zealot 的关注!

@stale stale bot added the wontfix This will not be worked on label Sep 22, 2021
@stale stale bot closed this as completed Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wontfix This will not be worked on
Development

No branches or pull requests

2 participants