Fehler nach Update des Contao Managers auf 1.3.3 - Error 200 - unerwarteter API-Statu
Guten Morgen,
ich wollte eben eine Contao Installation auf 4.9.8 updaten (und eigentlich noch eine Extension installieren), auf der der Contao Manager in der Version 1.3.0 lief.
installierte Contao-Version: 4.9.7
PHP: 7.4.10
Nach dem Self-Update des CM erhalte ich die Fehlermeldung "Error 200 - Unerwarteter API-Status", gefolgt von einem längeren Codeblock. Jetzt kann ich den Contao Manager nicht mehr aufrufen, die Fehlermeldung liegt als Overlay darüber.
Der Codeblock:
Code:
) Contao Association
*
* @license LGPL-3.0-or-later
*/
namespace Contao\ManagerApi\HttpKernel;
use Contao\ManagerApi\Exception\ApiProblemException;
use Crell\ApiProblem\ApiProblem;
use Crell\ApiProblem\JsonException;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
class ApiProblemResponse extends Response
{
/**
* Constructor.
*/
public function __construct(ApiProblem $problem, array $headers = [])
{
if (!$problem->getStatus()) {
$problem->setStatus(500);
}
if (!$problem->getTitle()) {
$code = $problem->getStatus();
$problem->setTitle(isset(Response::$statusTexts[$code]) ? Response::$statusTexts[$code] : 'unknown status');
}
try {
$content = $problem->asJson();
} catch (JsonException $exception) {
$problem = new ApiProblem($exception->getMessage());
$content = $problem->asJson();
}
parent::__construct(
$content,
$problem->getStatus(),
array_merge($headers, ['Content-Type' => 'application/problem+json'])
);
}
/**
* Creates a ApiProblemResponse from exception.
*/
public static function createFromException(\Throwable $exception, bool $debug = false): self
{
$headers = [];
if ($exception instanceof ApiProblemException) {
$problem = $exception->getApiProblem();
} else {
$problem = new ApiProblem($exception->getMessage());
if ($exception instanceof HttpExceptionInterface) {
$problem->setStatus($exception->getStatusCode());
}
if ($debug) {
$problem['debug'] = $exception->getTraceAsString();
}
}
if ($exception instanceof HttpExceptionInterface) {
$headers = $exception->getHeaders();
}
return new static($problem, $headers);
}
}
ate static $checkedClasses = [];
private static $final = [];
private static $finalMethods = [];
private static $deprecated = [];
private static $internal = [];
private static $internalMethods = [];
private static $annotatedParameters = [];
private static $darwinCache = ['/' => ['/', []]];
private static $method = [];
private static $returnTypes = [];
private static $methodTraits = [];
private static $fileOffsets = [];
public function __construct(callable $classLoader)
{
$this->classLoader = $classLoader;
$this->isFinder = \is_array($classLoader) && method_exists($classLoader[0], 'findFile');
parse_str(getenv('SYMFONY_PATCH_TYPE_DECLARATIONS') ?: '', $this->patchTypes);
$this->patchTypes += [
'force' => null,
'php' => null,
'deprecations' => false,
];
if (!isset(self::$caseCheck)) {
$file = file_exists(__FILE__) ? __FILE__ : rtrim(realpath('.'), \DIRECTORY_SEPARATOR);
$i = strrpos($file, \DIRECTORY_SEPARATOR);
$dir = substr($file, 0, 1 + $i);
$file = substr($file, 1 + $i);
$test = strtoupper($file) === $file ? strtolower($file) : strtoupper($file);
$test = realpath($dir.$test);
if (false === $test || false === $i) {
// filesystem is case sensitive
self::$caseCheck = 0;
} elseif (substr($test, -\strlen($file)) === $file) {
// filesystem is case insensitive and realpath() normalizes the case of characters
self::$caseCheck = 1;
} elseif (false !== stripos(\PHP_OS, 'darwin')) {
// on MacOSX, HFS+ is case insensitive but realpath() doesn't normalize the case of characters
self::$caseCheck = 2;
} else {
// filesystem case checks failed, fallback to disabling them
self::$caseCheck = 0;
}
}
}
/**
* Gets the wrapped class loader.
*
* @return callable The wrapped class loader
*/
public function getClassLoader(): callable
{
return $this->classLoader;
}
/**
* Wraps all autoloaders.
*/
public static function enable(): void
{
// Ensures we don't hit https://bugs.php.net/42098
class_exists('Symfony\Component\ErrorHandler\ErrorHandler');
class_exists('Psr\Log\LogLevel');
if (!\is_array($functions = spl_autoload_functions())) {
return;
}
foreach ($functions as $function) {
spl_autoload_unregister($function);
}
foreach ($functions as $function) {
if (!\is_array($function) || !$function[0] instanceof self) {
Was muss ich machen, um den CM wieder nutzen zu können?
Danke und Gruß
Mathias
Liste der Anhänge anzeigen (Anzahl: 1)
Zitat:
Zitat von
Kahru
Update falls der nächste stolpert: Ich habe in der composer.json alle nicht Contao-Extensions bei require rausgeworfen. Damit ging der Composer dann ohne Fehlermeldungen auf. Dann in die composer.json die Extensions wieder rein kopiert. Neu abgemeldet, neu angemeldet, der Composer geht weiterhin ohne Probleme auf. Update auf die 4.9.8 durchgeführt. Nochmals abgemeldet und angemeldet: Der Composer geht auf ... ein Gehakel ... aber Hauptsache es geht jetzt ;)
Habe heute dasselbe Problem nach versuchtem automatischem Update des Contao-Managers von 1.3.3 auf 1.4.0. Hier läuft PHP 7.4.13 und Contao 4.9.9 bei Webhostone. Auch der Hinweis von lucina mit Änderung auf PHP 7.3 auf dem Webserver brachte keinen Erfolg. Nach wie vor der geschilderte API-Fehler.
Anhang 24320
Was könnte man sonst noch probieren?