contentacms / contenta_jsonapi

Contenta CMS, the decoupled Drupal
http://www.contentacms.org/
GNU General Public License v2.0
329 stars 103 forks source link

Can't install via Composer #309

Closed skikirkwood closed 6 years ago

skikirkwood commented 6 years ago

Hi there, trying to install Contenta via Composer per the doc and getting the error "Your requirements could not be resolved to an installable set of packages."

` macbookpro-jimambras:airbnb jim.ambras$ composer create-project contentacms/contenta-jsonapi-project contenta --stability dev --no-interaction Installing contentacms/contenta-jsonapi-project (dev-8.x-1.x 61116e425e5a469035176418776b1b746d461dcc)

`

swr82 commented 6 years ago

I can't install Contenta via composer either, different error:

`In ContainerBuilder.php line 1022:

You have requested a non-existent service "language_negotiator".

quick-start [--langcode [LANGCODE]] [--site-name [SITE-NAME]] [--host [HOST]] [--port [PORT]] [-s|--suppress-login] [--] []

ERROR The Drupal installer failed to install Contenta CMS.`

e0ipso commented 6 years ago

@swr82 we are trying to figure out that issue. In the mean time, you can use the UI installer (https://yourinstall/core/install.php) to solve that.

e0ipso commented 6 years ago

@skikirkwood did you try clearing composer caches with composer clear-cache?

swr82 commented 6 years ago

@e0ipso Tried UI installer. It almost worked:

The website encountered an unexpected error. Please try again later. Error: Class 'Yaml' not found in _contenta_jsonapi_enable_cors() (line 141 of profiles/contrib/contenta_jsonapi/contenta_jsonapi.profile). _contenta_jsonapi_enable_cors(Array) (Line: 709) install_run_task(Array, Array) (Line: 584) install_run_tasks(Array, NULL) (Line: 125) install_drupal(Object) (Line: 44)

brandonratz commented 6 years ago

I receive the same error through UI and using Drupal console to install Contenta profile after a fresh project clone via composer.

Error: Class 'Yaml' not found in /app/web/profiles/contrib/contenta_jsonapi/contenta_jsonapi.profile on line 141 #0 /app/web/core/includes/install.core.inc(709): _contenta_jsonapi_enable_cors(Array)

e0ipso commented 6 years ago

@swr82 you are correct. I pushed a fix (https://github.com/contentacms/contenta_jsonapi/commit/a797fba6b40305f19e66ea5ea9ed7351daf47277) for that issue. Please re-try and let me know.

brandonratz commented 6 years ago

@e0ipso This small fix cleared up the Error for me. Installation completed successfully.

sharif-elshobkshy commented 6 years ago

Hi @e0ipso @swr82,

I'm also getting the "language_negotiator" issue while installing.


Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException:[error] You have requested a non-existent service "language_negotiator". in /app/vendor/symfony/dependency-injection/ContainerBuilder.php:1043 Stack trace:

0

/app/vendor/symfony/dependency-injection/ContainerBuilder.php(610): Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition('language_negoti...')

1

/app/vendor/symfony/dependency-injection/ContainerBuilder.php(588): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('language_negoti...', 1)

2 /app/docroot/core/lib/Drupal.php(158):

Symfony\Component\DependencyInjection\ContainerBuilder->get('language_negoti...')


I don't know yet why it's failing. It fails in the language module in

function language_modules_installed($modules)

$negotiator = \Drupal::service('language_negotiator');

It seems the service does not exist yet when called in the hook_modules_installed

e0ipso commented 6 years ago

@sharif-elshobkshy-globant please use the UI installer in the mean time as described in https://github.com/contentacms/contenta_jsonapi/issues/309#issuecomment-411064535.

Alternatively you can check https://github.com/contentacms/contenta_jsonapi/blob/8.x-2.x/scripts/development/build-contenta_jsonapi.sh#L65-L69 for a CLI workaround.

sharif-elshobkshy commented 6 years ago

Thanks @e0ipso

I can't use the UI because I have a make script that performs other actions after the install is complete.

I tried the workaround you mentioned and It does seem to work, but after the install is completed I tried to sync my own custom config folder and it fails for another language issue.

I could revert back to the older version of Contenta which was working fine (the install process), but unfortunately the older version of Contenta works with older versions of JSON API and OpenAPI, and the main reason why I'm updating Contenta is because I'm having issues with those older versions of JSON API and OpenAPI.

Openapi does not properly create the Rest and JSONAPI json files for Swagger.

e0ipso commented 6 years ago

@sharif-elshobkshy-globant I don't have an ETA on these issues. It would be amazing if you could provide a patch if you find a proper fix.

sharif-elshobkshy commented 6 years ago

@e0ipso sure thing.

I'll spend the day on this. See if I can find the issue.

e0ipso commented 6 years ago

Please follow the install instructions under http://contentacms.org/#install

swr82 commented 6 years ago

Hi @e0ipso,

Re-installed it today (vagrant) using: composer create-project contentacms/contenta-jsonapi-project --stability dev --no-interaction

Still same JSON RPC error :(

/jsonrpc

The website encountered an unexpected error. Please try again later. TypeError: Adaptor Shaper\Transformation\TransformationBase received invalid input data: [{"property":"","pointer":"","message":"NULL value found, but an array is required","constraint":"type","context":1},{"property":"","pointer":"","message":"NULL value found, but an object is required","constraint":"type","context":1},{"property":"","pointer":"","message":"Failed to match exactly one schema","constraint":"oneOf","context":1}] in Shaper\Transformation\TransformationBase->transform() (line 24 of /var/www/html/vendor/e0ipso/shaper/src/Transformation/TransformationTransformerTrait.php). Shaper\Transformation\TransformationBase->transform(NULL, Object) (Line: 114) Drupal\jsonrpc\Controller\HttpController->getRpcRequests(Object) (Line: 69) Drupal\jsonrpc\Controller\HttpController->resolve(Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 67) Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 57) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 51) Drupal\jsonapi\StackMiddleware\FormatSetter->handle(Object, 1, 1) (Line: 49) Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 665) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)