Apollo: Context creation failed - apollo

I switched to a mac machine recently and transferred my repository into my new computer. That was fine but now when I already authenticate using google then I try to use the auth token provided by getIdToken in each request. That worked fine on my old machine but on this new machine I get the following error:
Error: Context creation failed: ',
' at getUserToken (/Users/christosavovchristov/Desktop/d8n/d8n-core/API/src/index.ts:30:11)',
' at processTicksAndRejections (node:internal/process/task_queues:96:5)',
' at async ApolloServer.context (/Users/christosavovchristov/Desktop/d8n/d8n-core/API/src/index.ts:310:20)',
' at async ApolloServer.graphQLServerOptions (/Users/christosavovchristov/Desktop/d8n/d8n-core/API/node_modules/apollo-server-core/src/ApolloServer.ts:905:13)',
This points to this method:
try {
const decodedToken = await firebase_admin.auth().verifyIdToken(token, true);
return decodedToken.uid;
}
catch (ex) {
console.log(ex);
throw new Error();
}
I have confirmed that the token is successfully passed from the client.
dependencies": {
"#aws-sdk/client-s3": "^3.44.0",
"#aws-sdk/client-textract": "^3.43.0",
"#google-cloud/documentai": "^3.1.0",
"#google-cloud/vision": "^2.4.1",
"#graphql-tools/load": "^7.1.9",
"#graphql-tools/schema": "^8.0.1",
"#sendgrid/mail": "^7.4.5",
"apollo-datasource": "3.1.0",
"apollo-server-express": "3.3.0",
"archiver": "^5.3.0",
"aws-sdk": "^2.1046.0",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"dotenv": "^10.0.0",
"express": "^4.17.1",
"express-rate-limit": "^5.3.0",
"firebase": "^8.6.8",
"firebase-admin": "^9.10.0",
"firebase-functions": "^3.15.4",
"gm": "^1.23.1",
"graphql": "16.3.0",
"graphql-redis-subscriptions": "^2.4.0",
"graphql-scalars": "^1.10.1",
"graphql-subscriptions": "^1.2.1",
"graphql-upload": "13.0.0",
"i18n": "^0.13.3",
"i18next": "^20.6.1",
"i18next-fs-backend": "^1.1.1",
"line-reader": "^0.4.0",
"pdf2pic": "^2.1.4",
"pdfkit": "^0.9.0",
"request": "^2.88.2",
"request-promise": "^4.2.6",
"string-similarity": "^4.0.4",
"stripe": "^8.176.0",
"subscriptions-transport-ws": "0.11.0",
"textract": "^2.5.0",
"uuid": "^8.3.2"
},

Related

DataStore - Data won't be synchronized. No GraphQL endpoint configured. Did you forget `Amplify.configure(awsconfig)`?

Please help, i spent 2 days trying simply to use Datastore of amplify. Am building NPM package to wrap an Amplify project backend. Auth works good but datastore not.
Am testing code with ts-node and Jest. It is package so i do not have a framework.
When i call the save function it does not work and throw this warning:
[WARN] 24:08.886 DataStore - Data won't be synchronized. No GraphQL endpoint configured. Did you forget `Amplify.configure(awsconfig)`? {
config: {
authProviders: undefined,
maxRecordsToSync: 10000,
syncPageSize: 1000
}
}
My api endpoint is 100% correct, also the api-key. The backend works in another project built with react. But in my case (NPM package) it does not work.
The script am trying to run:
import { DataStore } from '#aws-amplify/datastore';
import { AccountDetails } from '#/models';
import { SignUp } from "#/Authentication/SignUp";
import InvalidAccountRequirementsException from "#/Exceptions/InvalidAccountRequirementsException";
import "#/app.config";
/**
* #name CreateAccount
* #description:
* build the correct pattern to check specific string type.
*
* #type function
* #param email
* #param password
* #param hasOwnCompany
* #param optInMarketingEmail
* #param tacAgreed
* #constructor
* #return {Promise<AccountDetails>}
*/
const CreateAccount = async (
email: string,
password: string,
hasOwnCompany: boolean,
optInMarketingEmail: boolean,
tacAgreed: boolean,
): Promise<AccountDetails> => {
if (!tacAgreed) {
throw new InvalidAccountRequirementsException('Terms and conditions mus be agreed');
}
const user = await SignUp(email, password);
return await DataStore.save(
new AccountDetails({
cognitoSubId: user.userSub,
email: email,
optInMarketingEmail: optInMarketingEmail,
tacAgreed: tacAgreed,
hasOwnCompany: hasOwnCompany,
})
);
}
export default CreateAccount;
app.conf.ts
import Amplify from 'aws-amplify';
import awsExports from '#/aws-exports';
Amplify.configure(awsExports);
package.json
{
"name": "#financiallease/driver-seat-amplify-api",
"version": "1.0.0",
"description": "",
"author": "itsupport#financiallease.nl",
"main": "dist/financiallease.cjs.js",
"module": "dist/financiallease.es.js",
"browser": "dist/financiallease.js",
"license": "ISC",
"scripts": {
"build": "rollup -c",
"lint": "eslint --config eslint.config.js '{src,test}/**/*.ts' --no-ignore",
"autoformat": "eslint --config eslint.config.js '{src,test}/**/*.ts' --no-ignore --fix",
"test": "jest -c jest.config.ts",
"coverage": "jest --collectCoverage --coverageDirectory=\"./coverage\" --ci --reporters=default --reporters=jest-junit --watchAll=false",
"docs:generate": "typedoc --readme README.md --entryPoints src --entryPointStrategy expand --out docs --theme hierarchy --name \"Driver Seat Amplify Api - docs\" --includeVersion",
"amplify-modelgen": "node amplify/scripts/amplify-modelgen.js",
"amplify-push": "node amplify/scripts/amplify-push.js"
},
"publishConfig": {
"#financiallease:registry": "https://gitlab.com/api/v4/projects/35071033/packages/npm/"
},
"dependencies": {
"#aws-amplify/core": "^4.5.1",
"#aws-amplify/datastore": "^3.11.0",
"#rollup/plugin-alias": "^3.1.9",
"aws-amplify": "^4.3.19",
"dotenv": "^16.0.0",
"ts-node": "^10.7.0",
"typescript": "^4.6.3"
},
"devDependencies": {
"#babel/core": "^7.17.9",
"#babel/preset-env": "^7.16.11",
"#babel/preset-typescript": "^7.16.7",
"#rollup/plugin-babel": "^5.3.1",
"#rollup/plugin-commonjs": "^21.0.3",
"#rollup/plugin-node-resolve": "^13.1.3",
"#rollup/plugin-typescript": "^8.3.1",
"#types/amplify": "^1.1.25",
"#types/jest": "^27.4.1",
"#types/node": "^17.0.30",
"#typescript-eslint/eslint-plugin": "^5.18.0",
"#typescript-eslint/parser": "^5.18.0",
"babel-jest": "^28.0.3",
"babel-plugin-module-resolver": "^4.1.0",
"eslint": "^8.12.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-react": "^7.29.4",
"esm": "^3.2.25",
"jest": "^27.5.1",
"jest-junit": "^13.2.0",
"jsdoc": "^3.6.10",
"nodemon": "^2.0.16",
"rollup": "^2.70.1",
"rollup-plugin-terser": "^7.0.2",
"ts-jest": "^27.1.4",
"tsconfig-paths": "^3.14.1",
"tslib": "^2.3.1",
"typedoc": "^0.22.15",
"typedoc-theme-hierarchy": "^1.1.1",
"ini": "^1.3.5",
"inquirer": "^6.5.1"
}
}
Any ideas?

AWS Greengrass v2 - Lambda function access to local resources

Hope you're all doing as good as possible during those covid times.
Overview
I have a lambda function that runs on a raspberry device with Greengrass version 1. This lambda access my USB port that has an XBee on it (/dev/ttyUSB0) and sends this data to an MQTT on IoT Core and it is working for some months. It functions this way: My GGC receives 5 packages every 5 minutes from a remote station that has some sensors and after unpacking this data, it sends it as a JSON through MQTT.
I'm currently trying to update my GGC_v1 to GGC_v2 and am facing a problem when deploying it. I'm not able to access the local resource on version two when running the same lambda function, even though the recipe has access for reading and writing on the device.
On GGC_V1 is uses the configuration below:
Make this function long-lived and keep it running indefinitely
Use group default (currently: Greengrass container)
Use group default (currently: ggc_user/ggc_group)
Also added access to resource /dev/ttyUSB0.
Problem Log:
2021-07-13T20:07:22.890Z [INFO] (pool-2-thread-58) com.weatherStation.XBee: Finding mounted cgroups.. {serviceInstance=0, serviceName=com.weatherStation.XBee, currentState=STARTING}
2021-07-13T20:07:22.909Z [INFO] (Copier) com.weatherStation.XBee: Startup script exited. {exitCode=1, serviceInstance=0, serviceName=com.weatherStation.XBee, currentState=STARTING}
2021-07-13T20:07:22.915Z [INFO] (pool-2-thread-53) com.weatherStation.XBee: shell-runner-start. {scriptName=services.com.weatherStation.XBee.lifecycle.shutdown.script, serviceInstance=0, serviceName=com.weatherStation.XBee, currentState=BROKEN, command=["/greengrass/v2/packages/artifacts/aws.greengrass.LambdaLauncher/2.0.7/lambda-l..."]}
2021-07-13T20:07:23.102Z [WARN] (Copier) com.weatherStation.XBee: stderr. 2021/07/13 17:07:23 could not read process state file /greengrass/v2/work/com.weatherStation.XBee/work/worker/0/state.json: open /greengrass/v2/work/com.weatherStation.XBee/work/worker/0/state.json: no such file or directory. {scriptName=services.com.weatherStation.XBee.lifecycle.shutdown.script, serviceInstance=0, serviceName=com.weatherStation.XBee, currentState=BROKEN}
2021-07-13T20:07:23.220Z [ERROR] (pool-2-thread-60) com.weatherStation.XBee: error while removing dir {"path": "/greengrass/v2/work/com.weatherStation.XBee/work/worker/0", "errorString": "unlinkat /greengrass/v2/work/com.weatherStation.XBee/work/worker/0/overlays: device or resource busy"}. {serviceInstance=0, serviceName=com.weatherStation.XBee, currentState=BROKEN}
Recipe:
"RecipeFormatVersion": "2020-01-25",
"ComponentName": "com.weatherStation.XBee",
"ComponentVersion": "5.0.2",
"ComponentType": "aws.greengrass.lambda",
"ComponentDescription": "",
"ComponentPublisher": "AWS Lambda",
"ComponentSource": "arn:aws:lambda:region:account_id:function:Greengrass_WeatherStation",
"ComponentConfiguration": {
"DefaultConfiguration": {
"lambdaExecutionParameters": {
"EnvironmentVariables": {}
},
"containerParams": {
"memorySize": 16000,
"mountROSysfs": false,
"volumes": {},
"devices": {
"0": {
"path": "/dev/ttyUSB0",
"permission": "rw",
"addGroupOwner": true
}
}
},
"containerMode": "GreengrassContainer",
"timeoutInSeconds": 15,
"maxInstancesCount": 100,
"inputPayloadEncodingType": "json",
"maxQueueSize": 1000,
"pinned": true,
"maxIdleTimeInSeconds": 60,
"statusTimeoutInSeconds": 60,
"pubsubTopics": {
"0": {
"topic": "ggc/weather_station/data",
"type": "IOT_CORE"
}
}
}
},
"ComponentDependencies": {
"aws.greengrass.LambdaLauncher": {
"VersionRequirement": ">=2.0.0 <3.0.0",
"DependencyType": "HARD"
},
"aws.greengrass.TokenExchangeService": {
"VersionRequirement": ">=2.0.0 <3.0.0",
"DependencyType": "HARD"
},
"aws.greengrass.LambdaRuntimes": {
"VersionRequirement": ">=2.0.0 <3.0.0",
"DependencyType": "SOFT"
}
},
"Manifests": [
{
"Platform": {
"os": "linux",
"architecture": "arm"
},
"Lifecycle": {},
"Artifacts": [
{
"Uri": "greengrass:lambda-artifact.zip",
"Digest": "GVgaQlVuSYmfgbwoStd5dfB9WamdQgrhbE72s2fF04ysno=",
"Algorithm": "SHA-256",
"Unarchive": "ZIP",
"Permission": {
"Read": "OWNER",
"Execute": "NONE"
}
}
]
}
],
"Lifecycle": {
"startup": {
"requiresPrivilege": true,
"script": "{aws.greengrass.LambdaLauncher:artifacts:path}/lambda-launcher start"
},
"setenv": {
"AWS_GREENGRASS_LAMBDA_CONTAINER_MODE": "{configuration:/containerMode}",
"AWS_GREENGRASS_LAMBDA_ARN": "arn:aws:lambda:region:account_id:function:Greengrass_WeatherStation:5",
"AWS_GREENGRASS_LAMBDA_FUNCTION_HANDLER": "main.weather_handler",
"AWS_GREENGRASS_LAMBDA_ARTIFACT_PATH": "{artifacts:decompressedPath}/lambda-artifact",
"AWS_GREENGRASS_LAMBDA_CONTAINER_PARAMS": "{configuration:/containerParams}",
"AWS_GREENGRASS_LAMBDA_STATUS_TIMEOUT_SECONDS": "{configuration:/statusTimeoutInSeconds}",
"AWS_GREENGRASS_LAMBDA_ENCODING_TYPE": "{configuration:/inputPayloadEncodingType}",
"AWS_GREENGRASS_LAMBDA_PARAMS": "{configuration:/lambdaExecutionParameters}",
"AWS_GREENGRASS_LAMBDA_RUNTIME_PATH": "{aws.greengrass.LambdaRuntimes:artifacts:decompressedPath}/runtime/",
"AWS_GREENGRASS_LAMBDA_EXEC_ARGS": "[\"python3.7\",\"-u\",\"/runtime/python/lambda_runtime.py\",\"--handler=main.weather_handler\"]",
"AWS_GREENGRASS_LAMBDA_RUNTIME": "python3.7"
},
"shutdown": {
"requiresPrivilege": true,
"script": "{aws.greengrass.LambdaLauncher:artifacts:path}/lambda-launcher stop; {aws.greengrass.LambdaLauncher:artifacts:path}/lambda-launcher clean"
}
}
}

My Lambda is throwing a invoke error timeout

Normally my lambda runs fine, today I am starting to receive this error:
ERROR Invoke Error
{
"errorType": "TimeoutError",
"errorMessage": "Connection timed out after 120000ms",
"code": "TimeoutError",
"message": "Connection timed out after 120000ms",
"time": "2020-11-27T10:34:39.272Z",
"region": "eu-west-1",
"hostname": "lambda.eu-west-1.amazonaws.com",
"retryable": true,
"stack": [
"TimeoutError: Connection timed out after 120000ms",
" at ClientRequest.<anonymous> (/var/task/node_modules/aws-sdk/lib/http/node.js:83:34)",
" at Object.onceWrapper (events.js:286:20)",
" at ClientRequest.emit (events.js:198:13)",
" at ClientRequest.EventEmitter.emit (domain.js:448:20)",
" at TLSSocket.emitRequestTimeout (_http_client.js:673:40)",
" at Object.onceWrapper (events.js:286:20)",
" at TLSSocket.emit (events.js:198:13)",
" at TLSSocket.EventEmitter.emit (domain.js:448:20)",
" at TLSSocket.Socket._onTimeout (net.js:443:8)",
" at ontimeout (timers.js:436:11)"
]
}
I don't have any clue what might be causing this, I know that this lambda invokes several lambdas and awaits on all of them to conclude, I checked the logs on cloudwatch for each one and all of them had completed with success.
Here is a snippet of the code I use to trigger all those child lambdas and wait for them:
function invokeAll(){
const baseLambdaPayload = {
arg1: args.myarg1,
arg2: args.myarg2,
arg3: args.myarg3,
arg4: args.myarg4
};
lambdaInvocations = [
...lambdaInvocations,
triggerLamdba(
'lambda1', {
...baseLambdaPayload,
morePayload: await getMorePayload()
}),
triggerLamdba(
'lambda2', baseLambdaPayload),
triggerLamdba(
'lambda3', baseLambdaPayload),
triggerLamdba(
'lambda4', baseLambdaPayload)
];
return await Promise.all(lambdaInvocations);
}
const triggerLamdba = (name, payload) => {
const params = {
FunctionName: name,
InvocationType: 'RequestResponse',
Payload: JSON.stringify(payload)
};
return lambda.invoke(params).promise();
}
Any tips to where I should look into? Thanks.

React Native Expo App: How to get it to run Jest tests

