Chatwoot Github Deploy error

lucasoxenfordHOBBY

22 days ago

I'm trying to deploy this chatwoot that has integrated Baileys, which is an alternative API to Twilo and WhatsApp's Cloud API, but when I try to build it, I get this error.

I tried some changes and used gemini pro to try to solve the problem but without success.

Caused by:

Errno::ENOENT: No such file or directory @ rb_sysopen - /app/log/development.log (Errno::ENOENT)

✕ [stage-0 17/24] RUN bundle exec rake assets:precompile

process "/bin/bash -ol pipefail -c bundle exec rake assets:precompile" did not complete successfully: exit code: 1

Dockerfile:38

-------------------

36 | # build phase

37 | COPY . /app/.

38 | >>> RUN bundle exec rake assets:precompile

39 | RUN bundle exec bootsnap precompile app/lib/

40 |

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c bundle exec rake assets:precompile" did not complete successfully: exit code: 1

Error: Docker build failed

https://github.com/lucasoxenford/chatwootfazerai

$10 Bounty

1 Replies

21 days ago

The build is failing because you are trying to write to /app/log/development.log, but that file (or even the /app/log directory) doesn’t exist yet in your Docker image. When you build from scratch, Docker doesn’t create empty folders unless you tell it to.

To fix this, just add a line to your Dockerfile before the bundle exec rake assets:precompile step that creates the log directory. So, right before you precompile assets, add: RUN mkdir -p /app/log

This makes sure the log directory is there, so Rails won’t crash when it tries to write logs during the build. After you add that, rebuild your image and it should get past this error.

An easier alternative, if you haven't implemented already, is to use the Railway Chatwoot template updated for the latest version (V4) and then manually add the Bailey's integration later: https://railway.com/new/template/chatwoot?teamId=05a499c8-74f9-4a9f-b4a1-8e5779e4ca20

On a personal note, I recommend you ditch the unofficial solutions. Learn the Cloud API, it's getting easier and easier. Disclaimer: I'm a Meta Business Partner. It's worth it.