-
Notifications
You must be signed in to change notification settings - Fork 268
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
mailcatcher/Dockerfile build is failing on initial attempt #458
Comments
You need to change /packages/internal/mailcatcher/Dockerfile In the first line, bump the version of alpine from 3.15.4 to 3.19.0 Although that makes the build succeed, I have not tested the email functionality. |
Thanks for the response. Modifying the Mailcatcher Dockerfile to
|
Thanks for the response @gabrii, some thoughts below: Using Alpine 3.19
This issue on the sqlite3-ruby repository covers it: More information on this from the Alpine repo: Using Alpine 3.18 Using Using Alpine 3.18 and Mailcatcher 0.9 My latest attempt, using 2024-02-10 20:42:08 stdout:
2024-02-10 20:42:08 > workers@2.4.2 sls /app/packages/workers
2024-02-10 20:42:08 > sls "invoke" "local" "-f" "SendEmail" "-d" "{\"source\":\"backend.email\",\"detail-type\":\"PASSWORD_RESET\",\"detail\":{\"id\":\"a862778ef5b54c4ca3eb15ede2a26768\",\"type\":\"PASSWORD_RESET\",\"to\":\"test@myaddress.com\",\"user_id\":\"OVwJAm8\",\"token\":\"c27m28-5da18398207311ea3a5f1d9bdd16fead\"}}"
2024-02-10 20:42:08 stderr: node:internal/modules/cjs/loader:1080
2024-02-10 20:42:08 throw err;
2024-02-10 20:42:08 ^
2024-02-10 20:42:08 Error: Cannot find module '/app/packages/workers/node_modules/serverless/bin/serverless.js'
2024-02-10 20:42:08 at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
2024-02-10 20:42:08 at Module._load (node:internal/modules/cjs/loader:922:27)
2024-02-10 20:42:08 at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
2024-02-10 20:42:08 at node:internal/main/run_main_module:23:47 {
2024-02-10 20:42:08 code: 'MODULE_NOT_FOUND',
2024-02-10 20:42:08 requireStack: []
2024-02-10 20:42:08 }
2024-02-10 20:42:08 Node.js v18.17.1
2024-02-10 20:42:08 stdout: ELIFECYCLE Command failed with exit code 1.
2024-02-10 20:42:08 child process exited with code 1 No idea what's happening here, but it does seem like you've seen a similar error in the past: #426 (comment) |
Hi @andrewrice, you are right. I got it to start with:
I proceeded to try to send a recovery email, and just made it this far: > workers@2.4.0 sls /app/packages/workers > sls "invoke" "local" "-f" "SendEmail" "-d" "{\"source\":\"backend.email\",\"detail-type\":\"PASSWORD_RESET\",\"detail\":{\"id\":\"19b2108dc0ba43ebb19c1628c690947c\",\"type\":\"PASSWORD_RESET\",\"to\":\"admin@example.com\",\"user_id\":\"ajeypWr\",\"token\":\"c289p8-56adb95d4ca2224858352d0c5e37b4c9\"}}" stderr: (node:146) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023. Please migrate your code to use AWS SDK for JavaScript (v3). For more information, check the migration guide at https://a.co/7PzMCcy (Use `node --trace-warnings ...` to show where the warning was created) stderr: Environment: linux, node 18.17.1, framework 3.35.2 (local), plugin 7.0.3, SDK 4.4.0 Docs: docs.serverless.com Support: forum.serverless.com Bugs: github.com/serverless/serverless/issues stderr: stdout: Error: Cannot resolve serverless.yml: Variables resolution errored with: - Cannot resolve variable at "custom.conf.eventBusArn": AWS provider credentials not found. Learn how to set up AWS provider credentials in our docs here: ., - Cannot resolve variable at "custom.conf.environment.SENTRY_DSN": AWS provider credentials not found. Learn how to set up AWS provider credentials in our docs here: ., - Cannot resolve variable at "custom.conf.SendEmail.environment.FROM_EMAIL": AWS provider credentials not found. Learn how to set up AWS provider credentials in our docs here: ., - Cannot resolve variable at "custom.conf.ExportUsers.environment.HASHID_SALT": AWS provider credentials not found. Learn how to set up AWS provider credentials in our docs here: ., - Cannot resolve variable at "custom.conf.SynchronizeContentfulContent.environment.CONTENTFUL_SPACE_ID": AWS provider credentials not found. Learn how to set up AWS provider credentials in our docs here: ., - Cannot resolve variable at "custom.conf.WebSocketsHandler.environment.HASHID_SALT": AWS provider credentials not found. Learn how to set up AWS provider credentials in our docs here: ., - Cannot resolve variable at "custom.conf.SendEmail.environment.WEB_APP_URL": AWS provider credentials not found. Learn how to set up AWS provider credentials in our docs here: ., - Cannot resolve variable at "custom.conf.SynchronizeContentfulContent.environment.CONTENTFUL_ACCESS_TOKEN": AWS provider credentials not found. Learn how to set up AWS provider credentials in our docs here: ., - Cannot resolve variable at "custom.conf.SynchronizeContentfulContent.environment.CONTENTFUL_ENVIRONMENT": AWS provider credentials not found. Learn how to set up AWS provider credentials in our docs here: ., - Cannot resolve variable at "custom.conf.WebSocketsHandler.environment.JWT_SECRET": AWS provider credentials not found. Learn how to set up AWS provider credentials in our docs here: . stdout: ELIFECYCLE Command failed with exit code 1. child process exited with code 1 To get the workers to run (albeit with bad configuration) I had to do the exact change you reference in the comment, as it seems like node_modules are affected somehow otherwise: diff --git a/packages/workers/Dockerfile b/packages/workers/Dockerfile
index b56b52a..2c7f573 100644
--- a/packages/workers/Dockerfile
+++ b/packages/workers/Dockerfile
@@ -39,12 +39,12 @@ COPY $SRC_CORE_PATH/package.json $DEST_CORE_PATH/
COPY $SRC_WORKERS_PATH/package.json $DEST_WORKERS_PATH/
COPY tsconfig* $APP_PATH/
COPY $SRC_CLI_PATH $DEST_CLI_PATH/
-RUN pnpm install --include-workspace-root --frozen-lockfile --filter=workers... --filter=cli...
COPY nx.json tsconfig* jest* babel* .eslintrc* .prettier* .eslintrc* $APP_PATH/
COPY $SRC_CORE_PATH $DEST_CORE_PATH/
COPY $SRC_WORKERS_PATH $DEST_WORKERS_PATH/
RUN chmod +x $DEST_WORKERS_PATH/scripts/*.sh
+RUN pnpm install --include-workspace-root --frozen-lockfile --filter=workers... --filter=cli...
ENV PYTHONPATH=/pkgs/__pypackages__/3.11/lib \
PATH=$PATH:/pkgs/__pypackages__/3.11/bin It seems like @pziemkowski gave some solutions in discord to fix the wrong configuration inside the workers: https://discord.com/channels/1122849885335597088/1125769784018087967/1156618189862608928 I'll leave this to the experts, right now deploying is not my priority. Apologies. |
…cher instance built from Dockerfile with image from Docker Hub
…cher instance built from Dockerfile with image from Docker Hub
@andrewrice @gabrii Please check the PR with the fix. It will be included in the next release |
@mkleszcz I've integrated the changes in your PR and it resolves the build/startup issues with the mailcatcher container (thank you!), but there it still seems to be an issue in the worker's container that @gabrii highlighted when attempting to send an email from the backend: Here's an excerpt from 2024-02-12 13:02:58 > nx run workers:serve
2024-02-12 13:02:58
2024-02-12 13:02:59 Local trigger server listening at http://0.0.0.0:3005
2024-02-12 13:03:13 stdout:
2024-02-12 13:03:13 > workers@2.4.2 sls /app/packages/workers
2024-02-12 13:03:13 > sls "invoke" "local" "-f" "SynchronizeContentfulContent" "-d" "{\"source\":\"backend.contentfulSync\",\"detail-type\":\"complete\",\"detail\":{\"id\":\"c6b09ef97bae46adb6a795ea3367924a\",\"type\":\"complete\"}}"
2024-02-12 13:03:13 stderr: node:internal/modules/cjs/loader:1080
2024-02-12 13:03:13 throw err;
2024-02-12 13:03:13 ^
2024-02-12 13:03:13 Error: Cannot find module '/app/packages/workers/node_modules/serverless/bin/serverless.js'
2024-02-12 13:03:13 at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
2024-02-12 13:03:13 at Module._load (node:internal/modules/cjs/loader:922:27)
2024-02-12 13:03:13 at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
2024-02-12 13:03:13 at node:internal/main/run_main_module:23:47 {
2024-02-12 13:03:13 code: 'MODULE_NOT_FOUND',
2024-02-12 13:03:13 requireStack: []
2024-02-12 13:03:13 }
2024-02-12 13:03:13 Node.js v18.17.1
2024-02-12 13:03:13 stdout: ELIFECYCLE Command failed with exit code 1.
2024-02-12 13:03:13 child process exited with code 1
2024-02-12 13:30:05 stdout:
2024-02-12 13:30:05 > workers@2.4.2 sls /app/packages/workers
2024-02-12 13:30:05 > sls "invoke" "local" "-f" "SendEmail" "-d" "{\"source\":\"backend.email\",\"detail-type\":\"ACCOUNT_ACTIVATION\",\"detail\":{\"id\":\"6c7f5d65bda0437da211dc4a348730b6\",\"type\":\"ACCOUNT_ACTIVATION\",\"to\":\"test@example.com\",\"user_id\":\"OVwJAm8\",\"token\":\"c2are4-5570785471b3b919ba9e6aa72d0ce915\"}}"
2024-02-12 13:30:05 stderr: node:internal/modules/cjs/loader:1080
2024-02-12 13:30:05 throw err;
2024-02-12 13:30:05 ^
2024-02-12 13:30:05 Error: Cannot find module '/app/packages/workers/node_modules/serverless/bin/serverless.js'
2024-02-12 13:30:05 at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
2024-02-12 13:30:05 at Module._load (node:internal/modules/cjs/loader:922:27)
2024-02-12 13:30:05 at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
2024-02-12 13:30:05 at node:internal/main/run_main_module:23:47 {
2024-02-12 13:30:05 code: 'MODULE_NOT_FOUND',
2024-02-12 13:30:05 requireStack: []
2024-02-12 13:30:05 }
2024-02-12 13:30:05 Node.js v18.17.1
2024-02-12 13:30:05 stdout: ELIFECYCLE Command failed with exit code 1.
2024-02-12 13:30:05 child process exited with code 1
2024-02-12 13:30:30 stdout:
2024-02-12 13:30:30 > workers@2.4.2 sls /app/packages/workers
2024-02-12 13:30:30 > sls "invoke" "local" "-f" "SendEmail" "-d" "{\"source\":\"backend.email\",\"detail-type\":\"PASSWORD_RESET\",\"detail\":{\"id\":\"2ca0c55002ac4c2aa6ca10b83174aff1\",\"type\":\"PASSWORD_RESET\",\"to\":\"test@example.com\",\"user_id\":\"OVwJAm8\",\"token\":\"c2areu-bead185dfdb85583ed35d171bd3bf2a3\"}}" It seems like the worker container is unable to locate the serverless module. Maybe something is still caching on my end? Not sure if this helpful, but this is what the It's almost like the symlink between Very much appreciate you! |
@andrewrice please check #484 for the fixes for above issues ;) |
Thanks @mkleszcz -- I'll give a shot tomorrow afternoon and will report back! |
Describe the bug
Mailcatcher dockerfile build appears to fail due to a dependency error when running
pnpm saas up
on fresh project. See full logs below.Steps to reproduce
pnpm create saas-boilerplate .
pnpm saas up
System Info
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: