Skip to content
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

localhost not resolving correctly leading to 502 error #441

Closed
silverhikari opened this issue Sep 21, 2024 · 9 comments
Closed

localhost not resolving correctly leading to 502 error #441

silverhikari opened this issue Sep 21, 2024 · 9 comments
Labels
bug Something isn't working question Further information is requested

Comments

@silverhikari
Copy link

silverhikari commented Sep 21, 2024

Describe the bug

Summary: problem with localhost not resolving correctly

Description: running docker compose script, and after doing fixes such as creating /mediawiki, try running the script and review compose logs reports that apache can not servername and defaults to some random ip from 172.20.0.2 to 172.20.0.6. setting ServerName localhost in apache.conf did not work(add via volumes)(caused the used random ip to list a varnish cache error). also tried disabling caddy but that changed nothing.

Steps to reproduce the behavior:

  1. create mediawiki dir and add volumes link ./mediawiki:/mediawiki under web in override
  2. Run docker compose up -d
  3. open webpage to localhost:80
  4. see error 502

Expected behavior

System info

Please complete the following information:

  • MediaWiki version: 1.39.8
  • Canasta version: 2.0.1
@silverhikari silverhikari added bug Something isn't working question Further information is requested labels Sep 21, 2024
@silverhikari
Copy link
Author

silverhikari commented Sep 21, 2024

.env

PORT=80
HTTPS_PORT=443
MYSQL_PASSWORD=mediawiki
MW_SITE_SERVER=https://localhost
MW_SITE_FQDN=localhost
PHP_UPLOAD_MAX_FILESIZE=10M
PHP_POST_MAX_SIZE=10M
PHP_MAX_INPUT_VARS=1000
MW_SITEMAP_SUBDIR=
MW_SITEMAP_IDENTIFIER=mediawiki
USE_EXTERNAL_DB=false

docker-compose.override.yml

# The above version is the Docker Compose manifest's version, not the Canasta Docker Compose stack's version.
#
# --- Canasta Stack for Docker Compose ---
#
# If you need to make changes to the stack, make them here.
# Only edits to docker-compose.override.yml are officially supported by Canasta.
#
# Uncomment the commented services and add lines below them if you would like to make additional customizations to them.
services:
  #db:
  web:
    image: ghcr.io/canastawiki/canasta:2.0.1
    volumes:
        - ./mediawiki:/mediawiki
        # - ./apache2.conf:/etc/apache2/apache2.conf
  #elasticsearch:
  #caddy:
  #varnish:

@jeffw16
Copy link
Member

jeffw16 commented Sep 22, 2024

Why add the MediaWiki volume mapping?

@jeffw16
Copy link
Member

jeffw16 commented Sep 22, 2024

And what happens when you try to get the Apache error log from within the container? You can get it by doing something along the lines of docker compose exec web bash tail /var/log/apache2/error.log

@silverhikari
Copy link
Author

silverhikari commented Sep 22, 2024

Why add the MediaWiki volume mapping?

if i don't when starting it will complain about /mediawiki needing a persistent storage and just get stuck repeating that.

And what happens when you try to get the Apache error log from within the container? You can get it by doing something along the lines of docker compose exec web bash tail /var/log/apache2/error.log

took me a minute to relize i had to do the bash part then run the tail as trying to do it in one line does not seem to work

here is the apache2 log:

Error linking file /var/log/apache2/access_log_20240922 to /var/log/apache2/access_log.current (File exists)
AH00106: piped log program '/usr/bin/rotatelogs -c -f -l -p /rotatelogs-compress.sh -L /var/log/apache2/access_log.current /var/log/apache2/access_log_%Y%m%d 86400' failed unexpectedly
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.6. Set the 'ServerName' directive globally to suppress this message
[Sun Sep 22 04:58:39.216710 2024] [mpm_event:notice] [pid 414:tid 414] AH00489: Apache/2.4.61 (Debian) mod_fcgid/2.3.9 configured -- resuming normal operations
[Sun Sep 22 04:58:39.216816 2024] [core:notice] [pid 414:tid 414] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND'

@silverhikari
Copy link
Author

silverhikari commented Sep 22, 2024

well after reviewing the log after enabling the apache.conf it disables the messages but still sets that random ip address instead of localhost.

though now going to localhost give a err_connection_refused

@yaronkoren
Copy link
Member

@silverhikari - sorry for the delay. What was the exact error message(s) you saw before adding the mediawiki/ volume, and any other fixes you tried?

@silverhikari
Copy link
Author

silverhikari commented Sep 27, 2024

for the medawiki folder issue this is the error "Folder /mediawiki contains important data and must be mounted to persistent storage!". this solution was discussed in issue #436.

@silverhikari
Copy link
Author

silverhikari commented Sep 27, 2024

well tried again with a new compose override and just added the mediawiki folder fix and seems to work now.

in the issue number above i did the advice of disabling caddy and disabling caddy make it not bind the ports. so it seems this was less of issue and more of a me not understanding how the different parts of the cansta wiki stack work

@yaronkoren
Copy link
Member

That's great to hear! Thank you for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants