php – Plesk hosted website prints 503 error every few requests

On my Debian Plesk Server I am hosting a domain and two sub domains. Everything was working perfectly for the last months without any code changes. Today I noticed that every few requests (klick of a button, navigation to another page,…) error 503 appeared and disappeared with another refresh.

I tested it with two simple php files that are connected with an tag. The result was that every 3rd to 5th klick error 503 appeared. However, the same test works perfectly without any errors on the main domain.

Just to be sure, I created another subdomain and tested the two linked php files and it showed error 503 like the other subdomains after some requests.

Is it possible that the last Plesk update trashed the php config of the sub domains? Is there any chance to fix that issue?

MySQL error: Missing index for constraint, can someone help me pls?

CREATE TABLE Account_Base
(ACCT_ID INT(4) NOT NULL,
OPEN_DATE DATE NOT NULL,
CLSE_DATE DATE NOT NULL,
PDCT_TYPE_C VARCHAR (10),
OPEN_CHNL VARCHAR (100),
ASST_OPEN_CHNL_DETL VARCHAR (100),
MOST_FREQ_USED_CHNL VARCHAR (100),
MOST_FREQ_USED_CHNL_DETL VARCHAR (100),
PRIMARY KEY (ACCT_ID, OPEN_DATE, CLSE_DATE, PDCT_TYPE_C),
CONSTRAINT FK_Account_Base_Customer_Account FOREIGN KEY (ACCT_ID) REFERENCES Customer_Account(ACCT_ID) ON UPDATE RESTRICT ON DELETE RESTRICT,
CONSTRAINT CK_Account_Base_OPEN_DATE_CLSE_DATE CHECK (OPEN_DATE>CLSE_DATE));

ALTER TABLE Account_Base MODIFY COLUMN PDCT_TYPE_C VARCHAR (10) NOT NULL;

CREATE TABLE Product_Reference
(PDCT_TYPE_C VARCHAR (10) NOT NULL,
PDCT_TYPE VARCHAR (100) NOT NULL,
PDCT_TYPE_DETL VARCHAR (100),
MNTH_FEE_COST INT (3),
EFFT_D DATE,
EXPY_D DATE,
PRIMARY KEY (PDCT_TYPE_C, PDCT_TYPE),
CONSTRAINT FK_Product_Reference_Account_Base FOREIGN KEY (PDCT_TYPE_C) REFERENCES Account_Base (PDCT_TYPE_C) ON UPDATE RESTRICT ON DELETE RESTRICT);

mysql – Keep getting this error for wordpress database set-up on my pi? ERROR 1044 (42000): Access denied for user ‘pi’@’localhost’ to database ‘wordpress’

As I’m setting up my wordpress database I keep getting this error:

ERROR 1044 (42000): Access denied for user ‘pi’@’localhost’ to database ‘wordpress’

After typing this and entering my password:

sudo mysql -upi -p

I got this:

Welcome to the MariaDB monitor. Commands end with ; or g.

Your MariaDB connection id is 57

Server version: 10.3.27-MariaDB-0+deb10u1 Raspbian 10

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the current input statement.

MariaDB ((none))>

And this was what I typed:

MariaDB ((none))> GRANT ALL PRIVILEGES ON wordpress.* TO 'pi'@'localhost' IDENTI FIED BY 'password';

I replaced the actual password with ‘password’ in this example for security reasons, but I tried all of the passwords that I had. Nothing worked. I keep getting the same error.

I also tried removing ‘pi’@’localhost’ and changing it to just ‘pi’. I also dropped and recreated the wordpress database and tried again. It’s always the same error.

Any suggestions? I have no clue where to continue from here.

7 – Updating modules creates An AJAX HTTP request terminated abnormally error

Drupal 7.77. I have three modules that need to be updated. Trying to update any one of them results in this error:

An AJAX HTTP request terminated abnormally. Debugging information follows. Path: http://www.mywebsite.com/authorize.php?batch=1&id=1069&op=do StatusText: ResponseText: ReadyState: 4.

Update Manager shows:

Notice: Undefined index: log in update_authorize_update_batch_finished() (line 187 of /home/mywebsite.com/modules/update/update.authorize.inc).
Warning: Invalid argument supplied for foreach() in update_authorize_update_batch_finished() (line 187 of /home/mywebsite.com/modules/update/update.authorize.inc).
Notice: Undefined index: log in update_authorize_update_batch_finished() (line 236 of /home/mywebsite.com/modules/update/update.authorize.inc).
Update failed!

I am not a coder and have no idea where to start.

7 – PDO database connection error?

Super strange, my site was up and working fine yesterday. Today, I navigate to my home page and I’m thrown this series of errors:

Warning: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in DatabaseConnection->__construct() (line 321 of /var/www/html/includes/database/database.inc).
PDOException: SQLSTATE(HY000) (2002) php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in lock_may_be_available() (line 167 of /var/www/html/includes/lock.inc).

To the best of my knowledge, this only occurs when the database connection settings are incorrect in the settings.php file, but all of mine are correct (and have been for quite some time). Any idea why this would suddenly change and throw this error? I’m stumped.

c – Error en threads de linux: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] pthread_exit ((void*)resultado);

Tengo que hacer un ejercicio donde unos threads en linux devulven los factoriales de los números que les metas. Pero me sale el

error warning: cast to pointer from integer of different size
(-Wint-to-pointer-cast)
pthread_exit ((void*)resultado);

Y no sé por qué. He probado de todo pero cuando se compila luego pone core dumped aunque le metas los numeros. Aquí tienen el código.

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
#include <sched.h>
#include <sys/resource.h>
#include <sys/wait.h>
#include <stdint.h>

//Creamos una función para sacar los factoriales


void *factoriales(int *numero)
{
    int resultado = 1;
    int v = *numero;


    if (v<0)
        pthread_exit((void*)-1); //Si es menor de 0 da error
    else{
        if(v == 0)
            pthread_exit ((void*)1); //Si es 0 devuelve 1 ya que ese es su factorial
        else{
            
            while (v>1) // Calculamos el factorial
            {
                resultado *= v;
                v--;
            }
            pthread_exit ((void*)resultado); // Lo devolvemos
        }
    }
}



int main (int argc, char * argv()) // Programa principal
{
    //Variables
    int r1,r2; // Resultados del threads
    int numero = atoi(argv(1));
    int numero2 = atoi(argv(2));
    int thread(2);
    
    //Obtención de los factoriales y su guardado en el array
    pthread_create(&thread(0), NULL, (void*)factoriales, (void*)&numero);
    pthread_create(&thread(1), NULL, (void*)factoriales, (void*)&numero2);  
    //Almacenamos el resultado del array en r1 y r2 
    pthread_join(thread(0),(void*)&r1);
    pthread_join(thread(1),(void*)&r2);

    //Imprimimos r1,r2 por pantalla
    printf("EL resultado factorial del número %d es %d n", numero,r1);
    printf("EL resultado factorial del número %d es %d n", numero2,r2);
}

7 – D7 – PDO Database Connection Error?

Super strange, my site was up and working fine yesterday. Today, I navigate to my home page and I’m thrown this series of errors:

>     Warning: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in
> DatabaseConnection->__construct() (line 321 of
> /var/www/html/includes/database/database.inc).
>     Warning: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in
> DatabaseConnection->__construct() (line 321 of
> /var/www/html/includes/database/database.inc).
>     Warning: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in
> DatabaseConnection->__construct() (line 321 of
> /var/www/html/includes/database/database.inc).
>     Warning: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in
> DatabaseConnection->__construct() (line 321 of
> /var/www/html/includes/database/database.inc).
>     PDOException: SQLSTATE(HY000) (2002) php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in
> lock_may_be_available() (line 167 of /var/www/html/includes/lock.inc).
>     Warning: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in
> DatabaseConnection->__construct() (line 321 of
> /var/www/html/includes/database/database.inc).

To the best of my knowledge, this only occurs when the database connection settings are incorrect in the settings.php file, but all of mine are correct (and have been for quite some time). Any idea why this would suddenly change and throw this error? I’m stumped.

sharepoint server – Exception in String type error on SPFX with JQuery

I really need help to resolve Type error encountered on this function in SPFX with JQuery. Here is the function: The return statement is failing:

var addFile = function (fileTitle, fileName, fileType, team) {
var requestUri = "../_api/web/lists/getByTitle('SPFxFiles')/items";
var requestHeaders = {
    "accept": "application/json;odata=verbose",
    "content-type": "application/json;odata=verbose",
    "X-RequestDigest": $('#__REQUESTDIGEST').val()
}
var fileData = {
    __metadata: { "type": "SP.Data.SPFxFilesListItem" },
    Title: fileTitle,
    SPFxFileName: fileName,
    SPFxFileType: fileType,
    SPFxTeam: team
};
var requestBody = JSON.stringify(fileData);
return $.ajax({
    url: requestUri,
    type: "POST",
    headers: requestHeaders,
    data: requestBody
});

{
“resource”: “…/src/webparts/orderForm/OrderFormWebPart.ts”,
“owner”: “typescript”,
“code”: “2769”,
“severity”: 8,
“message”: “No overload matches this call.n Overload 1 of 2, ‘(url: string, settings?: AjaxSettings): jqXHR’, gave the following error.n Argument of type ‘{ url: string; type: string; contentType: string; headers: { accept: string; “X-HTTP-Method”: string; “X-RequestDigest”: string | number | string(); “If-Match”: string | number | string(); }; data: string; }’ is not assignable to parameter of type ‘string’.n Overload 2 of 2, ‘(settings?: AjaxSettings): jqXHR’, gave the following error.n Type ‘{ accept: string; “X-HTTP-Method”: string; “X-RequestDigest”: string | number | string(); “If-Match”: string | number | string(); }’ is not assignable to type ‘PlainObject’.n Property ‘”X-RequestDigest”‘ is incompatible with index signature.n Type ‘string | number | string()’ is not assignable to type ‘string’.n Type ‘number’ is not assignable to type ‘string’.”,
“source”: “ts”,
“startLineNumber”: 317,
“startColumn”: 8,
“endLineNumber”: 323,
“endColumn”: 3,
“relatedInformation”: (
{
“startLineNumber”: 165,
“startColumn”: 13,
“endLineNumber”: 165,
“endColumn”: 20,
“message”: “The expected type comes from property ‘headers’ which is declared here on type ‘AjaxSettings'”,
“resource”: “…/node_modules/@types/jquery/misc.d.ts”
}
)
}

wp query – ElasticPress post type order error

I’ve built a custom search in WordPress using WP_Query that queries through two post types. The post types are almost identical but one parameter requires them to be two different post types. The query lists all listings displaying post_type_1 before post_type_2. The second sorting parameter is a length meta_key that lists the posts in order of length. Using just WordPress the search works but is incredibly slow, so elasticpress/elastic search was installed. Elastic search requires returning a numerical value in to sort the order.

$args = array(
    'ep_integrate'   => true,
    'post_type' => array('post_type_1', 'post_type_2'),
    'posts_per_page'=>'12',
    'paged' => $paged,
    'tax_query' => (
        (
           'taxonomy' => 'post_status',
           'terms' => 'term_1',
           'field' => 'slug',
           'include_children' => true,
           'operator' => 'IN',
         ),
     ),
     'meta_key' => 'length_range',
     'orderby' => (
         'type' => 'post_type',  //This is not a numerical value, elastic search returns 400 error
         'meta_value_num' => 'DESC',
     ),
     'relation' => 'AND',
     'meta_query' => $meta_query, // Checks if the search fields are used and includes them if so.
);

If I remove 'type' => 'post_type', elastic search no longer errors, but the search only returns one post type. There does not seem to be a numerical ID attached to post types, only posts. Using elastic search, how could I return two post types with post_type_1 displaying before post_type_2?

Adb Connection error não sei pq

unable to connect to 127.0.0.1:51200: cannot connect to 127.0.0.1:51200: Nenhuma conexão pôde ser feita porque a máquina de destino as recusou ativamente. (10061)
está acontecendo esse erro enquanto tento connectar meu adb ao meu emulador LD PLAYER.inserir a descrição da imagem aqui