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

OLAINDEX访问500错误解决方法 #404

Closed
hainc opened this issue Mar 13, 2021 · 14 comments
Closed

OLAINDEX访问500错误解决方法 #404

hainc opened this issue Mar 13, 2021 · 14 comments
Assignees
Labels
bug Something isn't working F&Q Frequently Asked Questions Feedback

Comments

@hainc
Copy link

hainc commented Mar 13, 2021

1. 该问题的重现步骤是什么?

正常请求访问文件,老是报500,后台不会报500

2. 你期待的结果是什么?实际看到的又是什么?

期待尽快修复

3. 问题出现的环境

  • 操作系统版本:CentOS 7.9.2009(Py3.7.8) x64
  • Apache/NGINX 版本:Nginx -Tengine2.2.4(2.3.2)
  • PHP 版本:7.2-7.4
  • OLAINDEX 版本:6.0
  • 浏览器版本:Chrome 88.0.4324.150 x64

QQ截图20210313171929

@hainc hainc added the bug Something isn't working label Mar 13, 2021
@suyin-long
Copy link

我试了下,按照如下图设置会好点:
1

@WangNingkai
Copy link
Owner

访问资源频率过高,导致的网络响应超时

@hainc
Copy link
Author

hainc commented Mar 16, 2021

我试了下,按照如下图设置会好点:
1

我试了下我的还是不行,后台还是报如图的错误

@hainc
Copy link
Author

hainc commented Mar 16, 2021

访问资源频率过高,导致的网络响应超时

就相当于正常的文件目录去访问文件,还是经常报500

@WangNingkai
Copy link
Owner

具体日志下方 还有个 Request Graph Error. 类似
image

可以查看微软那边返回的是什么问题,出现429的话就是账号受限制 @huiges

@hainc
Copy link
Author

hainc commented Mar 17, 2021

具体日志下方 还有个 Request Graph Error. 类似
image

可以查看微软那边返回的是什么问题,出现429的话就是账号受限制 @huiges

QQ截图20210317160522
我的没出现429而是提示超时啥的

@hainc
Copy link
Author

hainc commented Mar 17, 2021

具体日志下方 还有个 Request Graph Error. 类似
image

可以查看微软那边返回的是什么问题,出现429的话就是账号受限制 @huiges

这里有一份错误日志你可以看下
laravel-2021-03-17.log

@WangNingkai
Copy link
Owner

WangNingkai commented Mar 17, 2021

这里看应该是访问超时,国际版的账号访问连接确实会存在一些问题,可以调整超时时间和重试次数

->setTimeout(5)

$curl->setConnectTimeout(5);

$curl->setRetry(2);

@hainc
Copy link
Author

hainc commented Mar 17, 2021

这里看应该是访问超时,国际版的账号访问连接确实会存在一些问题,可以调整超时时间和重试次数

->setTimeout(5)

$curl->setConnectTimeout(5);

$curl->setRetry(2);

QQ截图20210317162010
还是报500,我在设置高点

@hainc
Copy link
Author

hainc commented Mar 17, 2021

->setTimeout(5)

$curl->setConnectTimeout(5);

$curl->setRetry(2);

改成以下就解决了
OLAINDEX/app/Service/GraphClient.php

Line 121 in 5abac5e

->setTimeout(10)
OLAINDEX/app/Service/GraphRequest.php

Line 217 in 5abac5e

$curl->setConnectTimeout(10);
OLAINDEX/app/Service/GraphRequest.php

Line 216 in 5abac5e

$curl->setRetry(5);

@WangNingkai WangNingkai added the F&Q Frequently Asked Questions Feedback label Mar 18, 2021
@WangNingkai WangNingkai pinned this issue Mar 18, 2021
@WangNingkai WangNingkai changed the title OLAINDEX访问老是报500 OLAINDEX访问500错误解决方法 Mar 29, 2021
@WangNingkai
Copy link
Owner

更新到最新版,一般不会再报错500

@heimdall99
Copy link

你好,使用docker安装之后,前台各功能正常,进入后台输入完密码,就报错500.在查看上述解决方案之后,依然无法解决。
主机:centos7.9 aarch64架构
docker版本:Docker version 20.10.6, build 370c289
镜像是:https://hub.docker.com/r/80x86/olaindex
以下是错误日志:
[2021-05-31 18:58:35] local.ERROR: Unsupported operand types (View: /app/resources/views/default/layouts/admin.blade.php) (View: /app/resources/views/default/layouts/admin.blade.php) {"exception":"[object] (ErrorException(code: 0): Unsupported operand types (View: /app/resources/views/default/layouts/admin.blade.php) (View: /app/resources/views/default/layouts/admin.blade.php) at /app/app/Helpers/Tool.php:94, ErrorException(code: 0): Unsupported operand types (View: /app/resources/views/default/layouts/admin.blade.php) at /app/app/Helpers/Tool.php:94, Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Unsupported operand types at /app/app/Helpers/Tool.php:94)

@heimdall99
Copy link

/app/app/Helpers/Tool.php 第94行如下:

{
    $units = array(' B', ' KB', ' MB', ' GB', ' TB');
    for ($i = 0; $size >= 1024 && $i < 4; $i++) {
        $size /= 1024;
    }

    return @round($size, 2) . $units[$i];
}

@twbworld
Copy link

twbworld commented Sep 6, 2022

我也出现了类似问题
image

调试发现导致500的出处

请求api https://login.microsoftonline.com/common/oauth2/v2.0/token 时报错invalid_grant如下:

{
    "errorCode": 400,
    "errorMessage": "HTTP/1.1 400 Bad Request",
    "request": {
        "client_id": "xxx",
        "client_secret": "xxx",
        "redirect_uri": "https://xxx/callback",
        "refresh_token": "xxxx",
        "grant_type": "refresh_token"
    },
    "response": {
        "error": "invalid_grant",
        "error_description": "AADSTS70000: The user could not be authenticated or user interaction is required. The user must sign in again and if needed grant the client application access to the requested scope.\r\nTrace ID: xxx\r\nCorrelation ID: xxx\r\nTimestamp: 2022-09-02 03:53:09Z",
        "error_codes": [70000],
        "timestamp": "2022-09-02 03:53:09Z",
        "trace_id": "xxx",
        "correlation_id": "xxx",
        "error_uri": "https://login.microsoftonline.com/error?code=70000"
    }
}

文档查看这样描述:
image

Microsoft Azure 配置:

  1. 设置了重定向 URI
  2. 也设置api权限, 如图:
    image

出现的原因未知

无奈的解决方案:

出现500, 都需要另开网页,成功登录 Microsoft Azure, 就会神奇的解决了,但过段时间就又会重新500错误

有大佬能帮助到我吗?彻底解决这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working F&Q Frequently Asked Questions Feedback
Projects
None yet
Development

No branches or pull requests

5 participants