aws-solutions / aws-data-lake-solution

A deployable reference implementation intended to address pain points around conceptualizing data lake architectures that automatically configures the core AWS services necessary to easily tag, search, share, and govern specific subsets of data across a business or with other external businesses.
https://aws.amazon.com/solutions/implementations/data-lake-solution/
Apache License 2.0
401 stars 160 forks source link

fs.writeFile throws ERR_INVALID_CALLBACK error #37

Closed joarder closed 4 years ago

joarder commented 5 years ago

Versions: NodeJS version: v12.12.0 OS: Mac OS X 10.14.6

The following error occurs while building the solutions with the command ./build-s3-dist.sh $DEPLOY_BUCKET $VERSION_CODE

Detail error message:

fs.js:135
  throw new ERR_INVALID_CALLBACK(cb);
  ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
    at maybeCallback (fs.js:135:9)
    at Object.writeFile (fs.js:1234:14)
    at Object.<anonymous> (/Users/-/Documents/workspace/aws-data-lake-solution/deployment/manifest-generator/app.js:70:4)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'ERR_INVALID_CALLBACK'
}

Fix:

In file aws-data-lake-solution/deployment/manifest-generator/app.js Line 70 should be: fs.writeFileSync('../dist/data-lake-site-manifest.json', JSON.stringify(_manifest, null, 4)); instead of: fs.writeFile('../dist/data-lake-site-manifest.json', JSON.stringify(_manifest, null, 4));

beomseoklee commented 5 years ago

Thanks for your input, and I am sorry about your inconvenience. We will consider to fix this one in the next release.

georgebearden commented 4 years ago

This issue should be addressed in the latest commit. Please let us know if you need additional assistance.