Hello, I know this most probably has nothing to do with Render, but I thought I’d post to try and find some help. Results on Google all seem to relate to situations other than mine.
I’ve deployed a simple PHP site with Docker Free, and after deploy, I see the logs with these messages, every 5 seconds:
closed without sending a request; it was probably just an unused speculative preconnection
I can’t seem to imagine what could be causing this. The only thing the PHP site does is display HTML, and a mailform.
I’ve dug this to be around here in the PHP source:
https://github.com/php/php-src/blob/master/sapi/cli/php_cli_server.c : line 2602
Here’s what I’m using in my Dockerfile:
FROM php
RUN apt-get update && apt-get install -y zip git
# Latest release
COPY --from=composer/composer:latest-bin /composer /usr/bin/composer
# Specific release
COPY --from=composer/composer:2-bin /composer /usr/bin/composer
COPY composer.json ./
RUN composer require sendgrid/sendgrid
RUN composer require sendgrid/php-http-client
RUN composer install
COPY . ./
EXPOSE 80
CMD ["php", "-S", "0.0.0.0:80"]
Would appreciate any ideas you might have on what could possibly be causing this. This really makes the logs unsearcheable, so any pointers or advice would be greatly appreciated.
Services running on Render need to be able to respond to HTTP traffic. One thing that jumps out is your Docker image is php, can you confirm that includes a web server?
Hello, Matt. Thank you for your reply, it’s really appreciated.
I quickly tried it in a different way after reading the link you sent me, and it looks much better. At least logs seems stable now, in a way I can actually read them.
Do you mean I was loading the whole thing, client, server, all modules? If so, no wonder it was complaining. Here’s the new version:
FROM php:7.2-apache
COPY . /var/www/html/
RUN apt-get update && apt-get install -y zip git
# Latest release
COPY --from=composer/composer:latest-bin /composer /usr/bin/composer
# Specific release
COPY --from=composer/composer:2-bin /composer /usr/bin/composer
COPY composer.json /var/www/html/
RUN composer require sendgrid/sendgrid
RUN composer require sendgrid/php-http-client
RUN composer install
EXPOSE 80
CMD ["php", "-S", "0.0.0.0:80"]
I looked in the page for references to Composer, but couldn’t find any. I need it because of the autoload dependencies.
Looking much better now, do you think this should do it?
php -S is a built in PHP application server. Intended only for development and absolutely not anything resembling production execution.
❯ php -h
[…]
-S <addr>:<port> Run with built-in web server.
It also enables immensely verbose logging, exactly as you asked about here. You should front the application with a webserver like Apache HTTPd, or nginx, or LigHTTPd, etc. There’s no changes in your two Dockerfile contents here that should result in a change of execution nor log verbosity.
Well, presumably not, but in practice I’ve seen all the “extra” logging going away, and now I’m left with what I’d consider “regular” logging, seeing messages for GET requests to resources on page accesses, and nothing more. I can’t say it looks perfect because I have a PHP function I’m trying to debug, and have not yet tried to make “debugable” changes, currently not seeing any other output that would allow me to say it looks to be really working. But up to this point, completely reasonable to what I’d expect, as I had it before using the Dockerfile.
I’m kind hammering at it, as you can see, so next I’m going to try and remove the server call with the “-S” parameter and see if that’d be the way to go.
Right now I don’t have anything to put on a .dockerignore file, so that may change as I need to get this with Composer running for the Email plugin.
Would you mind if we picked this up in private? I tried looking for a reply to sender option on the notification email but couldn’t find it, so if you could contact me, that’d be awesome. This all may have be caused by the render.yaml file that I mistakenly uploaded a few days ago, I started seeing errors approximately from then on.
Would be happy to continue the discussion if possible, thanks for your help.