Migx custom packages : connector.php 500 (Internal Server Error)

Hi there,

Trying to update fields of a custom migx packages, i keep having ‘assets/components/migx/connector.php 500 (Internal Server Error)’ …

(got some errors previously due to WAF configuration, but here, just the 500 error)

Parse schema, Load schema and create tables return success
but when it comes to Add fields, Remove fields, Update indexes ok Alter fields, i get the 500 error and nothing more

I’m on Modx 3.0.4-pl and Migx 3.0.2-beta1.

Any ideas ?

Thanks

Can you provide the exact error message of this 500 error?

Also, what’s your schema? Does it use version 3.0 to work with MODX 3?

Does it use version 3.0 to work with MODX 3?

What do you mean by that? xml version?

Here’s the xml schema :

<?xml version="1.0" encoding="UTF-8"?>
<model package="commerces" baseClass="xPDOObject" platform="mysql" defaultEngine="InnoDB" version="1.1">
<object class="Commerce" table="commerces" extends="xPDOSimpleObject">
<field key="id_commerce"  dbtype="int"  phptype="integer" null="false" default="" />
 <field key="nom_commerce" dbtype="varchar" precision="250" phptype="string" null="false" default="" />

 <field key="cat_commerce" dbtype="varchar" precision="250" phptype="string" null="false" default="" />
<field key="infos_commerce" dbtype="text" phptype="string" null="false" />

<field key="deleted" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="published" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="1" />
 	</object>
</model>

What do you need from the 500 error ?

The version of the schema is defined in the <model> tag.
Version 1.1 is for MODX 2.x. For MODX 3 you have to use version 3.0, so that the schema can be parsed correctly.

Maybe take a look at this video for more information:

If you’re using the old schema (version=“1.1”) in MODX 3 and you have to alter the schema, it might be easier to do the changes on a MODX 2.x installation and then copy the files, instead of changing everything to version 3.0.


500 errors are usually logged in the server/PHP error log. The exact error message can help to determine what exactly is breaking the code execution.

Thank, i’ll try the Xml version 3, and i’ll definitely watch the video.

Meanwhile here’s the logs :

#### Info requête
**Date :** 26/06/2024, 16:29 GMT+2
**Méthode HTTP :** POST
**IP Client :** MY IP
**Port :** 2443
**Protocole :** HTTP/1.1
**Uri :** /assets/components/migx/connector.php
**Status de la réponse :** 500
#### Géolocalisation
**Continent :** EU
**Région :** Paris
**Pays :** France
**Ville :** Paris
**Code postal :** 75011
#### En-têtes HTTP
**X-Forwarded-Host:** mywebsite.fr
**X-Forwarded-Proto:** https
**accept:** */*
**accept-encoding:** gzip
**accept-language:** fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7
**content-length:** 184
**content-type:** application/x-www-form-urlencoded; charset=UTF-8
**cookie:** Cookie,sessions, bla bla bla
**host:** mywebsite.fr
**modauth:** modxXXXXXXXec4.83021781 <<<< i don't know if it's sensitive information but i'm sure it's not relevant
**origin:** https://mywebsite.fr
**powered-by:** MODx
**priority:** u=1, i
**referer:** https://mywebsite.fr/manager/?a=index&namespace=migx&configs=migxconfigs||packagemanager
**sec-ch-ua:** "Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"
**sec-ch-ua-mobile:** ?0
**sec-ch-ua-platform:** "macOS"
**sec-fetch-dest:** empty
**sec-fetch-mode:** cors
**sec-fetch-site:** same-origin
**user-agent:** Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
**x-requested-with:** XMLHttpRequest

I also tried to start from scratch and create a new package (so no need to alter fields)
i took the same schema changing only class name, package name and table name, and add the field i needed… but errors are the same

(by the way, thank you very much for the time you’re spending helping me)

Unfortunately all this information is not really what is needed.
Isn’t there an actual PHP error message (like for example Fatal error: Uncaught Error: Call to a member function doSomething() on null) in the log with a stack trace (and the information in what file on what line the error occurred)? Maybe it’s written to a different log file?