Open XerTheSquirrel opened 6 years ago
@XerTheSquirrel This line:
Syntax error in module 'index': invalid syntax (_base.py, line 414)
Appears to be referencing AWS Lambda's own bootstrap system. There is no _base.py
in the iopipe module.
Closing as unable to reproduce.
I'm also having this problem with my application. It was running stable on production for almost a year and suddenly, in a new deploy, it started to throw this error.
I am seeing the issue as well.
@pramodsetlur, @mateusfccp Any details to help reproduce? Are you both getting the same traceback? Is this with Serverless or something else?
@pramodsetlur, @mateusfccp Is the futures
package installed? IOpipe installs a futures
package on python2.7 which is a backport of concurrent.futures
which is only available in python3.x. However, if you are running python2.7 locally and install IOpipe and then deploy to python3.6 the futures
package will be included which may result in this error. Solution is to ensure that futures
is not included in your python3.6 deployment.
@kolanos Apologies; I am not using iopipie; My error is more related just to Lambda. I am deploying with serverless. It runs successfully with 3.7 on local and crashes with the same error Syntax error in module 'index': invalid syntax (_base.py, line 414)
on Lambda 3.6. I changed it to 2.7 and it worked fine.
(So, my message might not be relevant to iopipe at all.)
@pramodsetlur I traced the invalid syntax (_base.py, line 414)
back to the futures backport. So it is possible you're still running into that issue even without IOpipe being present.
@pramodsetlur If you're willing to give IOpipe another try, we have a new layers plugin for Serverless that doesn't require a code change: https://github.com/iopipe/serverless-iopipe-layers
@kolanos I only commented on this issue because i was seeing the particular error in _base.py. Was never using iopipie. But appreciate the responses.
The fix for this is to change either
concurrent/futures/
Going to add this to a troubleshooting section in the README.
Description
Following the README, the minimalist sample does not seem to work at all on Python 3.6. The README does say "This package supports Python 2.7 and 3.6, the runtimes supported by AWS Lambda.".
Steps to reproduce the issue:
index.py
@iopipe def lambda_handler(event, context): pass
Response: { "errorMessage": "Syntax error in module 'index'" }
Request ID: "102bedeb-86bf-11e8-8562-97ea3fe2926e"
Function Logs: START RequestId: 102bedeb-86bf-11e8-8562-97ea3fe2926e Version: $LATEST Syntax error in module 'index': invalid syntax (_base.py, line 414)
END RequestId: 102bedeb-86bf-11e8-8562-97ea3fe2926e REPORT RequestId: 102bedeb-86bf-11e8-8562-97ea3fe2926e Duration: 0.83 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 22 MB