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

下载备份文件的时候 The one-time token does not exist #1037

Closed
MomentDerek opened this issue Aug 22, 2020 · 8 comments · Fixed by #1278
Closed

下载备份文件的时候 The one-time token does not exist #1037

MomentDerek opened this issue Aug 22, 2020 · 8 comments · Fixed by #1278
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@MomentDerek
Copy link

MomentDerek commented Aug 22, 2020

我的环境

版本:1.4.0-beta.2
数据库:H2 1.4.196 (2017-06-10)
运行模式:production
启动时间:2020-08-20 23:35


错误日志


2020-08-22 15:33:11.021  INFO 1452 --- [qtp826865256-1572] r.h.a.c.admin.api.BackupController       : Try to download backup file: [halo-backup-2020-08-22-14-44-28--741667122.zip]
2020-08-22 15:33:13.838  WARN 1452 --- [qtp826865256-1575] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: [50.7.253.101]
2020-08-22 15:33:13.839 ERROR 1452 --- [qtp826865256-1575] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [The one-time token does not exist], status: [400 BAD_REQUEST], data: [5113cd19666c437fa65ffa76f0021116]
2020-08-22 15:33:43.769  WARN 1452 --- [qtp826865256-1574] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: [50.7.253.101]
2020-08-22 15:33:43.769 ERROR 1452 --- [qtp826865256-1574] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [The one-time token does not exist], status: [400 BAD_REQUEST], data: [5113cd19666c437fa65ffa76f0021116]
2020-08-22 15:34:01.280  WARN 1452 --- [qtp826865256-507] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: [50.7.253.101]
2020-08-22 15:34:01.280 ERROR 1452 --- [qtp826865256-507] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [The one-time token does not exist], status: [400 BAD_REQUEST], data: [5113cd19666c437fa65ffa76f0021116]


期望行为

下载备份

当前行为

备份后下载,发现400,后面以为是我nginx里面的问题,但检查后发现似乎没有太大的问题,使用的是宝塔面板

后来通过ip+端口的方式进入,发现能成功下载备份

下面是我nginx


server
{
    listen 80;
    listen 443 ssl http2;
    server_name momincong.com;
    root /www/wwwroot/momincong.com;
    
    #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
    #error_page 404/404.html;
    #HTTP_TO_HTTPS_START
    if ($server_port !~ 443){
        rewrite ^(/.*)$ https://$host$1 permanent;
    }
    #HTTP_TO_HTTPS_END
    ssl_certificate    /www/server/panel/vhost/cert/momincong.com/fullchain.pem;
    ssl_certificate_key    /www/server/panel/vhost/cert/momincong.com/privkey.pem;
    ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    error_page 497  https://$host$request_uri;

    #SSL-END
    
    #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
    #error_page 404 /404.html;
    #error_page 502 /502.html;
    #ERROR-PAGE-END
    
    #PHP-INFO-START  PHP引用配置,可以注释或修改
    #include enable-php-72.conf;
    #PHP-INFO-END
    
    #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
    include /www/server/panel/vhost/rewrite/momincong.com.conf;
    #REWRITE-END
    
    #禁止访问的文件或目录
    location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
    {
        return 404;
    }
    
    #一键申请SSL证书验证目录相关设置
    location ~ \.well-known{
        allow all;
    }
    
    location / {
        
        proxy_set_header HOST $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_pass http://127.0.0.1:8090/;
    }
    
    access_log  /www/wwwlogs/momincong.com.log;
    error_log  /www/wwwlogs/momincong.com.error.log;
}

@MomentDerek MomentDerek added the kind/bug Categorizes issue or PR as related to a bug. label Aug 22, 2020
@ruibaby
Copy link
Member

ruibaby commented Aug 22, 2020

@JohnNiang

@JohnNiang JohnNiang self-assigned this Aug 22, 2020
@JohnNiang
Copy link
Member

稍后 check 一下。

@ruibaby
Copy link
Member

ruibaby commented Dec 8, 2020

这个问题处理了么?

@JohnNiang
Copy link
Member

无法复现。

@hongcyu
Copy link

hongcyu commented Jan 17, 2021

我也遇到这个问题了,重启应用,用IP访问都不行,不知道怎么解决

@ajieOwO
Copy link

ajieOwO commented Aug 10, 2022

我也遇到了同样的问题,出现Authentication failure: [The one-time token does not exist]报错并无法备份和下载备份文件(包括整站备份、数据导出和markdown导出)。
经排查,我遇到此问题是由于之前用另一个用户www运行了Halo,在/tmp路径下创建了与备份相关的同名文件夹halo-backup、halo-backup-markdown、halo-data-export。
现在我在用户名ajiebox下运行Halo,原有备份文件夹所属用户为www,且其它用户无读取写入权限。将halo-backup、halo-backup-markdown、halo-data-export删除,或更改用户组为运行Halo的用户组即可。
建议每一个Halo实例都初始化一个随机数,并将此随机数追加在备份导出文件夹名称中,这样在同一台服务器部署多个Halo实例不会出现备份文件夹无权限的问题。

@JohnNiang
Copy link
Member

Hi @ajieOwO ,有没有可能 token 参数并未携带过去呢?

@ajieOwO
Copy link

ajieOwO commented Aug 10, 2022

Hi @ajieOwO ,有没有可能 token 参数并未携带过去呢?

我排查到临时文件夹权限问题,并删除原有属于另一个用户的文件夹后,就已经能够正常备份,于是就此作罢,没有再理会其它方面的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants