Skip to content
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

Enabling profiling via env variable in Serverless Framework not working #64

Closed
austinhuminski opened this issue Jul 9, 2019 · 8 comments · Fixed by #66
Closed

Enabling profiling via env variable in Serverless Framework not working #64

austinhuminski opened this issue Jul 9, 2019 · 8 comments · Fixed by #66
Assignees

Comments

@austinhuminski
Copy link

austinhuminski commented Jul 9, 2019

When settings IOPIPE_ENABLE_PROFILER: true in serverless.yml file profiling is not getting enabled and I get an error in my CW logs with debug on

Node10
serverless-iopipe-layers: 0.3.3
arn:aws:lambda:us-east-1:146318645305:layer:IOpipeNodeJS10:1

2019-07-09T16:09:30.606Z    8013aca9-2f0e-4702-9aee-6954d5edc30a    ERROR    TypeError: Cannot read property 'getFileUploadMeta' of undefined
 at ProfilerPlugin.getFileUploadMeta (/opt/nodejs/node_modules/@iopipe/profiler/dist/index.js:124:23)
 at ProfilerPlugin.preInvoke (/opt/nodejs/node_modules/@iopipe/profiler/dist/index.js:96:28)
 at /opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:1984:30
 at Array.map (<anonymous>)
 at IOpipeWrapperClass._callee3$ (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:1980:44)
 at tryCatch (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:2244:40)
 at Generator.invoke [as _invoke] (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:2478:22)
 at Generator.prototype.(anonymous function) [as next] (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:2296:21)
 at step (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:1034:30)
 at /opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:1052:14
@mrickard
Copy link
Contributor

mrickard commented Jul 9, 2019

Potential duplicate of #45 --it's the same error. Is this just on Node 10, or with Node 8 as well?

@kolanos
Copy link

kolanos commented Jul 9, 2019

@mrickard Not seeing this error in the issue referenced? May be related, @austinhuminski reports this error is being seen in us-east-1 and eu-central-1, so not a local invoke like the issue you referenced.

@kolanos
Copy link

kolanos commented Jul 9, 2019

'getFileUploadMeta' of undefined at ProfilerPlugin.getFileUploadMeta (/opt/nodejs/node_modules/@iopipe/profiler/dist/index.js:124:23) suggests a bug in the upload/signing process or a possible incompatibility between core and the profiler plugin.

@mrickard
Copy link
Contributor

mrickard commented Jul 9, 2019

@kolanos True--that issue's a silent error, while I was seeing local invocations logging an error to stdout. Part of the problem there appears to be that the import of util from -core is undefined. In jest tests of -profile, util is imported correctly, but on inclusion in a project, -profile isn't able to import the separately-included -core. This can happen when there's a circular dependency, and while this isn't circular, as far as I can tell, the problem does seem to be the import.

Locally, it seems that the profile import of core does not throw this error if the function is using iopipe-js 1.15, but I've seen the error under 1.14.

@mrickard mrickard self-assigned this Jul 9, 2019
@austinhuminski
Copy link
Author

Tried this without the serverless-iopipe-layers plugin and got the same error. Used the @iopipe/iopipe method on both Node 10 and Node 8 with the same results.

@mrickard
Copy link
Contributor

mrickard commented Jul 9, 2019

@austinhuminski Interesting--I'm building a couple layers functions and I'll test them against non-layer as well.

@kolanos
Copy link

kolanos commented Jul 11, 2019

@mrickard Did #65 have any effect here?

@mrickard
Copy link
Contributor

@kolanos Unfortunately no! I did check that, but the error's still being thrown to the console. It's related to dependencies, I think, so I'm trying to configure a circular dependency check in ESLint.

mrickard added a commit to mrickard/iopipe-js-profiler that referenced this issue Jul 11, 2019
Waits to require core's util so that dependency loading can be completed, and makes that conditional to avoid unnecessary loading.
Closes iopipe#45
Closes iopipe#64
mrickard added a commit that referenced this issue Jul 12, 2019
Merge pull request #66 from mrickard/issue/45-fix-local-invocation-failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants