i get this error in the logs of my rails api

2023-06-14T16:31:26Z app[32874365ad5e78] lhr [info]ERROR No such file or directory (os error 2)
Although all things seem to work fine on the API level just that error I see in my logs

does anyone knows what it means.

I just started yesterday with Fly.io, and I’ve been seeing the same error for almost every request. I can’t figure out where the error is coming from, and I’m not seeing app related errors associated with it (everything loads fine).

2023-06-14T19:20:40.953 app[6e82d731a7d038] dfw [info] ERROR No such file or directory (os error 2)

Strange! Could you share your fly.toml, Dockerfile?

# fly.toml file generated for carviva-wallet on 2022-11-09T12:32:44+01:00

app = "carviva-wallet"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[build]
  [build.args]
    SERVER_COMMAND = "bin/rails fly:server"

[deploy]
  release_command = "bin/rails fly:release"

[env]
  PORT = "8080"



[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

[[statics]]
  guest_path = "/app/public"
  url_prefix = "/"

# syntax = docker/dockerfile:experimental

# Dockerfile used to build a deployable image for a Rails application.
# Adjust as required.
#
# Common adjustments you may need to make over time:
#  * Modify version numbers for Ruby, Bundler, and other products.
#  * Add library packages needed at build time for your gems, node modules.
#  * Add deployment packages needed by your application
#  * Add (often fake) secrets needed to compile your assets

#######################################################################

# Learn more about the chosen Ruby stack, Fullstaq Ruby, here:
#   https://github.com/evilmartians/fullstaq-ruby-docker.
#
# We recommend using the highest patch level for better security and
# performance.

ARG RUBY_VERSION=3.1.2
ARG VARIANT=jemalloc-bullseye-slim
FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-${VARIANT} as base

LABEL fly_launch_runtime="rails"

ARG BUNDLER_VERSION=2.3.18

ARG RAILS_ENV=production
ENV RAILS_ENV=${RAILS_ENV}

ENV RAILS_SERVE_STATIC_FILES true
ENV RAILS_LOG_TO_STDOUT true

ARG BUNDLE_WITHOUT=development:test
ARG BUNDLE_PATH=vendor/bundle
ENV BUNDLE_PATH ${BUNDLE_PATH}
ENV BUNDLE_WITHOUT ${BUNDLE_WITHOUT}

RUN mkdir /app
WORKDIR /app
RUN mkdir -p tmp/pids

RUN gem update --system --no-document && \
    gem install -N bundler -v ${BUNDLER_VERSION}

#######################################################################

# install packages only needed at build time

FROM base as build_deps

ARG BUILD_PACKAGES="git build-essential libpq-dev wget vim curl gzip xz-utils libsqlite3-dev"
ENV BUILD_PACKAGES ${BUILD_PACKAGES}

RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt \
    --mount=type=cache,id=dev-apt-lib,sharing=locked,target=/var/lib/apt \
    apt-get update -qq && \
    apt-get install --no-install-recommends -y ${BUILD_PACKAGES} \
    && rm -rf /var/lib/apt/lists /var/cache/apt/archives

#######################################################################

# install gems

FROM build_deps as gems

COPY Gemfile* ./
RUN bundle install &&  rm -rf vendor/bundle/ruby/*/cache

#######################################################################

# install deployment packages

FROM base

ARG DEPLOY_PACKAGES="postgresql-client file vim curl gzip libsqlite3-0"
ENV DEPLOY_PACKAGES=${DEPLOY_PACKAGES}

RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt \
    --mount=type=cache,id=prod-apt-lib,sharing=locked,target=/var/lib/apt \
    apt-get update -qq && \
    apt-get install --no-install-recommends -y \
    ${DEPLOY_PACKAGES} \
    && rm -rf /var/lib/apt/lists /var/cache/apt/archives

# copy installed gems
COPY --from=gems /app /app
COPY --from=gems /usr/lib/fullstaq-ruby/versions /usr/lib/fullstaq-ruby/versions
COPY --from=gems /usr/local/bundle /usr/local/bundle

#######################################################################

# Deploy your application
COPY . .

# Adjust binstubs to run on Linux and set current working directory
RUN chmod +x /app/bin/* && \
    sed -i 's/ruby.exe\r*/ruby/' /app/bin/* && \
    sed -i '/^#!/aDir.chdir File.expand_path("..", __dir__)' /app/bin/*

# The following enable assets to precompile on the build server.  Adjust
# as necessary.  If no combination works for you, see:
# https://fly.io/docs/rails/getting-started/existing/#access-to-environment-variables-at-build-time
ENV SECRET_KEY_BASE 1
# ENV AWS_ACCESS_KEY_ID=1
# ENV AWS_SECRET_ACCESS_KEY=1

# Run build task defined in lib/tasks/fly.rake
#ARG BUILD_COMMAND="bin/rails fly:build"
#RUN ${BUILD_COMMAND}

# Default server start instructions.  Generally Overridden by fly.toml.
ENV PORT 8080
ARG SERVER_COMMAND="bin/rails fly:server"
ENV SERVER_COMMAND ${SERVER_COMMAND}
CMD ${SERVER_COMMAND}

I am also seeing this issue, following.

Hey I too recently deployed a rails app, it too has this issue.

tldr; the error is the app fails to open temp files

I investigated further,
I’m getting the error just before when I’m trying to access specific route

Like I have noticed this happed multiple times

2023-06-16T13:03:40Z app[<useful-id>] atl [info]ERROR No such file or directory (os error 2)
2023-06-16T13:03:40Z app[<useful-id>] atl [info]I, [2023-06-16T13:03:40.735309 #521]  INFO -- : [86fb280c-08dc-4116-a11c-1120e2095593] Started GET "/route" for <useful-ip>at 2023-06-16 13:03:40 +0000

So I tried to run the app in local and observe the logs
here are the logs that are generated when I try visiting the same route

xdg-open /home/user/app-name/tmp/tmpfile
...<Irrelavent conetens of file>

Started GET "/route" for 127.0.0.1 at 2023-06-16 18:45:25 +0530

and you can google xdg-open is for opening files

so I think its unable to open some temporary files and hence giving the error.
As we can understand most of the functionality does not require /tmp files
which explains why app is running fine
But we get an error while trying to open some non-existent tmp files
which seems the issue as you can google (os error 2) is raised when there is No such file or directory is found.

what do you guys say.

Hope this helps, peace

I am having the same issue. I get the same error and it also seems to be related to local files. I am also unable to upload to the media directory. Using Django.

I’ve got the same error message in my Rails app as well but I don’t have any file operations - at least not directly.

I’m using TurboStreams so maybe inside the Rails framework code there might be something messing with temp files?

I’ve noticed sometimes my front end doesn’t get the broadcasted TurboStream message from the backend - but this might be a red herring and unrelated. I’m not sure how to diagnose.

@hebron Can I see log if thats ok?

Hey @zip
As far as I understand file system resets after restart,
If you want to store data on file system, You might need to check Volumes · Fly Docs

If you think I understood you wrong, Please give more info so that I can understand better.

1 Like

Thanks @darkcheftar007, I did figure that out eventually. Media is now uploading correctly. My only problem now is Django. :sweat_smile:

1 Like

Sure, not sure how useful it is though tbh.


2023-06-26T20:42:51Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:42:51.186325 #239]  INFO -- : [a2fb8611-a8af-45f6-948e-2483aff6e80c] Started GET "/" for 66.241.125.119 at 2023-06-26 20:42:51 +0000
2023-06-26T20:42:51Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:42:51.186869 #239]  INFO -- : [a2fb8611-a8af-45f6-948e-2483aff6e80c] Processing by HomeController#index as HTML
2023-06-26T20:42:51Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:42:51.260575 #239]  INFO -- : [a2fb8611-a8af-45f6-948e-2483aff6e80c]   Rendered home/index.slim within layouts/application (Duration: 0.1ms | Allocations: 29)
2023-06-26T20:42:51Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:42:51.261595 #239]  INFO -- : [a2fb8611-a8af-45f6-948e-2483aff6e80c]   Rendered layout layouts/application.slim (Duration: 0.9ms | Allocations: 429)
2023-06-26T20:42:51Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:42:51.261803 #239]  INFO -- : [a2fb8611-a8af-45f6-948e-2483aff6e80c] Completed 200 OK in 75ms (Views: 1.6ms | Allocations: 159578)
2023-06-26T20:42:52Z app[e2865502cdde86] atl [info]ERROR No such file or directory (os error 2)
2023-06-26T20:42:52Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:42:52.383886 #239]  INFO -- : [d628d528-c4f9-4ffb-9128-6f0159f45f93] Started GET "/new" for 66.241.125.119 at 2023-06-26 20:42:52 +0000
2023-06-26T20:42:52Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:42:52.384488 #239]  INFO -- : [d628d528-c4f9-4ffb-9128-6f0159f45f93] Processing by HomeController#new as HTML
2023-06-26T20:42:52Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:42:52.385301 #239]  INFO -- : [d628d528-c4f9-4ffb-9128-6f0159f45f93]   Rendered home/new.slim within layouts/application (Duration: 0.4ms | Allocations: 215)
2023-06-26T20:42:52Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:42:52.385727 #239]  INFO -- : [d628d528-c4f9-4ffb-9128-6f0159f45f93]   Rendered layout layouts/application.slim (Duration: 0.8ms | Allocations: 542)
2023-06-26T20:42:52Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:42:52.385848 #239]  INFO -- : [d628d528-c4f9-4ffb-9128-6f0159f45f93] Completed 200 OK in 1ms (Views: 1.1ms | Allocations: 736)
2023-06-26T20:43:00Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:00.777225 #239]  INFO -- : [2a4dbdaf-1230-40aa-97e2-c32f0acf9d83] Started POST "/create_challenge" for 66.241.125.119 at 2023-06-26 20:43:00 +0000
2023-06-26T20:43:00Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:00.777821 #239]  INFO -- : [2a4dbdaf-1230-40aa-97e2-c32f0acf9d83] Processing by HomeController#create_challenge as TURBO_STREAM
2023-06-26T20:43:00Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:00.777847 #239]  INFO -- : [2a4dbdaf-1230-40aa-97e2-c32f0acf9d83]   Parameters: {"user_name_input"=>"Talking a break from work", "difficulty_level"=>"very_hard"}
2023-06-26T20:43:00Z app[e2865502cdde86] atl [info]Talking A Break From Work has created a challenge (match: ad8c7105-5411-45b5-890b-00cb4ba2be48)
2023-06-26T20:43:00Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:00.992666 #239]  INFO -- : [2a4dbdaf-1230-40aa-97e2-c32f0acf9d83] Completed 200 OK in 215ms (Views: 0.1ms | ActiveRecord: 16.7ms | Allocations: 419284)
2023-06-26T20:43:01Z app[e2865502cdde86] atl [info]ERROR No such file or directory (os error 2)
2023-06-26T20:43:01Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:01.180151 #239]  INFO -- : [9f0a744a-212d-4c79-a186-7a08d05622e7] Started GET "/cable" for 66.241.125.119 at 2023-06-26 20:43:01 +0000
2023-06-26T20:43:01Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:01.180551 #239]  INFO -- : [9f0a744a-212d-4c79-a186-7a08d05622e7] Started GET "/cable" [WebSocket] for 66.241.125.119 at 2023-06-26 20:43:01 +0000
2023-06-26T20:43:01Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:01.180641 #239]  INFO -- : [9f0a744a-212d-4c79-a186-7a08d05622e7] Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
2023-06-26T20:43:08Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:08.373649 #239]  INFO -- : Finished "/cable" [WebSocket] for 66.241.125.119 at 2023-06-26 20:43:08 +0000
2023-06-26T20:43:08Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:08.373926 #239]  INFO -- : Turbo::StreamsChannel stopped streaming from ad8c7105-5411-45b5-890b-00cb4ba2be48
2023-06-26T20:43:15Z app[e2865502cdde86] atl [info]ERROR No such file or directory (os error 2)
2023-06-26T20:43:15Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:15.121614 #239]  INFO -- : [e00793ee-d093-44da-83c1-34599d335e7a] Started GET "/join_match/ad8c7105-5411-45b5-890b-00cb4ba2be48" for 66.241.125.119 at 2023-06-26 20:43:15 +0000
2023-06-26T20:43:15Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:15.122392 #239]  INFO -- : [e00793ee-d093-44da-83c1-34599d335e7a] Processing by HomeController#join_match as HTML
2023-06-26T20:43:15Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:15.122490 #239]  INFO -- : [e00793ee-d093-44da-83c1-34599d335e7a]   Parameters: {"match_key"=>"[FILTERED]"}
2023-06-26T20:43:15Z app[e2865502cdde86] atl [info]Player 2 looking to join very_hard match(ad8c7105-5411-45b5-890b-00cb4ba2be48) against Talking A Break From Work
2023-06-26T20:43:15Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:15.126954 #239]  INFO -- : [e00793ee-d093-44da-83c1-34599d335e7a]   Rendered home/new.slim within layouts/application (Duration: 0.5ms | Allocations: 240)
2023-06-26T20:43:15Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:15.127564 #239]  INFO -- : [e00793ee-d093-44da-83c1-34599d335e7a]   Rendered layout layouts/application.slim (Duration: 1.2ms | Allocations: 568)
2023-06-26T20:43:15Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:15.127803 #239]  INFO -- : [e00793ee-d093-44da-83c1-34599d335e7a] Completed 200 OK in 5ms (Views: 1.6ms | ActiveRecord: 1.3ms | Allocations: 965)
2023-06-26T20:43:18Z app[e2865502cdde86] atl [info]ERROR No such file or directory (os error 2)
2023-06-26T20:43:18Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:18.713805 #239]  INFO -- : [4d20e4e8-33da-41e7-b485-4ae378ddd39d] Started GET "/cable" for 66.241.125.119 at 2023-06-26 20:43:18 +0000
2023-06-26T20:43:18Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:18.714182 #239]  INFO -- : [4d20e4e8-33da-41e7-b485-4ae378ddd39d] Started GET "/cable" [WebSocket] for 66.241.125.119 at 2023-06-26 20:43:18 +0000
2023-06-26T20:43:18Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:43:18.714216 #239]  INFO -- : [4d20e4e8-33da-41e7-b485-4ae378ddd39d] Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
2023-06-26T20:45:11Z app[e2865502cdde86] atl [info]ERROR No such file or directory (os error 2)
2023-06-26T20:45:11Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:11.596883 #239]  INFO -- : [43cc35c2-b736-47fd-8391-c078181cfdc9] Started GET "/join_match/ad8c7105-5411-45b5-890b-00cb4ba2be48" for 66.241.125.119 at 2023-06-26 20:45:11 +0000
2023-06-26T20:45:11Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:11.597585 #239]  INFO -- : [43cc35c2-b736-47fd-8391-c078181cfdc9] Processing by HomeController#join_match as HTML
2023-06-26T20:45:11Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:11.597620 #239]  INFO -- : [43cc35c2-b736-47fd-8391-c078181cfdc9]   Parameters: {"match_key"=>"[FILTERED]"}
2023-06-26T20:45:11Z app[e2865502cdde86] atl [info]Player 2 looking to join very_hard match(ad8c7105-5411-45b5-890b-00cb4ba2be48) against Talking A Break From Work
2023-06-26T20:45:11Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:11.600225 #239]  INFO -- : [43cc35c2-b736-47fd-8391-c078181cfdc9]   Rendered home/new.slim within layouts/application (Duration: 0.4ms | Allocations: 240)
2023-06-26T20:45:11Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:11.600743 #239]  INFO -- : [43cc35c2-b736-47fd-8391-c078181cfdc9]   Rendered layout layouts/application.slim (Duration: 1.0ms | Allocations: 568)
2023-06-26T20:45:11Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:11.600950 #239]  INFO -- : [43cc35c2-b736-47fd-8391-c078181cfdc9] Completed 200 OK in 3ms (Views: 1.3ms | ActiveRecord: 0.6ms | Allocations: 869)
2023-06-26T20:45:11Z app[e2865502cdde86] atl [info]ERROR No such file or directory (os error 2)
2023-06-26T20:45:11Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:11.906873 #239]  INFO -- : [9868740d-be51-4b3e-bee3-ac320f1ff56f] Started GET "/cable" for 66.241.125.119 at 2023-06-26 20:45:11 +0000
2023-06-26T20:45:11Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:11.907201 #239]  INFO -- : [9868740d-be51-4b3e-bee3-ac320f1ff56f] Started GET "/cable" [WebSocket] for 66.241.125.119 at 2023-06-26 20:45:11 +0000
2023-06-26T20:45:11Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:11.907232 #239]  INFO -- : [9868740d-be51-4b3e-bee3-ac320f1ff56f] Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
2023-06-26T20:45:11Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:11.951947 #239]  INFO -- : Turbo::StreamsChannel is streaming from ad8c7105-5411-45b5-890b-00cb4ba2be48
2023-06-26T20:45:15Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:15.846077 #239]  INFO -- : [6e18bf50-a23e-49f2-9819-ff66fef06dc5] Started POST "/accept_challenge" for 66.241.125.119 at 2023-06-26 20:45:15 +0000
2023-06-26T20:45:15Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:15.846765 #239]  INFO -- : [6e18bf50-a23e-49f2-9819-ff66fef06dc5] Processing by HomeController#accept_challenge as TURBO_STREAM
2023-06-26T20:45:15Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:15.846795 #239]  INFO -- : [6e18bf50-a23e-49f2-9819-ff66fef06dc5]   Parameters: {"user_name_input"=>"Cooking", "match_key"=>"[FILTERED]"}
2023-06-26T20:45:15Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:15.857112 #239]  INFO -- : [6e18bf50-a23e-49f2-9819-ff66fef06dc5]   Rendered home/_game.slim (Duration: 0.5ms | Allocations: 777)
2023-06-26T20:45:15Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:15.857777 #239]  INFO -- : [6e18bf50-a23e-49f2-9819-ff66fef06dc5]   Rendered home/_game.slim (Duration: 0.4ms | Allocations: 777)
2023-06-26T20:45:15Z app[e2865502cdde86] atl [info]Player 2 (Cooking) accepting challenge for match(ad8c7105-5411-45b5-890b-00cb4ba2be48) against Player 1 (Talking A Break From Work)
2023-06-26T20:45:20Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:20.983669 #239]  INFO -- : [6e18bf50-a23e-49f2-9819-ff66fef06dc5] No template found for HomeController#accept_challenge, rendering head :no_content
2023-06-26T20:45:20Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:20.983972 #239]  INFO -- : [6e18bf50-a23e-49f2-9819-ff66fef06dc5] Completed 204 No Content in 5137ms (ActiveRecord: 6.6ms | Allocations: 9661)
2023-06-26T20:45:22Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:22.600258 #239]  INFO -- : [6293c8cf-f660-4da7-89db-1487e639a5a9] Started POST "/accept_challenge" for 66.241.125.119 at 2023-06-26 20:45:22 +0000
2023-06-26T20:45:22Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:22.600875 #239]  INFO -- : [6293c8cf-f660-4da7-89db-1487e639a5a9] Processing by HomeController#accept_challenge as TURBO_STREAM
2023-06-26T20:45:22Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:22.600899 #239]  INFO -- : [6293c8cf-f660-4da7-89db-1487e639a5a9]   Parameters: {"user_name_input"=>"Cooking", "match_key"=>"[FILTERED]"}
2023-06-26T20:45:22Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:22.608608 #239]  INFO -- : [6293c8cf-f660-4da7-89db-1487e639a5a9]   Rendered home/_game.slim (Duration: 0.7ms | Allocations: 777)
2023-06-26T20:45:22Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:22.609597 #239]  INFO -- : [6293c8cf-f660-4da7-89db-1487e639a5a9]   Rendered home/_game.slim (Duration: 0.6ms | Allocations: 777)
2023-06-26T20:45:22Z app[e2865502cdde86] atl [info]Player 2 (Cooking) accepting challenge for match(ad8c7105-5411-45b5-890b-00cb4ba2be48) against Player 1 (Talking A Break From Work)
2023-06-26T20:45:22Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:22.654880 #239]  INFO -- : [6293c8cf-f660-4da7-89db-1487e639a5a9] No template found for HomeController#accept_challenge, rendering head :no_content
# ^ This is where my TurboStream broadcast is supposed to go out but doesn't.




2023-06-26T20:45:22Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:22.655203 #239]  INFO -- : [6293c8cf-f660-4da7-89db-1487e639a5a9] Completed 204 No Content in 54ms (ActiveRecord: 5.2ms | Allocations: 7756)
2023-06-26T20:45:27Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:27.829698 #239]  INFO -- : Finished "/cable" [WebSocket] for 66.241.125.119 at 2023-06-26 20:45:27 +0000
2023-06-26T20:45:27Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:27.829885 #239]  INFO -- : Turbo::StreamsChannel stopped streaming from ad8c7105-5411-45b5-890b-00cb4ba2be48
2023-06-26T20:45:32Z app[e2865502cdde86] atl [info]ERROR No such file or directory (os error 2)
2023-06-26T20:45:32Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:32.805084 #239]  INFO -- : [ef926a61-abb8-4544-8940-d6155e6b721b] Started GET "/cable" for 66.241.125.119 at 2023-06-26 20:45:32 +0000
2023-06-26T20:45:32Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:32.805426 #239]  INFO -- : [ef926a61-abb8-4544-8940-d6155e6b721b] Started GET "/cable" [WebSocket] for 66.241.125.119 at 2023-06-26 20:45:32 +0000
2023-06-26T20:45:32Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:32.805456 #239]  INFO -- : [ef926a61-abb8-4544-8940-d6155e6b721b] Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
2023-06-26T20:45:32Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:32.855190 #239]  INFO -- : Turbo::StreamsChannel is streaming from ad8c7105-5411-45b5-890b-00cb4ba2be48
2023-06-26T20:45:34Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:34.786381 #239]  INFO -- : Finished "/cable" [WebSocket] for 66.241.125.119 at 2023-06-26 20:45:34 +0000
2023-06-26T20:45:34Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:34.786599 #239]  INFO -- : Turbo::StreamsChannel stopped streaming from ad8c7105-5411-45b5-890b-00cb4ba2be48
2023-06-26T20:45:39Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:39.978248 #239]  INFO -- : [77bd8f59-18d1-4a46-b47d-012ce843ebc6] Started POST "/accept_challenge" for 66.241.125.119 at 2023-06-26 20:45:39 +0000
2023-06-26T20:45:39Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:39.978900 #239]  INFO -- : [77bd8f59-18d1-4a46-b47d-012ce843ebc6] Processing by HomeController#accept_challenge as TURBO_STREAM
2023-06-26T20:45:39Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:39.978931 #239]  INFO -- : [77bd8f59-18d1-4a46-b47d-012ce843ebc6]   Parameters: {"user_name_input"=>"Cooking", "match_key"=>"[FILTERED]"}
2023-06-26T20:45:39Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:39.986181 #239]  INFO -- : [77bd8f59-18d1-4a46-b47d-012ce843ebc6]   Rendered home/_game.slim (Duration: 0.4ms | Allocations: 777)
2023-06-26T20:45:39Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:39.986810 #239]  INFO -- : [77bd8f59-18d1-4a46-b47d-012ce843ebc6]   Rendered home/_game.slim (Duration: 0.4ms | Allocations: 777)
2023-06-26T20:45:39Z app[e2865502cdde86] atl [info]Player 2 (Cooking) accepting challenge for match(ad8c7105-5411-45b5-890b-00cb4ba2be48) against Player 1 (Talking A Break From Work)
2023-06-26T20:45:40Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:40.030189 #239]  INFO -- : [77bd8f59-18d1-4a46-b47d-012ce843ebc6] No template found for HomeController#accept_challenge, rendering head :no_content
2023-06-26T20:45:40Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:40.030477 #239]  INFO -- : [77bd8f59-18d1-4a46-b47d-012ce843ebc6] Completed 204 No Content in 51ms (ActiveRecord: 4.8ms | Allocations: 7773)
2023-06-26T20:45:45Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:45.836919 #239]  INFO -- : Finished "/cable" [WebSocket] for 66.241.125.119 at 2023-06-26 20:45:45 +0000
2023-06-26T20:45:45Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:45.837077 #239]  INFO -- : Turbo::StreamsChannel stopped streaming from ad8c7105-5411-45b5-890b-00cb4ba2be48
2023-06-26T20:45:46Z app[e2865502cdde86] atl [info]ERROR No such file or directory (os error 2)
2023-06-26T20:45:46Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:46.214145 #239]  INFO -- : [ed6520aa-55b8-445c-8049-86a6cb833356] Started GET "/cable" for 66.241.125.119 at 2023-06-26 20:45:46 +0000
2023-06-26T20:45:46Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:46.214562 #239]  INFO -- : [ed6520aa-55b8-445c-8049-86a6cb833356] Started GET "/cable" [WebSocket] for 66.241.125.119 at 2023-06-26 20:45:46 +0000
2023-06-26T20:45:46Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:45:46.214607 #239]  INFO -- : [ed6520aa-55b8-445c-8049-86a6cb833356] Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
2023-06-26T20:46:12Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:46:12.436948 #239]  INFO -- : Finished "/cable" [WebSocket] for 66.241.125.119 at 2023-06-26 20:46:12 +0000
2023-06-26T20:46:12Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:46:12.437412 #239]  INFO -- : Turbo::StreamsChannel stopped streaming from ad8c7105-5411-45b5-890b-00cb4ba2be48
2023-06-26T20:46:55Z app[e2865502cdde86] atl [info]ERROR No such file or directory (os error 2)
2023-06-26T20:46:55Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:46:55.708390 #239]  INFO -- : [81a9c6f9-7115-46cd-9cd3-19814df20cba] Started GET "/cable" for 66.241.125.119 at 2023-06-26 20:46:55 +0000
2023-06-26T20:46:55Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:46:55.708755 #239]  INFO -- : [81a9c6f9-7115-46cd-9cd3-19814df20cba] Started GET "/cable" [WebSocket] for 66.241.125.119 at 2023-06-26 20:46:55 +0000
2023-06-26T20:46:55Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:46:55.708788 #239]  INFO -- : [81a9c6f9-7115-46cd-9cd3-19814df20cba] Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
2023-06-26T20:46:57Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:46:57.384079 #239]  INFO -- : Finished "/cable" [WebSocket] for 66.241.125.119 at 2023-06-26 20:46:57 +0000
2023-06-26T20:46:57Z app[e2865502cdde86] atl [info]I, [2023-06-26T20:46:57.384314 #239]  INFO -- : Turbo::StreamsChannel stopped streaming from ad8c7105-5411-45b5-890b-00cb4ba2be48
1 Like

Hey @hebron,

I generally checked the turbostreams, they do have some with caching which writes to temp files.
I guess thats why error.

What do you say?

Can you also post logs of the app in your local machine if thats possible?

@darkcheftar007 thanks for the info here. I am just wondering what you mean by:

So I tried to run the app in local and observe the logs

Do you mean there is some way to run a fly image on my local dev box? Presumably with docker or something? If that’s what you mean, is this page going to help me? Dockerfiles and fly.toml · Fly Docs

In terms of the temp files problem which I also am experiencing, I am using ActiveStorage - although the images seem to be showing OK on the browser. So, it may not be relevant.

Do you know if there is any way to switch off these error messages? As far as I am aware, they are new. I don’t think I was getting them when I first created the (free) VM. Also, as far as I am aware, fly allows writes to the file system to create temp files (although they will be wiped on server restart) so I’m not sure why they would not be found.

Hey @charlesdeb ,
Thanks for asking.
Sorry if I was being unclear there,

But what I just did was to compare logs of development and production.
by local I meant development environment nothing complex.

There might be a way, I don’t have enough knowledge right now to accept or deny it

I’m looking into it. will definitely share if I get something that helps

Thanks again @charlesdeb for asking.

I believe I have reproduced this.

If you remove or comment out those lines does the message go away?

1 Like

Hey there! It seems I got same error, I am uploading and parsing temp file and previously it worked, but now I see in logs

ERROR No such file or directory (os error 2)

When I removed

[[statics]]
  guest_path = "/app/public"
  url_prefix = "/"

As suggested below it didn’t help, now I don’t see error in logs but file is absent either.

Adding the following to your dockerfile should fix this:

ENV RAILS_SERVE_STATIC_FILES="true"

To be clear, the message you were seeing is harmless, and is a bug that will be fixed shortly. As an alternative, you can disable having fly.io serve your static files and enable your Rails app to do so.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.