extiverse / bazaar

The extension marketplace for your Flarum forum.
https://discuss.flarum.org/d/5151
MIT License
59 stars 14 forks source link

'The json file must be an object ({})' #96

Open keneohiaeri opened 6 years ago

keneohiaeri commented 6 years ago

Steps to reproduce

  1. Installed Bazaar locally
  2. Uploaded "vendor" to shared hosting server
  3. Tried installing an extension through Bazaar

Expected behaviour

The extension, "Share Facebook" should install sucessfully

Actual behaviour

I get a "500 Internal Server Error" with an output "'The json file must be an object ({})'"

Configuration

Operating system:Microsoft-IIS/8.5

Version of Bazaar: 0.2.4 Version of Flarum: 0.1.0 -beta7 Other extensions: Flarum default extensions

**Logs**: ``` #32 {main} [2017-10-25 12:35:49] production.ERROR: The json file must be an object ({}) [2017-10-25 12:36:28] production.DEBUG: exception 'Flarum\Http\Exception\RouteNotFoundException' in H:\root\home\eugy45-001\www\mcc\vendor\flarum\core\src\Http\Middleware\DispatchRoute.php:62 Stack trace: #0 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Dispatch.php(212): Flarum\Http\Middleware\DispatchRoute->__invoke(Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), Object(Zend\Stratigility\Next)) #1 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Dispatch.php(88): Zend\Stratigility\Dispatch->dispatchCallableMiddleware(Object(Flarum\Http\Middleware\DispatchRoute), Object(Zend\Stratigility\Next), Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), NULL) #2 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Next.php(160): Zend\Stratigility\Dispatch->__invoke(Object(Zend\Stratigility\Route), NULL, Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), Object(Zend\Stratigility\Next)) #3 H:\root\home\eugy45-001\www\mcc\vendor\flarum\core\src\Http\Middleware\SetLocale.php(51): Zend\Stratigility\Next->__invoke(Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response)) #4 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Dispatch.php(212): Flarum\Http\Middleware\SetLocale->__invoke(Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), Object(Zend\Stratigility\Next)) #5 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Dispatch.php(88): Zend\Stratigility\Dispatch->dispatchCallableMiddleware(Object(Flarum\Http\Middleware\SetLocale), Object(Zend\Stratigility\Next), Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), NULL) #6 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Next.php(160): Zend\Stratigility\Dispatch->__invoke(Object(Zend\Stratigility\Route), NULL, Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), Object(Zend\Stratigility\Next)) #7 H:\root\home\eugy45-001\www\mcc\vendor\flarum\core\src\Http\Middleware\AuthenticateWithSession.php(36): Zend\Stratigility\Next->__invoke(Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response)) #8 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Dispatch.php(212): Flarum\Http\Middleware\AuthenticateWithSession->__invoke(Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), Object(Zend\Stratigility\Next)) #9 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Dispatch.php(88): Zend\Stratigility\Dispatch->dispatchCallableMiddleware(Object(Flarum\Http\Middleware\AuthenticateWithSession), Object(Zend\Stratigility\Next), Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), NULL) #10 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Next.php(160): Zend\Stratigility\Dispatch->__invoke(Object(Zend\Stratigility\Route), NULL, Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), Object(Zend\Stratigility\Next)) #11 H:\root\home\eugy45-001\www\mcc\vendor\flarum\core\src\Http\Middleware\RememberFromCookie.php(39): Zend\Stratigility\Next->__invoke(Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response)) #12 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Dispatch.php(212): Flarum\Http\Middleware\RememberFromCookie->__invoke(Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), Object(Zend\Stratigility\Next)) #13 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Dispatch.php(88): Zend\Stratigility\Dispatch->dispatchCallableMiddleware(Object(Flarum\Http\Middleware\RememberFromCookie), Object(Zend\Stratigility\Next), Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), NULL) #14 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Next.php(160): Zend\Stratigility\Dispatch->__invoke(Object(Zend\Stratigility\Route), NULL, Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), Object(Zend\Stratigility\Next)) #15 H:\root\home\eugy45-001\www\mcc\vendor\flarum\core\src\Http\Middleware\StartSession.php(48): Zend\Stratigility\Next->__invoke(Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response)) #16 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Dispatch.php(212): Flarum\Http\Middleware\StartSession->__invoke(Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), Object(Zend\Stratigility\Next)) #17 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Dispatch.php(88): Zend\Stratigility\Dispatch->dispatchCallableMiddleware(Object(Flarum\Http\Middleware\StartSession), Object(Zend\Stratigility\Next), Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), NULL) #18 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Next.php(160): Zend\Stratigility\Dispatch->__invoke(Object(Zend\Stratigility\Route), NULL, Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), Object(Zend\Stratigility\Next)) #19 H:\root\home\eugy45-001\www\mcc\vendor\flarum\core\src\Http\Middleware\ParseJsonBody.php(31): Zend\Stratigility\Next->__invoke(Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response)) #20 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Dispatch.php(212): Flarum\Http\Middleware\ParseJsonBody->__invoke(Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), Object(Zend\Stratigility\Next)) #21 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Dispatch.php(88): Zend\Stratigility\Dispatch->dispatchCallableMiddleware(Object(Flarum\Http\Middleware\ParseJsonBody), Object(Zend\Stratigility\Next), Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), NULL) #22 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Next.php(160): Zend\Stratigility\Dispatch->__invoke(Object(Zend\Stratigility\Route), NULL, Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), Object(Zend\Stratigility\Next)) #23 H:\root\home\eugy45-001\www\mcc\vendor\flarum\core\src\Http\Middleware\HandleErrors.php(61): Zend\Stratigility\Next->__invoke(Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response)) #24 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Dispatch.php(212): Flarum\Http\Middleware\HandleErrors->__invoke(Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), Object(Zend\Stratigility\Next)) #25 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Dispatch.php(88): Zend\Stratigility\Dispatch->dispatchCallableMiddleware(Object(Flarum\Http\Middleware\HandleErrors), Object(Zend\Stratigility\Next), Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), NULL) #26 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\Next.php(160): Zend\Stratigility\Dispatch->__invoke(Object(Zend\Stratigility\Route), NULL, Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response), Object(Zend\Stratigility\Next)) #27 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-stratigility\src\MiddlewarePipe.php(111): Zend\Stratigility\Next->__invoke(Object(Zend\Stratigility\Http\Request), Object(Zend\Stratigility\Http\Response)) #28 H:\root\home\eugy45-001\www\mcc\vendor\flarum\core\src\Http\AbstractServer.php(55): Zend\Stratigility\MiddlewarePipe->__invoke(Object(Zend\Diactoros\ServerRequest), Object(Zend\Diactoros\Response), Object(Zend\Stratigility\NoopFinalHandler)) #29 H:\root\home\eugy45-001\www\mcc\vendor\zendframework\zend-diactoros\src\Server.php(157): Flarum\Http\AbstractServer->__invoke(Object(Zend\Diactoros\ServerRequest), Object(Zend\Diactoros\Response), Object(Zend\Stratigility\NoopFinalHandler)) #30 H:\root\home\eugy45-001\www\mcc\vendor\flarum\core\src\Http\AbstractServer.php(36): Zend\Diactoros\Server->listen(Object(Zend\Stratigility\NoopFinalHandler)) #31 H:\root\home\eugy45-001\www\mcc\index.php(16): Flarum\Http\AbstractServer->listen() #32 {main} [2017-10-25 12:37:15] production.ERROR: The json file must be an object ({}) ```
luceos commented 6 years ago

