-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'The json file must be an object ({})' #96
Comments
What php version do you have on the shared environment? |
| PHP 5.6.x |
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}" } ] } |
@keneohiaeri Could you share the content of your |
|
I found another composer.json file within the vendor folder:
|
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 |
Hint: you can use three backticks (```) before and after your code to keep its format (I reformatted your post above already for readability) |
Oh ok. I've done the same to the second code block |
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 |
Please how do I get the "ls-la" output? |
Wooops sorry forgot to follow up with this issue. Are you still experiencing it @keneohiaeri ? The 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 ? |
That might well be the case, we'd have to check that. |
Steps to reproduce
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**:
The text was updated successfully, but these errors were encountered: