AWS SAM running local won't resolve FindInMap Intrinsic - aws-lambda

I can't make a template.yaml with Mappings work when testing locally, although they will deploy and work as expected.
As an example, one can follow:
sam init --runtime python3.8
Insert Mappings such as the following in template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
sam-app
Sample SAM Template for sam-app
Parameters:
Environment:
Description: 'Required. Environment'
Type: String
AllowedValues:
- test
- prod
Default: test
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 3
MemorySize: !FindInMap [Environments, !Ref Environment, MemorySize]
Mappings:
Environments:
test:
MemorySize: 512
prod:
MemorySize: 2048
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: hello_world/
Handler: app.lambda_handler
Runtime: python3.8
Events:
HelloWorld:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /hello
Method: get
Outputs:
# ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
# Find out more about other implicit resources you can reference within SAM
# https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api
HelloWorldApi:
Description: "API Gateway endpoint URL for Prod stage for Hello World function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/"
HelloWorldFunction:
Description: "Hello World Lambda Function ARN"
Value: !GetAtt HelloWorldFunction.Arn
HelloWorldFunctionIamRole:
Description: "Implicit IAM Role created for Hello World function"
Value: !GetAtt HelloWorldFunctionRole.Arn
sam build --parameter-overrides ParamaterKey=Environment,ParameterValue=test --use-container
sam local start-api --debug, and it will show unresolved references.
2021-03-06 00:30:42,394 | local start-api command is called
2021-03-06 00:30:42,399 | Collected default values for parameters: {'Environment': 'test'}
2021-03-06 00:30:42,417 | Unable to resolve property MemorySize: OrderedDict([('Fn::FindInMap', ['Environments', OrderedDict([('Ref', 'Environment')]), 'MemorySize'])]). Leaving as is.
2021-03-06 00:30:42,417 | 2 resources found in the stack
2021-03-06 00:30:42,417 | Collected default values for parameters: {'Environment': 'test'}
2021-03-06 00:30:42,433 | Unable to resolve property MemorySize: OrderedDict([('Fn::FindInMap', ['Environments', OrderedDict([('Ref', 'Environment')]), 'MemorySize'])]). Leaving as is.
2021-03-06 00:30:42,434 | Collected default values for parameters: {'Environment': 'test'}
2021-03-06 00:30:42,449 | Unable to resolve property MemorySize: OrderedDict([('Fn::FindInMap', ['Environments', OrderedDict([('Ref', 'Environment')]), 'MemorySize'])]). Leaving as is.
2021-03-06 00:30:42,449 | Found Serverless function with name='HelloWorldFunction' and CodeUri='HelloWorldFunction'
2021-03-06 00:30:42,452 | Collected default values for parameters: {'Environment': 'test'}
2021-03-06 00:30:42,467 | Unable to resolve property MemorySize: OrderedDict([('Fn::FindInMap', ['Environments', OrderedDict([('Ref', 'Environment')]), 'MemorySize'])]). Leaving as is.
2021-03-06 00:30:42,467 | 2 resources found in the template
2021-03-06 00:30:42,468 | Found '1' API Events in Serverless function with name 'HelloWorldFunction'
2021-03-06 00:30:42,468 | Detected Inline Swagger definition
2021-03-06 00:30:42,468 | Lambda function integration not found in Swagger document at path='/hello' method='get'
2021-03-06 00:30:42,468 | Found '0' APIs in resource 'ServerlessRestApi'
2021-03-06 00:30:42,468 | Removed duplicates from '0' Explicit APIs and '1' Implicit APIs to produce '1' APIs
2021-03-06 00:30:42,468 | 1 APIs found in the template
2021-03-06 00:30:42,471 | Mounting HelloWorldFunction at http://127.0.0.1:3000/hello [GET]
2021-03-06 00:30:42,471 | You can now browse to the above endpoints to invoke your functions. You do not need to restart/reload SAM CLI while working on your functions, changes will be reflected instantly/automatically. You only need to restart SAM CLI if you update your AWS SAM template
2021-03-06 00:30:42,471 | Localhost server is starting up. Multi-threading = True
2021-03-06 00:30:42 * Running on http://127.0.0.1:3000/ (Press CTRL+C to quit)
Insist with curl http://127.0.0.1/hello and sam will show an error:
2021-03-06 00:33:25,099 | Found one Lambda function with name 'HelloWorldFunction'
2021-03-06 00:33:25,099 | Invoking app.lambda_handler (python3.8)
2021-03-06 00:33:25,099 | No environment variables found for function 'HelloWorldFunction'
2021-03-06 00:33:25,099 | Environment variables overrides data is standard format
2021-03-06 00:33:25,099 | Loading AWS credentials from session with profile 'None'
2021-03-06 00:33:25,113 | Resolving code path. Cwd=/home/ricardo/Sandbox/learning/aws/sam-app/.aws-sam/build, CodeUri=/home/ricardo/Sandbox/learning/aws/sam-app/.aws-sam/build/HelloWorldFunction
2021-03-06 00:33:25,113 | Resolved absolute path to code is /home/ricardo/Sandbox/learning/aws/sam-app/.aws-sam/build/HelloWorldFunction
2021-03-06 00:33:25,113 | Code /home/ricardo/Sandbox/learning/aws/sam-app/.aws-sam/build/HelloWorldFunction is not a zip/jar file
2021-03-06 00:33:25,127 | Skip pulling image and use local one: amazon/aws-sam-cli-emulation-image-python3.8:rapid-1.19.1.
2021-03-06 00:33:25,127 | Mounting /home/ricardo/Sandbox/learning/aws/sam-app/.aws-sam/build/HelloWorldFunction as /var/task:ro,delegated inside runtime container
2021-03-06 00:33:25,127 | Cleaning all decompressed code dirs
2021-03-06 00:33:25,128 | Exception on /hello [GET]
Traceback (most recent call last):
File "/home/ricardo/.local/lib/python3.8/site-packages/docker/utils/utils.py", line 415, in parse_bytes
digits = int(digits_part)
ValueError: invalid literal for int() with base 10: "OrderedDict([('Fn::FindInMap', ['Environments', OrderedDict([('Ref', 'Environment')]), 'MemorySize'])])"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ricardo/.local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/ricardo/.local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/ricardo/.local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/ricardo/.local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/ricardo/.local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/ricardo/.local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/ricardo/.local/lib/python3.8/site-packages/samcli/local/apigw/local_apigw_service.py", line 297, in _request_handler
self.lambda_runner.invoke(route.function_name, event, stdout=stdout_stream_writer, stderr=self.stderr)
File "/home/ricardo/.local/lib/python3.8/site-packages/samcli/commands/local/lib/local_lambda.py", line 111, in invoke
self.local_runtime.invoke(config, event, debug_context=self.debug_context, stdout=stdout, stderr=stderr)
File "/home/ricardo/.local/lib/python3.8/site-packages/samcli/lib/telemetry/metric.py", line 216, in wrapped_func
return_value = func(*args, **kwargs)
File "/home/ricardo/.local/lib/python3.8/site-packages/samcli/local/lambdafn/runtime.py", line 148, in invoke
container = self.create(function_config, debug_context)
File "/home/ricardo/.local/lib/python3.8/site-packages/samcli/local/lambdafn/runtime.py", line 82, in create
self._container_manager.create(container)
File "/home/ricardo/.local/lib/python3.8/site-packages/samcli/local/docker/manager.py", line 95, in create
container.create()
File "/home/ricardo/.local/lib/python3.8/site-packages/samcli/local/docker/container.py", line 167, in create
real_container = self.docker_client.containers.create(self._image, **kwargs)
File "/home/ricardo/.local/lib/python3.8/site-packages/docker/models/containers.py", line 860, in create
create_kwargs = _create_container_args(kwargs)
File "/home/ricardo/.local/lib/python3.8/site-packages/docker/models/containers.py", line 1077, in _create_container_args
create_kwargs['host_config'] = HostConfig(**host_config_kwargs)
File "/home/ricardo/.local/lib/python3.8/site-packages/docker/types/containers.py", line 182, in __init__
self['Memory'] = parse_bytes(mem_limit)
File "/home/ricardo/.local/lib/python3.8/site-packages/docker/utils/utils.py", line 417, in parse_bytes
raise errors.DockerException(
docker.errors.DockerException: Failed converting the string value for memory (OrderedDict([('Fn::FindInMap', ['Environments', OrderedDict([('Ref', 'Environment')]), 'MemorySize'])])) to an integer.
sam --version gives SAM CLI, version 1.19.1.
Isn't FindInMap intrinsic still not implemented? What am I doing wrong?

Related

Unable to put Vault UI in https

I try to run Vault with a CRC OpenShift 4.7 and helm3 but I've some problems when I try to enable the UI in https.
Add hashicorp repo :
helm repo add hashicorp https://helm.releases.hashicorp.com
Install the latest version of vault :
[[tim#localhost config]]$ helm install vault hashicorp/vault \
> --namespace vault-project \
> --set "global.openshift=true" \
> --set "server.dev.enabled=true"
Then I run oc get pods
[tim#localhost config]$ oc get pods
NAME READY STATUS RESTARTS AGE
vault-project-0 0/1 Running 0 48m
vault-project-agent-injector-8568dbf75d-4gjnw 1/1 Running 0 6h9m
I run an interactive shell session with the vault-0 pod :
oc rsh vault-project-0
Then I initialize Vault :
/ $ vault operator init --tls-skip-verify -key-shares=1 -key-threshold=1
Unseal Key 1: iE1iU5bnEsRPSkx0Jd5LWx2NMy2YH6C8bG9+Zo6/VOs=
Initial Root Token: s.xVb0DvIMQRYam7oS2C0ZsHBC
Vault initialized with 1 key shares and a key threshold of 1. Please securely
distribute the key shares printed above. When the Vault is re-sealed,
restarted, or stopped, you must supply at least 1 of these keys to unseal it
before it can start servicing requests.
Vault does not store the generated master key. Without at least 1 key to
reconstruct the master key, Vault will remain permanently sealed!
It is possible to generate new unseal keys, provided you have a quorum of
existing unseal keys shares. See "vault operator rekey" for more information.
Export the token :
export VAULT_TOKEN=s.xVb0DvIMQRYam7oS2C0ZsHBC
Unseal Vault :
/ $ vault operator unseal --tls-skip-verify iE1iU5bnEsRPSkx0Jd5LWx2NMy2YH6C8bG9+Zo6/VOs=
Key Value
--- -----
Seal Type shamir
Initialized true
Sealed false
Total Shares 1
Threshold 1
Version 1.6.2
Storage Type file
Cluster Name vault-cluster-21448fb0
Cluster ID e4d4649f-2187-4682-fbcb-4fc175d20a6b
HA Enabled false
I check the pods :
[tim#localhost config]$ oc get pods
NAME READY STATUS RESTARTS AGE
vault-project-0 1/1 Running 0 35m
vault-project-agent-injector-8568dbf75d-4gjnw 1/1 Running 0 35m
 
I'm able to get the UI without https :
In the OpenShift console, I switch to the Administrator mode and this is what I've done :
Networking part
- Routes > Create routes
Name : vault-route
Hostname : 192.168.130.11
Path :
Service : vault
Target Port : 8200 -> 8200 (TCP)
Now, if I check the URL : http://192.168.130.11/ui :
The UI is available.
 
In order to enable the https, I've followed the step here :
https://www.vaultproject.io/docs/platform/k8s/helm/examples/standalone-tls
But I've change the K8S commands for the OpenShift commands
# SERVICE is the name of the Vault service in Kubernetes.
# It does not have to match the actual running service, though it may help for consistency.
SERVICE=vault-server-tls
# NAMESPACE where the Vault service is running.
NAMESPACE=vault-project
# SECRET_NAME to create in the Kubernetes secrets store.
SECRET_NAME=vault-server-tls
# TMPDIR is a temporary working directory.
TMPDIR=/**tmp**
Then :
openssl genrsa -out ${TMPDIR}/vault.key 2048
Then create the csr.conf file :
[tim#localhost tmp]$ cat csr.conf
[req]
default_bits = 4096
default_md = sha256
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = #alt_names
[alt_names]
DNS.1 = vault-project
DNS.2 = vault-project.vault-project
DNS.3 = *apps-crc.testing
DNS.4 = *api.crc.testing
IP.1 = 127.0.0.1
Create the CSR :
openssl req -new -key': openssl req -new -key ${TMPDIR}/vault.key -subj "/CN=${SERVICE}.${NAMESPACE}.apps-crc.testing" -out ${TMPDIR}/server.csr -config ${TMPDIR}/csr.conf
Create the file ** csr.yaml :
$ export CSR_NAME=vault-csr
$ cat <<EOF >${TMPDIR}/csr.yaml
apiVersion: certificates.k8s.io/v1beta1
kind: CertificateSigningRequest
metadata:
name: ${CSR_NAME}
spec:
groups:
- system:authenticated
request: $(cat ${TMPDIR}/server.csr | base64 | tr -d '\n')
usages:
- digital signature
- key encipherment
- server auth
EOF
Send the CSR to OpenShfit :
oc create -f ${TMPDIR}/csr.yaml
Approve CSR :
oc adm certificate approve ${CSR_NAME}
Retrieve the certificate :
serverCert=$(oc get csr ${CSR_NAME} -o jsonpath='{.status.certificate}')
Write the certificate out to a file :
echo "${serverCert}" | openssl base64 -d -A -out ${TMPDIR}/vault.crt
Retrieve Openshift CA :
oc config view --raw --minify --flatten -o jsonpath='{.clusters[].cluster.certificate-authority-data}' | base64 -d > ${TMPDIR}/vault.ca
Store the key, cert, and OpenShift CA into Kubernetes secrets :
oc create secret generic ${SECRET_NAME} \
--namespace ${NAMESPACE} \
--from-file=vault.key=/home/vault/certs/vault.key \
--from-file=vault.crt=/home/vault/certs//vault.crt \
--from-file=vault.ca=/home/vault/certs/vault.ca
The command oc get secret | grep vault :
NAME TYPE DATA AGE
vault-server-tls Opaque 3 4h15m
Edit my vault-config with the oc edit cm vault-config command:
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
data:
extraconfig-from-values.hcl: |-
disable_mlock = true
ui = true
listener "tcp" {
tls_cert_file = "/vault/certs/vault.crt"
tls_key_file = "/vault/certs/vault.key"
tls_client_ca_file = "/vault/certs/vault.ca"
address = "[::]:8200"
cluster_address = "[::]:8201"
}
storage "file" {
path = "/vault/data"
}
kind: ConfigMap
metadata:
creationTimestamp: "2021-03-15T13:47:24Z"
name: vault-config
namespace: vault-project
resourceVersion: "396958"
selfLink: /api/v1/namespaces/vault-project/configmaps/vault-config
uid: 844603a1-b529-4e33-9d58-20525ea7bff
Edit the VolumeMounst, volumes and ADDR parts my statefulset :
volumeMounts:
- mountPath: /home/vault
name: home
- mountPath: /vault/certs
name: certs
volumes:
- configMap:
defaultMode: 420
name: vault-config
name: config
- emptyDir: {}
name: home
- name: certs
secret:
defaultMode: 420
secretName: vault-server-tls
name: VAULT_ADDR
value: https://127.0.0.1:8200
I delete my pods in order to take into account all my changes
oc delete pods vault-project-0
And...
tim#localhost config]$ oc get pods
NAME READY STATUS RESTARTS AGE
vault-project-0 0/1 Running 0 48m
vault-project-agent-injector-8568dbf75d-4gjnw 1/1 Running 0 6h9m
vault-project-0 is on 0/1 but running. If I describe the pods :
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning Unhealthy 1s (x6 over 26s) kubelet Readiness probe failed: Error checking seal status: Get "https://127.0.0.1:8200/v1/sys/seal-status": http: server gave HTTP response to HTTPS client
If think that I've missed something but I don't know what...
Someone to tell me how to enable https for the vault UI with openshift ?

Lambda can't find the file when code version inserted into Handler property in CloudFormation template

The artefact that I create and deploy has a version number in it. It is of the form:
universe-0.0.1-SNAPSHOT.zip
where the 0.0.1-SNAPSHOT is the version.
Now the CloudFormation template has the Handler mapped through a Fn::Join function:
UFunctionCelestial:
Type: AWS::Lambda::Function
Properties:
Code:
S3Bucket: !Ref ArtefactRepositoryBucket
S3Key: !Join [ '', [!Sub '${AWS::StackName}-', !Ref CodeVersion, '.zip' ] ]
Handler: !Join [ '', [!Sub '${AWS::StackName}-', !Ref CodeVersion, '/src/lambdas/celestial_persist_function.handler'] ]
Role: !GetAtt [ UIAMRoleFunctionServiceRoleCelestial, Arn ]
Runtime: python3.7
Environment:
Variables:
CELESTIAL_TABLE_NAME: !Ref UTableCelestial
PRIMARY_KEY: id
DependsOn:
- UIAMRoleFunctionServiceRolePolicyCelestial
- UIAMRoleFunctionServiceRoleCelestial
...SNIP...
Parameters:
ArtefactRepositoryBucket:
Type: String
Description: S3 bucket for asset "foundry-cdk/CelestialHandler/Code"
CodeVersion:
Type: String
Description: S3 key for asset version "foundry-cdk/CelestialHandler/Code"
I guess most of this is irrelevant, except the Handler property
Now the !Ref CodeVersion code version for that line seems to evaluate as 0/0/1-SNAPSHOT for some reason, even though I call this template with the command:
aws2 cloudformation deploy \
--template-file ${CF_TEMPLATE_FILE} \
--region ${ACCOUNT_REGION} \
--stack-name ${PROJECT_NAME} \
--force-upload \
--capabilities CAPABILITY_IAM \
--parameter-overrides \
ArtefactRepositoryBucket=${S3_AWS_RELEASES_BUCKET} \
CodeVersion=${APPLICATION_VERSION}
I echoed out the ${APPLICATION_VERSION} and, yep, it evaluates to 0.0.1-SNAPSHOT
and yet when I go to the console and look at my Lambda I get the message:
Lambda can't find the file universe-0/0/1-SNAPSHOT/src/lambdas/celestial_persist_function.py. Make sure that your handler upholds the format: file-name.method.
So my question is, why is CloudFormation turning my dots into slashes and giving the Lambda a bum reference?
It's not cloudformation what doing it. The behavior you are seeing is normal behavior.
Generally, When you define the handler as "folder1.folder2.file.handler", it will look for a folder1, then look for folder2 inside that, then look for the file file.py inside. Finally, the file.py is expected to have a function named handler.
I am assuming that your zip file has a top folder called src. In that case, your handler should be defined as src.lambdas.celestial_persist_function.handler since you have already mentioned where your zip file is using the S3Key.
hope this helps.

POSTing XML to a lambda in Localstack always throws 502 Bad Gateway

We have a lambda deployed to Localstack with an API gateway endpoint configured as AWS_PROXY. Invoking the Lambda with a POST works if the body is empty or contains JSON, however, sending XML in the body (regardless of the Content-Type) always returns a 502. The error in the Localstack log is:
localstack_1 | 2019-11-14T13:29:49:ERROR:localstack.services.generic_proxy: Error forwarding request: Expecting value: line 1 column 1 (char 0) Traceback (most recent call last):
localstack_1 | File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
localstack_1 | path=path, data=data, headers=forward_headers)
localstack_1 | File "/opt/code/localstack/localstack/services/apigateway/apigateway_listener.py", line 35, in forward_request
localstack_1 | data = data and json.loads(to_str(data))
localstack_1 | File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
localstack_1 | return _default_decoder.decode(s)
localstack_1 | File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
localstack_1 | obj, end = self.raw_decode(s, idx=_w(s, 0).end())
localstack_1 | File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
localstack_1 | raise JSONDecodeError("Expecting value", s, err.value) from None
localstack_1 | json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I thought AWS_PROXY integration was supposed to pass data direct to the Lambda without any attempt to decode or validate? Is there a way to set up the API gateway integration so that it will happily accept XML?
This is the function that we're using to set up API Gateway after the lambda has been deployed: https://gist.github.com/jgwconsulting/0c5597a661cbc6d29aaa346b2aed5020
This looks to be a problem with Localstack always assuming that POSTed data will be JSON and attempting to parse it to a Python dictionary.
I've created an issue to track the problem here and will attempt to make a PR to fix it if I get time: https://github.com/localstack/localstack/issues/1762

Email sending error in elastalert. SMTPSenderRefused: (530, '5.5.1 Authentication Required)

i got gmail authentication error. my config and error message as below
I already allowed less secure apps in gmail.
Config.yaml file email section as below
name: frequency_rule
type: frequency
index: security
num_events: 50
timeframe:
days: 1
filter:
- term:
host.keyword : "azure-2"
alert:
- email
email:
"to_address#gmail.com"
smtp_host: "smtp.gmail.com"
smtp_port: "465"
smtp_ssl: true
from_addr: "from_address#gmail.com"
user: "from_address#gmail.com"
password: "password"
Error message as below
PS C:\Users\smiforce-2ndPC\Downloads\Compressed\elastalert-master\elastalert-master> python -m elastalert.elastalert --verbose --config ./config.yaml --rule ./alert_rules/frequency4.yaml
INFO:elastalert:Starting up
INFO:elastalert:Queried rule frequency_rule4 from 2017-11-20 09:48 Central Standard Time to 2017-11-21 09:48 Central Standard Time: 24 / 24 hits
ERROR:root:Traceback (most recent call last):
File "C:\Users\smiforce-2ndPC\Downloads\Compressed\elastalert-master\elastalert-master\elastalert\elastalert.py", line 1246, in alert
return self.send_alert(matches, rule, alert_time=alert_time, retried=retried)
File "C:\Users\smiforce-2ndPC\Downloads\Compressed\elastalert-master\elastalert-master\elastalert\elastalert.py", line 1326, in send_alert
alert.alert(matches)
File "elastalert\alerts.py", line 451, in alert
self.smtp.sendmail(self.from_addr, to_addr, email_msg.as_string())
File "C:\Python27\lib\smtplib.py", line 737, in sendmail
raise SMTPSenderRefused(code, resp, from_addr)
SMTPSenderRefused: (530, '5.5.1 Authentication Required. Learn more at\n5.5.1 https://support.google.com/mail/?p=WantAuthError l4sm636961ioc.69 - gsmtp', 'from_address#gmail.com')
ERROR:root:Uncaught exception running rule frequency_rule4: (530, '5.5.1 Authentication Required. Learn more at\n5.5.1 https://support.google.com/mail/?p=WantAuthError l4sm636961ioc.69 - gsmt
The user and password fields should not be stored in the same config.yaml file but in another file which is referenced in config.yaml.
For instance, create another file named auth.yaml and add the user and password configuration into it:
user: "from_address#gmail.com"
password: "password"
Then in config.yaml you can reference that file using this setting:
smtp_auth_file: "/path/to/auth.yaml"

FatalErrorException in PropelBundle.php line 29: Compile Error: Propel\PropelBundle\PropelBundle::boot(): Failed opening required

Im trying to use propel ORM with sympfony v-2.7
In my composer I've added this line
"propel/propel-bundle": "^1.4",
and installed this package successfully.
Then I load the Bundle into my karnel using this
$bundles = array(
new Propel\PropelBundle\PropelBundle(),
);
My config.yml settings
propel:
path: "%kernel.root_dir%/../vendor/propel"
phing_path: "%kernel.root_dir%/../vendor/phing"
logging: %kernel.debug%
dbal:
driver: %database_driver%
user: %database_user%
password: %database_password%
dsn: %database_driver%:host=%database_host%;dbname=%database_name%;charset=UTF8
options: {}
attributes: {}
But when I try to access- http://localhost/my-serp/web/
I got this Error
FatalErrorException in PropelBundle.php line 29:
Compile Error: Propel\PropelBundle\PropelBundle::boot(): Failed opening required 'D:\wamp\www\my-serp
\app/../vendor/propel/runtime/lib/Propel.php' (include_path='D:\wamp\www\my- serp\vendor/phing/phing/classes;D:\wamp
\www\my-serp\vendor/propel/propel1/runtime/lib;D:\wamp\www\my- serp\vendor/propel/propel1/generator/lib;.;C:\php\pear')
in PropelBundle.php line 29
at PropelBundle->boot() in bootstrap.php.cache line 2414
at Kernel->boot() in bootstrap.php.cache line 2442
at Kernel->handle() in app_dev.php line 28
at {main}() in app_dev.php line 0
I follow the documentation from github, can anybody say me what i've missed ??
Check/change your propel path to:
path: "%kernel.root_dir%/../vendor/propel/propel1"

Resources