What php version do you have on the shared environment?

keneohiaeri commented 6 years ago
PHP 5.6.x
keneohiaeri commented 6 years ago

I activated config settings to true, and clicked the DEBUG link, below is the full error:

**Error**: { "errors": [ { "code": 500, "title": "Internal server error", "detail": "InvalidArgumentException: The json file must be an object ({}) in H:\\root\\home\\0-001\\www\\mcc\\vendor\\flagrow\\bazaar\\src\\Composer\\Utils\\JsonManipulator.php:68\nStack trace:\n#0 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flagrow\\bazaar\\src\\Composer\\Utils\\ComposerFileEditor.php(37): Flagrow\\Bazaar\\Composer\\Utils\\JsonManipulator->__construct('\\xEF\\xBB\\xBF{\\r\\n \"name...')\n#1 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flagrow\\bazaar\\src\\Composer\\Commands\\BaseCommand.php(61): Flagrow\\Bazaar\\Composer\\Utils\\ComposerFileEditor->__construct('H:\\\\root\\\\home\\\\eu...')\n#2 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flagrow\\bazaar\\src\\Composer\\Commands\\RequireCommand.php(14): Flagrow\\Bazaar\\Composer\\Commands\\BaseCommand->getFileEditor()\n#3 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flagrow\\bazaar\\src\\Composer\\Commands\\BaseCommand.php(99): Flagrow\\Bazaar\\Composer\\Commands\\RequireCommand->handle(Array)\n#4 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flagrow\\bazaar\\src\\Composer\\ComposerCommand.php(31): Flagrow\\Bazaar\\Composer\\Commands\\BaseCommand->run(Array)\n#5 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flagrow\\bazaar\\src\\Jobs\\RequirePackage.php(15): Flagrow\\Bazaar\\Composer\\ComposerCommand->requires('flagrow/byobu')\n#6 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flagrow\\bazaar\\src\\Jobs\\ComposerJob.php(62): Flagrow\\Bazaar\\Jobs\\RequirePackage->handleComposer(Object(Flagrow\\Bazaar\\Composer\\ComposerCommand), Object(Flagrow\\Bazaar\\Models\\Task))\n#7 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flagrow\\bazaar\\src\\Jobs\\ComposerJob.php(100): Flagrow\\Bazaar\\Jobs\\ComposerJob->handle(Object(Flagrow\\Bazaar\\Composer\\ComposerEnvironment), Object(Monolog\\Logger))\n#8 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flagrow\\bazaar\\src\\Extensions\\PackageManager.php(51): Flagrow\\Bazaar\\Jobs\\ComposerJob::launchJob(Object(Flagrow\\Bazaar\\Models\\Task))\n#9 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flagrow\\bazaar\\src\\Repositories\\ExtensionRepository.php(202): Flagrow\\Bazaar\\Extensions\\PackageManager->requirePackage('flagrow/byobu')\n#10 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flagrow\\bazaar\\src\\Api\\Controllers\\InstallExtensionController.php(49): Flagrow\\Bazaar\\Repositories\\ExtensionRepository->installExtension('flagrow/byobu')\n#11 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flarum\\core\\src\\Api\\Controller\\AbstractSerializeController.php(97): Flagrow\\Bazaar\\Api\\Controllers\\InstallExtensionController->data(Object(Zend\\Stratigility\\Http\\Request), Object(Tobscure\\JsonApi\\Document))\n#12 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flarum\\core\\src\\Api\\Controller\\AbstractCreateController.php(23): Flarum\\Api\\Controller\\AbstractSerializeController->handle(Object(Zend\\Stratigility\\Http\\Request))\n#13 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flarum\\core\\src\\Http\\Handler\\ControllerRouteHandler.php(53): Flarum\\Api\\Controller\\AbstractCreateController->handle(Object(Zend\\Stratigility\\Http\\Request))\n#14 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flarum\\core\\src\\Http\\Middleware\\DispatchRoute.php(69): Flarum\\Http\\Handler\\ControllerRouteHandler->__invoke(Object(Zend\\Stratigility\\Http\\Request), Array)\n#15 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(212): Flarum\\Http\\Middleware\\DispatchRoute->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#16 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Http\\Middleware\\DispatchRoute), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#17 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#18 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flarum\\core\\src\\Http\\Middleware\\SetLocale.php(51): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#19 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(212): Flarum\\Http\\Middleware\\SetLocale->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#20 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Http\\Middleware\\SetLocale), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#21 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#22 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flarum\\core\\src\\Http\\Middleware\\AuthenticateWithHeader.php(58): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#23 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(212): Flarum\\Http\\Middleware\\AuthenticateWithHeader->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#24 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Http\\Middleware\\AuthenticateWithHeader), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#25 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#26 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flarum\\core\\src\\Http\\Middleware\\AuthenticateWithSession.php(36): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#27 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(212): Flarum\\Http\\Middleware\\AuthenticateWithSession->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#28 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Http\\Middleware\\AuthenticateWithSession), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#29 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#30 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flarum\\core\\src\\Http\\Middleware\\RememberFromCookie.php(39): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#31 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(212): Flarum\\Http\\Middleware\\RememberFromCookie->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#32 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Http\\Middleware\\RememberFromCookie), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#33 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#34 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flarum\\core\\src\\Http\\Middleware\\StartSession.php(48): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#35 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(212): Flarum\\Http\\Middleware\\StartSession->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#36 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Http\\Middleware\\StartSession), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#37 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#38 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flarum\\core\\src\\Api\\Middleware\\FakeHttpMethods.php(33): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#39 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(212): Flarum\\Api\\Middleware\\FakeHttpMethods->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#40 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Api\\Middleware\\FakeHttpMethods), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#41 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#42 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flarum\\core\\src\\Http\\Middleware\\ParseJsonBody.php(31): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#43 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(212): Flarum\\Http\\Middleware\\ParseJsonBody->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#44 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Http\\Middleware\\ParseJsonBody), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#45 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#46 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flarum\\core\\src\\Api\\Middleware\\HandleErrors.php(45): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#47 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(212): Flarum\\Api\\Middleware\\HandleErrors->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#48 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Api\\Middleware\\HandleErrors), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#49 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#50 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-stratigility\\src\\MiddlewarePipe.php(111): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#51 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flarum\\core\\src\\Http\\AbstractServer.php(55): Zend\\Stratigility\\MiddlewarePipe->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\NoopFinalHandler))\n#52 H:\\root\\home\\0-001\\www\\mcc\\vendor\\zendframework\\zend-diactoros\\src\\Server.php(157): Flarum\\Http\\AbstractServer->__invoke(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Diactoros\\Response), Object(Zend\\Stratigility\\NoopFinalHandler))\n#53 H:\\root\\home\\0-001\\www\\mcc\\vendor\\flarum\\core\\src\\Http\\AbstractServer.php(36): Zend\\Diactoros\\Server->listen(Object(Zend\\Stratigility\\NoopFinalHandler))\n#54 H:\\root\\home\\0-001\\www\\mcc\\api.php(16): Flarum\\Http\\AbstractServer->listen()\n#55 {main}" } ] }
clarkwinkelmann commented 6 years ago