So Jest seems to be broken out of the box right now, when creating a React Native App with Expo.
Steps to reproduce:
`expo init'
Choose tabs.
cd into your app.
Run npm test 👉🏻 Fails
I googled and tried out the following fixes:
A) Add jest.config.js:
module.exports = {
preset: 'jest-expo',
transform: {
'\\.js$': '<rootDir>/node_modules/react-native/jest/preprocessor.js',
}
};
B) Copy react-natives preprocessor in your own `jest.preprcessor.js' file:
transform: {
/*
* Stop jest from falling over on its face.
* cf. https://github.com/expo/expo/issues/2595#issuecomment-440966998
* cf. https://github.com/facebook/react-native/issues/22175#issuecomment-436959462
*/
'\\.js$': '<rootDir>/jest.preprocessor.js',
},
C) Changing the "test" scripts section
from:
"test": "node_modules/.bin/jest"
to:
"test": "node ./node_modules/jest/bin/jest.js"
So nothing works 😓 All approaches result in some or all tests failing.
Does anyone know how to get jest to work with Expo 32?
Edit: Bruno's answer works. Additionally, make sure to delete your node_modules and package-lock.json before running yarn. Furthermore, you don't need a jest.config.js. And you also don't need Bruno's babel.config.js. Here is mine:
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
It's so weird that it doesn't work for npm.
PS, here is the preprocessor code so you don't have to search it:
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* #format
* #flow
*/
/* eslint-env node */
'use strict';
const {transformSync: babelTransformSync} = require('#babel/core');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const babelRegisterOnly = require('metro-babel-register');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const createCacheKeyFunction = require('fbjs-scripts/jest/createCacheKeyFunction');
const generate = require('#babel/generator').default;
const nodeFiles = RegExp(
[
'/local-cli/',
'/metro(?:-[^/]*)?/', // metro, metro-core, metro-source-map, metro-etc
].join('|'),
);
const nodeOptions = babelRegisterOnly.config([nodeFiles]);
babelRegisterOnly([]);
/* $FlowFixMe(site=react_native_oss) */
const transformer = require('metro/src/reactNativeTransformer');
module.exports = {
process(src /*: string */, file /*: string */) {
if (nodeFiles.test(file)) {
// node specific transforms only
return babelTransformSync(src, {
filename: file,
sourceType: 'script',
...nodeOptions,
ast: false,
}).code;
}
const {ast} = transformer.transform({
filename: file,
localPath: file,
options: {
ast: true, // needed for open source (?) https://github.com/facebook/react-native/commit/f8d6b97140cffe8d18b2558f94570c8d1b410d5c#r28647044
dev: true,
inlineRequires: true,
minify: false,
platform: '',
projectRoot: '',
retainLines: true,
sourceType: 'unambiguous', // b7 required. detects module vs script mode
},
src,
plugins: [
[require('#babel/plugin-transform-block-scoping')],
// the flow strip types plugin must go BEFORE class properties!
// there'll be a test case that fails if you don't.
[require('#babel/plugin-transform-flow-strip-types')],
[
require('#babel/plugin-proposal-class-properties'),
// use `this.foo = bar` instead of `this.defineProperty('foo', ...)`
{loose: true},
],
[require('#babel/plugin-transform-computed-properties')],
[require('#babel/plugin-transform-destructuring')],
[require('#babel/plugin-transform-function-name')],
[require('#babel/plugin-transform-literals')],
[require('#babel/plugin-transform-parameters')],
[require('#babel/plugin-transform-shorthand-properties')],
[require('#babel/plugin-transform-react-jsx')],
[require('#babel/plugin-transform-regenerator')],
[require('#babel/plugin-transform-sticky-regex')],
[require('#babel/plugin-transform-unicode-regex')],
[
require('#babel/plugin-transform-modules-commonjs'),
{strict: false, allowTopLevelThis: true},
],
[require('#babel/plugin-transform-classes')],
[require('#babel/plugin-transform-arrow-functions')],
[require('#babel/plugin-transform-spread')],
[require('#babel/plugin-proposal-object-rest-spread')],
[
require('#babel/plugin-transform-template-literals'),
{loose: true}, // dont 'a'.concat('b'), just use 'a'+'b'
],
[require('#babel/plugin-transform-exponentiation-operator')],
[require('#babel/plugin-transform-object-assign')],
[require('#babel/plugin-transform-for-of'), {loose: true}],
[require('#babel/plugin-transform-react-display-name')],
[require('#babel/plugin-transform-react-jsx-source')],
],
});
return generate(
ast,
{
code: true,
comments: false,
compact: false,
filename: file,
retainLines: true,
sourceFileName: file,
sourceMaps: true,
},
src,
).code;
},
getCacheKey: createCacheKeyFunction([
__filename,
require.resolve('metro/src/reactNativeTransformer'),
require.resolve('#babel/core/package.json'),
]),
};
My dependencies:
"dependencies": {
"#expo/samples": "2.1.1",
"expo": "^32.0.0",
"formik": "^1.5.0",
"i18n-js": "^3.2.1",
"prop-types": "^15.7.1",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
"react-navigation": "^3.0.9",
"yup": "^0.26.10"
},
"devDependencies": {
"babel-eslint": "^10.0.1",
"babel-preset-expo": "^5.0.0",
"eslint": "^5.13.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-native": "^3.6.0",
"eslint-plugin-react-native-a11y": "^1.2.0",
"eslint-plugin-simple-import-sort": "^3.0.0",
"jest-expo": "^32.0.0",
"react-native-elements": "^1.0.0",
"react-native-testing-library": "^1.5.0"
},
Your dependecies and devDependencies seem fine.
First thing, install yarn. Follow this link for instructions.
Second, you must alter a few things in your package.json. Like this:
"scripts": {
"test": "jest",
...
},
"jest": {
"preset": "jest-expo",
"transform": {
"^.+\\.js$": "babel-jest"
},
}
Third, ensure your babel.config.js is setup correctly. Here's the one from my project running Expo's SDK 32:
module.exports = function (api) {
api.cache(true);
return {
presets: [
'babel-preset-expo',
'module:react-native-dotenv',
],
sourceMaps: true,
plugins: [
'#babel/transform-react-jsx-source',
],
};
};
Lastly, use yarn to install your packages yarn install and to run your tests yarn test.

friendsofsymfony/rest-bundle 2.1.0 conflicts with sensio/framework-extra-bundle[v2.2.6]

Hi my application is running with Symfony 2.2, I am trying to install FOSRESTBundle with commannde composer require friendsofsymfony/rest-bundle for this purpose but I am getting the following error.
Your requirements could not be resolved to an installable set of packages. Problem 1
- friendsofsymfony/rest-bundle 2.1.0 conflicts with sensio/framework-extra-bundle[v2.2.6].
- friendsofsymfony/rest-bundle 2.1.0 conflicts with sensio/framework-extra-bundle[v2.2.6].
- friendsofsymfony/rest-bundle 2.1.0 conflicts with sensio/framework-extra-bundle[v2.2.6].
- Installation request for friendsofsymfony/rest-bundle ^2.1 -> satisfiable by friendsofsymfony/rest-bundle[2.1.0].
- Installation request for sensio/framework-extra-bundle (locked at v2.2.6, required as 2.2.*) -> satisfiable by sensio/framework-extra-bundle[v2.2.6].Installation failed, reverting ./composer.json to its original content.
the content of composer.json is here
{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.2.*",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.2.*",
"symfony/monolog-bundle": "2.2.*",
"sensio/distribution-bundle": "2.2.*",
"sensio/framework-extra-bundle": "2.2.*",
"sensio/generator-bundle": "2.2.*",
"jms/security-extra-bundle": "1.4.*",
"jms/di-extra-bundle": "1.3.*",
"winzou/console-bundle": "1.*",
"stof/doctrine-extensions-bundle": "1.1.x-dev",
"doctrine/doctrine-fixtures-bundle": "dev-master",
"doctrine/data-fixtures" : "dev-master",
"doctrine/doctrine-migrations-bundle": "dev-master",
"doctrine/migrations": "dev-master",
"friendsofsymfony/user-bundle": "*",
"knplabs/knp-markdown-bundle": "1.2.*#dev",
"ornicar/akismet-bundle": "dev-master",
"genemu/form-bundle": "2.1.*",
"spraed/pdf-generator-bundle": "^1.2",
"psliwa/pdf-bundle": "^1.0",
"knplabs/knp-snappy-bundle": "^1.3",
"h4cc/wkhtmltopdf-i386": "0.12.2.1",
"h4cc/wkhtmltoimage-i386": "0.12.2.1",
"obtao/html2pdf-bundle": "master-dev"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"minimum-stability": "stable",
"prefer-stable": true,
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}
Please suggest how to resolve this.
If you have symfony2.2 please try:
composer require friendsofsymfony/rest-bundle:1.5.3
Or update symfony.