@keneohiaeri Could you share the content of your composer.json file ? It looks like it's not using the expected JSON format

keneohiaeri commented 6 years ago
{
    "name": "flarum/flarum",
    "description": "Delightfully simple forum software.",
    "type": "project",
    "keywords": ["forum", "discussion"],
    "homepage": "http://flarum.org",
    "license": "MIT",
    "authors": [
        {
            "name": "Toby Zerner",
            "email": "toby.zerner@gmail.com"
        },
        {
            "name": "Franz Liedke",
            "email": "franz@develophp.org"
        }
    ],
    "support": {
        "issues": "https://github.com/flarum/core/issues",
        "source": "https://github.com/flarum/flarum",
        "docs": "http://flarum.org/docs"
    },
    "require": {
        "flarum/core": "^0.1.0",
        "flarum/flarum-ext-akismet": "^0.1.0",
        "flarum/flarum-ext-approval": "^0.1.0",
        "flarum/flarum-ext-auth-facebook": "^0.1.0",
        "flarum/flarum-ext-auth-github": "^0.1.0",
        "flarum/flarum-ext-auth-twitter": "^0.1.0",
        "flarum/flarum-ext-bbcode": "^0.1.0",
        "flarum/flarum-ext-emoji": "^0.1.0",
        "flarum/flarum-ext-english": "^0.1.0",
        "flarum/flarum-ext-flags": "^0.1.0",
        "flarum/flarum-ext-likes": "^0.1.0",
        "flarum/flarum-ext-lock": "^0.1.0",
        "flarum/flarum-ext-markdown": "^0.1.0",
        "flarum/flarum-ext-mentions": "^0.1.0",
        "flarum/flarum-ext-pusher": "^0.1.0",
        "flarum/flarum-ext-sticky": "^0.1.0",
        "flarum/flarum-ext-subscriptions": "^0.1.0",
        "flarum/flarum-ext-suspend": "^0.1.0",
        "flarum/flarum-ext-tags": "^0.1.0",
        "flagrow/bazaar": "^0.2.0"
    },
    "require-dev": {
        "franzl/studio": "^0.11.0"
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "beta",
    "prefer-stable": true
}
keneohiaeri commented 6 years ago

I found another composer.json file within the vendor folder:

{
    "name": "composer/composer",
    "description": "Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.",
    "keywords": ["package", "dependency", "autoload"],
    "homepage": "https://getcomposer.org/",
    "type": "library",
    "license": "MIT",
    "authors": [
        {
            "name": "Nils Adermann",
            "email": "naderman@naderman.de",
            "homepage": "http://www.naderman.de"
        },
        {
            "name": "Jordi Boggiano",
            "email": "j.boggiano@seld.be",
            "homepage": "http://seld.be"
        }
    ],
    "support": {
        "irc": "irc://irc.freenode.org/composer",
        "issues": "https://github.com/composer/composer/issues"
    },
    "require": {
        "php": "^5.3.2 || ^7.0",
        "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0",
        "composer/ca-bundle": "^1.0",
        "composer/semver": "^1.0",
        "composer/spdx-licenses": "^1.0",
        "seld/jsonlint": "^1.4",
        "symfony/console": "^2.7 || ^3.0",
        "symfony/finder": "^2.7 || ^3.0",
        "symfony/process": "^2.7 || ^3.0",
        "symfony/filesystem": "^2.7 || ^3.0",
        "seld/phar-utils": "^1.0",
        "seld/cli-prompt": "^1.0",
        "psr/log": "^1.0"
    },
    "require-dev": {
        "phpunit/phpunit": "^4.5 || ^5.0.5",
        "phpunit/phpunit-mock-objects": "^2.3 || ^3.0"
    },
    "config": {
        "platform": {
            "php": "5.3.9"
        }
    },
    "suggest": {
        "ext-zip": "Enabling the zip extension allows you to unzip archives",
        "ext-zlib": "Allow gzip compression of HTTP requests",
        "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages"
    },
    "autoload": {
        "psr-4": { "Composer\\": "src/Composer" }
    },
    "autoload-dev": {
        "psr-4": { "Composer\\Test\\": "tests/Composer/Test" }
    },
    "bin": ["bin/composer"],
    "extra": {
        "branch-alias": {
            "dev-master": "1.5-dev"
        }
    },
    "scripts": {
        "test": "phpunit"
    }
}
clarkwinkelmann commented 6 years ago

Thanks. The first one was the one I was thinking of.

But I can't see anything wrong that would trigger this error... Maybe @luceos will have other leads

clarkwinkelmann commented 6 years ago

Hint: you can use three backticks (```) before and after your code to keep its format (I reformatted your post above already for readability)

keneohiaeri commented 6 years ago

Oh ok. I've done the same to the second code block Thank you

luceos commented 6 years ago

Honestly I have no clue @clarkwinkelmann because the error in the log has no trace. This, by itself, is very, very odd already.

@keneohiaeri can you copy the output of ls -la in the flarum installation path and tell us under which user Flarum is running?

keneohiaeri commented 6 years ago

Please how do I get the "ls-la" output?

clarkwinkelmann commented 6 years ago

Wooops sorry forgot to follow up with this issue. Are you still experiencing it @keneohiaeri ?

The ls -la command is supposed to be run inside a shell (SSH) on Linux and will show folders and the related permissions.

However I just noticed you're running a Windows/IIS server, so this command is irrelevant I guess. @luceos could this be because we use some hardcoded Linux path separators and we're trying to read a non-existend or non-json file ?

luceos commented 6 years ago

That might well be the case, we'd have to check that.