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

404 Not Found for 127.0.0.1/boincserver #53

Open
joeltio opened this issue Jan 24, 2019 · 33 comments
Open

404 Not Found for 127.0.0.1/boincserver #53

joeltio opened this issue Jan 24, 2019 · 33 comments

Comments

@joeltio
Copy link
Contributor

joeltio commented Jan 24, 2019

I am trying to setup a BOINC server but I am getting a 404 on http://127.0.0.1/boincserver:

$ wget http://127.0.0.1/boincserver
--2019-01-24 16:18:44--  http://127.0.0.1/boincserver
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-01-24 16:18:44 ERROR 404: Not Found.

However, I do not see anything suspicious when I start with docker-compose (log at the end of this post).

I have tried running docker-compose down -v before running as well. Here are my docker and docker compose versions:

$ docker --version
Docker version 18.09.1, build 4c52b90
$ docker-compose --version
docker-compose version 1.23.2, build 1110ad01

Docker compose up log:

$ docker-compose up
Creating network "boinc-server-docker_default" with the default driver
Creating volume "boinc-server-docker_mysql" with default driver
Creating volume "boinc-server-docker_project" with default driver
Creating volume "boinc-server-docker_results" with default driver
Creating volume "boinc-server-docker_secrets" with default driver
Creating boinc-server-docker_makeproject_1 ... done
Creating boinc-server-docker_mysql_1       ... done
Creating boinc-server-docker_apache_1      ... done
Attaching to boinc-server-docker_makeproject_1, boinc-server-docker_mysql_1, boinc-server-docker_apache_1
makeproject_1  | Updating project files in data volume...
mysql_1        | Initializing database
apache_1       | /usr/lib/python2.7/dist-packages/supervisor/options.py:298: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
apache_1       |   'Supervisord is running as root and it is searching '
apache_1       | 2019-01-24 08:18:03,670 CRIT Supervisor running as root (no user in config file)
apache_1       | 2019-01-24 08:18:03,670 INFO Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
apache_1       | 2019-01-24 08:18:03,692 INFO RPC interface 'supervisor' initialized
apache_1       | 2019-01-24 08:18:03,693 CRIT Server 'unix_http_server' running without any HTTP authentication checking
apache_1       | 2019-01-24 08:18:03,696 INFO supervisord started with pid 1
apache_1       | 2019-01-24 08:18:04,699 INFO spawned: 'cron' with pid 8
apache_1       | 2019-01-24 08:18:04,700 INFO spawned: 'start' with pid 9
apache_1       | 2019-01-24 08:18:04,704 INFO spawned: 'rsyslogd' with pid 10
apache_1       | 2019-01-24 08:18:04,711 INFO spawned: 'apache2' with pid 11
apache_1       | 2019-01-24 08:18:04,917 INFO exited: start (exit status 1; not expected)
mysql_1        |
mysql_1        |
mysql_1        | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
mysql_1        | To do so, start the server, then issue the following commands:
mysql_1        |
mysql_1        | '/usr/bin/mysqladmin' -u root password 'new-password'
mysql_1        | '/usr/bin/mysqladmin' -u root -h  password 'new-password'
mysql_1        |
mysql_1        | Alternatively you can run:
mysql_1        | '/usr/bin/mysql_secure_installation'
mysql_1        |
mysql_1        | which will also give you the option of removing the test
mysql_1        | databases and anonymous user created by default.  This is
mysql_1        | strongly recommended for production servers.
mysql_1        |
mysql_1        | See the MariaDB Knowledgebase at http://mariadb.com/kb or the
mysql_1        | MySQL manual for more instructions.
mysql_1        |
mysql_1        | Please report any problems at http://mariadb.org/jira
mysql_1        |
mysql_1        | The latest information about MariaDB is available at http://mariadb.org/.
mysql_1        | You can find additional information about the MySQL part at:
mysql_1        | http://dev.mysql.com
mysql_1        | Consider joining MariaDB's strong and vibrant community:
mysql_1        | https://mariadb.org/get-involved/
mysql_1        |
mysql_1        | Database initialized
makeproject_1  | Waiting for MySQL server to start...
mysql_1        | MySQL init process in progress...
mysql_1        | 2019-01-24  8:18:05 0 [Note] mysqld (mysqld 10.3.8-MariaDB-1:10.3.8+maria~bionic) starting as process 102 ...
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: Using Linux native AIO
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: Uses event mutexes
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: Number of pools: 1
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: Using SSE2 crc32 instructions
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: Completed initialization of buffer pool
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: Creating shared tablespace for temporary tables
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: Waiting for purge to start
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: 10.3.8 started; log sequence number 1630815; transaction id 21
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
mysql_1        | 2019-01-24  8:18:05 0 [Note] Plugin 'FEEDBACK' is disabled.
mysql_1        | 2019-01-24  8:18:05 0 [Warning] 'user' entry 'root@a93ea9dc1043' ignored in --skip-name-resolve mode.
mysql_1        | 2019-01-24  8:18:05 0 [Warning] 'user' entry '@a93ea9dc1043' ignored in --skip-name-resolve mode.
mysql_1        | 2019-01-24  8:18:05 0 [Warning] 'proxies_priv' entry '@% root@a93ea9dc1043' ignored in --skip-name-resolve mode.
mysql_1        | 2019-01-24  8:18:05 0 [Note] InnoDB: Buffer pool(s) load completed at 190124  8:18:05
mysql_1        | 2019-01-24  8:18:05 0 [Note] Reading of all Master_info entries succeded
mysql_1        | 2019-01-24  8:18:05 0 [Note] Added new Master_info '' to hash table
mysql_1        | 2019-01-24  8:18:05 0 [Note] mysqld: ready for connections.
mysql_1        | Version: '10.3.8-MariaDB-1:10.3.8+maria~bionic'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  mariadb.org binary distribution
apache_1       | 2019-01-24 08:18:06,351 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
apache_1       | 2019-01-24 08:18:06,357 INFO spawned: 'start' with pid 31
apache_1       | 2019-01-24 08:18:06,358 INFO success: rsyslogd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
apache_1       | 2019-01-24 08:18:06,358 INFO success: apache2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
apache_1       | 2019-01-24 08:18:06,414 INFO exited: start (exit status 1; not expected)
mysql_1        | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
apache_1       | 2019-01-24 08:18:08,421 INFO spawned: 'start' with pid 34
apache_1       | 2019-01-24 08:18:08,476 INFO exited: start (exit status 1; not expected)
mysql_1        | 2019-01-24  8:18:08 10 [Warning] 'proxies_priv' entry '@% root@a93ea9dc1043' ignored in --skip-name-resolve mode.
mysql_1        |
mysql_1        | 2019-01-24  8:18:08 0 [Note] mysqld (initiated by: unknown): Normal shutdown
mysql_1        | 2019-01-24  8:18:08 0 [Note] Event Scheduler: Purging the queue. 0 events
mysql_1        | 2019-01-24  8:18:08 0 [Note] InnoDB: FTS optimize thread exiting.
mysql_1        | 2019-01-24  8:18:08 0 [Note] InnoDB: Starting shutdown...
mysql_1        | 2019-01-24  8:18:08 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
mysql_1        | 2019-01-24  8:18:08 0 [Note] InnoDB: Buffer pool(s) dump completed at 190124  8:18:08
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Shutdown completed; log sequence number 1630824; transaction id 24
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
mysql_1        | 2019-01-24  8:18:10 0 [Note] mysqld: Shutdown complete
mysql_1        |
mysql_1        |
mysql_1        | MySQL init process done. Ready for start up.
mysql_1        |
mysql_1        | 2019-01-24  8:18:10 0 [Note] mysqld (mysqld 10.3.8-MariaDB-1:10.3.8+maria~bionic) starting as process 1 ...
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Using Linux native AIO
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Uses event mutexes
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Number of pools: 1
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Using SSE2 crc32 instructions
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Completed initialization of buffer pool
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Creating shared tablespace for temporary tables
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Waiting for purge to start
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: 10.3.8 started; log sequence number 1630824; transaction id 21
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
mysql_1        | 2019-01-24  8:18:10 0 [Note] Plugin 'FEEDBACK' is disabled.
mysql_1        | 2019-01-24  8:18:10 0 [Note] InnoDB: Buffer pool(s) load completed at 190124  8:18:10
mysql_1        | 2019-01-24  8:18:10 0 [Note] Server socket created on IP: '::'.
mysql_1        | 2019-01-24  8:18:10 0 [Warning] 'proxies_priv' entry '@% root@a93ea9dc1043' ignored in --skip-name-resolve mode.
mysql_1        | 2019-01-24  8:18:10 0 [Note] Reading of all Master_info entries succeded
mysql_1        | 2019-01-24  8:18:10 0 [Note] Added new Master_info '' to hash table
mysql_1        | 2019-01-24  8:18:10 0 [Note] mysqld: ready for connections.
mysql_1        | Version: '10.3.8-MariaDB-1:10.3.8+maria~bionic'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
apache_1       | 2019-01-24 08:18:11,490 INFO spawned: 'start' with pid 37
apache_1       | 2019-01-24 08:18:11,530 INFO exited: start (exit status 1; not expected)
apache_1       | 2019-01-24 08:18:12,538 INFO gave up: start entered FATAL state, too many start retries too quickly
mysql_1        | 2019-01-24  8:18:15 8 [Warning] Access denied for user 'boincadm'@'172.18.0.3' (using password: NO)
makeproject_1  | Creating database...
makeproject_1  | added platform: (create_time, name, user_friendly_name) values (1548317896, 'windows_intelx86', 'Microsoft Windows (98 or later) running on an Intel x86-compatible CPU')
makeproject_1  | added platform: (create_time, name, user_friendly_name) values (1548317896, 'windows_x86_64', 'Microsoft Windows running on an AMD x86_64 or Intel EM64T CPU')
makeproject_1  | added platform: (create_time, name, user_friendly_name) values (1548317896, 'i686-pc-linux-gnu', 'Linux running on an Intel x86-compatible CPU')
makeproject_1  | added platform: (create_time, name, user_friendly_name) values (1548317896, 'x86_64-pc-linux-gnu', 'Linux running on an AMD x86_64 or Intel EM64T CPU')
makeproject_1  | added platform: (create_time, name, user_friendly_name) values (1548317896, 'powerpc-apple-darwin', 'Mac OS X 10.3 or later running on Motorola PowerPC')
makeproject_1  | added platform: (create_time, name, user_friendly_name) values (1548317896, 'i686-apple-darwin', 'Mac OS 10.4 or later running on Intel')
makeproject_1  | added platform: (create_time, name, user_friendly_name) values (1548317896, 'x86_64-apple-darwin', 'Intel 64-bit Mac OS 10.5 or later')
makeproject_1  | added platform: (create_time, name, user_friendly_name) values (1548317896, 'sparc-sun-solaris2.7', 'Solaris 2.7 running on a SPARC-compatible CPU')
makeproject_1  | added platform: (create_time, name, user_friendly_name) values (1548317896, 'sparc-sun-solaris', 'Solaris 2.8 or later running on a SPARC-compatible CPU')
makeproject_1  | added platform: (create_time, name, user_friendly_name) values (1548317896, 'sparc64-sun-solaris', 'Solaris 2.8 or later running on a SPARC 64-bit CPU')
makeproject_1  | added platform: (create_time, name, user_friendly_name) values (1548317896, 'powerpc64-ps3-linux-gnu', 'Sony Playstation 3 running Linux')
makeproject_1  | added platform: (create_time, name, user_friendly_name) values (1548317896, 'arm-android-linux-gnu', 'Android running on ARM')
makeproject_1  | added platform: (create_time, name, user_friendly_name) values (1548317896, 'anonymous', 'anonymous')
makeproject_1  | added app: (create_time, name, user_friendly_name) values (1548317896, 'boinc2docker', 'boinc2docker')
makeproject_1  |
makeproject_1  | Found app version directory for: boinc2docker 1.07 windows_x86_64__vbox64_mt
makeproject_1  |
makeproject_1  |     NOTICE: You have not provided a signature file for vm_isocontext_v1.0.0.iso,
makeproject_1  |     and your project's code-signing private key is on your server.
makeproject_1  |
makeproject_1  |     IF YOUR PROJECT IS PUBLICLY ACCESSABLE, THIS IS A SECURITY VULNERABILITY.
makeproject_1  |     PLEASE STOP YOUR PROJECT IMMEDIATELY AND READ:
makeproject_1  |     https://boinc.berkeley.edu/trac/wiki/CodeSigning
makeproject_1  |
makeproject_1  |     Continue (y/n)? cp apps/boinc2docker/1.07/windows_x86_64__vbox64_mt/vm_isocontext_v1.0.0.iso /home/boincadm/project/download/vm_isocontext_v1.0.0.iso
makeproject_1  | cp apps/boinc2docker/1.07/windows_x86_64__vbox64_mt/vboxwrapper_26200_windows_x86_64.exe /home/boincadm/project/download/vboxwrapper_26200_windows_x86_64.exe
makeproject_1  |     Files:
makeproject_1  |         vboxwrapper_26200_windows_x86_64.exe (main program)
makeproject_1  |         vm_isocontext_v1.0.0.iso
makeproject_1  |     Flags:
makeproject_1  |         don't throttle
makeproject_1  |         needs network
makeproject_1  |         API version: 7.9.0
makeproject_1  |     Do you want to add this app version (y/n)?     App version added successfully; ID=1
makeproject_1  | Found app version directory for: boinc2docker 1.07 x86_64-pc-linux-gnu__vbox64_mt
makeproject_1  | cp apps/boinc2docker/1.07/x86_64-pc-linux-gnu__vbox64_mt/vboxwrapper_26198_x86_64-pc-linux-gnu /home/boincadm/project/download/vboxwrapper_26198_x86_64-pc-linux-gnu
makeproject_1  |     Files:
makeproject_1  |         vboxwrapper_26198_x86_64-pc-linux-gnu (main program)
makeproject_1  |         vm_isocontext_v1.0.0.iso
makeproject_1  |     Flags:
makeproject_1  |         don't throttle
makeproject_1  |         needs network
makeproject_1  |         API version: 7.7.0
makeproject_1  |     Do you want to add this app version (y/n)?     App version added successfully; ID=2
makeproject_1  | Found app version directory for: boinc2docker 1.07 x86_64-apple-darwin__vbox64_mt
makeproject_1  | cp apps/boinc2docker/1.07/x86_64-apple-darwin__vbox64_mt/vboxwrapper_26199_x86_64-apple-darwin /home/boincadm/project/download/vboxwrapper_26199_x86_64-apple-darwin
makeproject_1  |     Files:
makeproject_1  |         vboxwrapper_26199_x86_64-apple-darwin (main program)
makeproject_1  |         vm_isocontext_v1.0.0.iso
makeproject_1  |     Flags:
makeproject_1  |         don't throttle
makeproject_1  |         needs network
makeproject_1  |         API version: 7.7.2
makeproject_1  |     Do you want to add this app version (y/n)?     App version added successfully; ID=3
boinc-server-docker_makeproject_1 exited with code 0

Do I need to add any files or anything for the path to work?

@marius311
Copy link
Owner

What's the host system you're running this on? Are you running Docker via Docker Machine or maybe Docker for Win or Mac by chance?

@joeltio
Copy link
Contributor Author

joeltio commented Jan 24, 2019

I'm running on Mac Mojave 10.14.2, using Docker for Mac.

@marius311
Copy link
Owner

I'm guessing its a IP address / port fowarding problem. I've never played with this on Mac myself. According to https://docs.docker.com/docker-for-mac/networking/ this should work. Does the example in that link work for you? Mainly if you stop boinc-server-docker then run docker run -p 80:80 -d nginx, do you see the nginx welcome page if you access http://127.0.0.1/ ?

@joeltio
Copy link
Contributor Author

joeltio commented Jan 24, 2019

I doubt it's a IP address / port forwarding problem, I don't have any services running on port 80 other than the apache server in the docker container. When I run docker-compose down -v, it will show that I cannot even load the page.

$ wget http://127.0.0.1
--2019-01-24 17:08:20--  http://127.0.0.1/
Connecting to 127.0.0.1:80... failed: Connection refused.

I do see an nginx welcome page when I run docker run -p 80:80 -d nginx

@marius311
Copy link
Owner

Ah you're right, I missed above that it was at least connecting to the server.

What happens if you do dc exec apache bash and then ls? Does it look like this?

$ dc exec apache bash
root@boincserver:~/project# ls
apps  boincserver.cronjob     boincserver.readme  config.xml        download      html  plan_class_spec.xml  py         upload
bin   boincserver.httpd.conf  cgi-bin             db_dump_spec.xml  gui_urls.xml  keys  project.xml          templates
root@boincserver:~/project# 

Anything of note in /var/log/apache2/*or /var/log/supervisor/apache2-std* in the container?

@joeltio
Copy link
Contributor Author

joeltio commented Jan 24, 2019

Here's what I have:

$ docker exec -it 8f00d332f856 bash
root@boincserver:~/project# ls
apps                    cgi-bin           gui_urls.xml         py
bin                     config.xml        html                 reread_db
boincserver.cronjob     db_dump_spec.xml  keys                 templates
boincserver.httpd.conf  db_revision       plan_class_spec.xml  upload
boincserver.readme      download          project.xml

Looks about the same.
I'm not sure how to view the logs in /var/log/apache2/* because they point to /dev/stderr and /dev/stdout.

For the supervisor logs:

root@boincserver:/var/log/supervisor# cat apache2-stderr---supervisor-83vYHS.log AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.4. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.4. Set the 'ServerName' directive globally to suppress this message
[Thu Jan 24 09:18:00.422318 2019] [mpm_prefork:notice] [pid 11] AH00163: Apache/2.4.25 (Debian) PHP/7.0.31 configured -- resuming normal operations
[Thu Jan 24 09:18:00.422669 2019] [core:notice] [pid 11] AH00094: Command line: 'apache2 -D FOREGROUND'
root@boincserver:/var/log/supervisor# cat apache2-stdout---supervisor-gBo8H9.log root@boincserver:/var/log/supervisor#

@joeltio
Copy link
Contributor Author

joeltio commented Jan 25, 2019

I managed to hack a solution, maybe it will help you find the root problem.
I know that /etc/apache2/ is where all the configuration files are stored by default by apache. However, I could not find any config file that points to /home/boincadm/project/. So, I guess there was a missing link there.

I temporarily fixed it by making a symlink of the boincserver.httpd.conf in /etc/apache2/conf-enabled

$ ln -s /home/boincadm/project/boincserver.httpd.conf /etc/apache2/conf-enabled/boincserver.httpd.conf
$ /etc/init.d/apache2 reload

@marius311
Copy link
Owner

marius311 commented Jan 25, 2019

Ah I should have guessed. The ln -s is what is done by

ln -sf ${PROJECT_ROOT}/${PROJECT}.httpd.conf /etc/apache2/sites-enabled/

but in the log you sent above, the line that says apache_1 | 2019-01-24 08:18:12,538 INFO gave up: start entered FATAL state, too many start retries too quickly means that script crashed. Its log should be in /var/log/supervisor/start*, can you send the output?

If I had to guess, I'd say its probably the stat -c '%g' /var/run/docker.sock line which is failing, since /var/run/docker.sock is a mount from the host system and maybe MAC is different somehow.

In the meantime glad you found a workaround and thanks for helping track this down.

@joeltio
Copy link
Contributor Author

joeltio commented Jan 25, 2019

Here is the log for supervisor:

root@boincserver:/var/log/supervisor# cat start*
addgroup: The GID `0' is already in use.
addgroup: The GID `0' is already in use.
addgroup: The GID `0' is already in use.
addgroup: The GID `0' is already in use.

root@boincserver:/var/log/supervisor#

I'm not sure how Mac Docker works, but as far as I know my Docker socket on my Mac is also on /var/run/docker.sock (or I at least have a file there).

@marius311
Copy link
Owner

marius311 commented Jan 25, 2019

Looks like the problem is that stat -c '%g' /var/run/docker.sock is returning 0 for the GID. What do you get if you run this command on your host system?

@joeltio
Copy link
Contributor Author

joeltio commented Jan 25, 2019

Here's what I get

$ stat -c '%g' /var/run/docker.sock
stat: illegal option -- c
usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]

@marius311
Copy link
Owner

Can you find the group ID of your hosts /var/run/docker.sock in some other way?

@joeltio
Copy link
Contributor Author

joeltio commented Jan 25, 2019

Yeah, looks like the equivalent for Mac is the -f option instead of -c. Not sure how to do it platform-independent though.

$ stat -f '%g' /var/run/docker.sock
20

I'll try it in the makeproject3 and see if it works.

@marius311
Copy link
Owner

Inside the container its the Linux version of stat so -c is correct, I just wanted to see that the GID is really different. The problem is basically that the host GID is 20 but for some reason its 0 inside the container.

I think creating a docker group with the same GID is probably not the right way to do docker-in-docker on MAC, I'll have to do some research on what is the right way...

@joeltio
Copy link
Contributor Author

joeltio commented Jan 26, 2019

I'm not sure what the right way is, but while waiting, I think the following workaround is better than making a symbolic link in the docker container.

So, what I did was replace these lines:

DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
addgroup -gid ${DOCKER_GID} docker
addgroup ${BOINC_USER} docker

With these lines:

# DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
addgroup -gid 999 docker
chgrp docker /var/run/docker.sock
addgroup ${BOINC_USER} docker

Basically, hardcoding the group id for docker and changing the permissions for /var/run/docker.sock to fit.

@marius311
Copy link
Owner

Can you double check this doesn't change the GID on the host system? If so do you want to make a PR for this? It seems like a nice solution.

@marius311
Copy link
Owner

Just checked on Linux and it does change the host group, so I don't think its a viable option.

@joeltio
Copy link
Contributor Author

joeltio commented Jan 27, 2019

That's odd, my /var/run/docker.sock group permission remains the same after I run it:

$ stat -f "%g" /var/run/docker.sock
20

What if it only sets the group id to 999 if the current group id is 0? So something like:

DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
if [ $DOCKER_GID = 0 ]
then
    DOCKER_GID=999
fi
addgroup -gid ${DOCKER_GID} docker 
addgroup ${BOINC_USER} docker 

@kylehamilton
Copy link

Just letting you guys know I have the same problem on Windows.

@marius311
Copy link
Owner

marius311 commented Apr 2, 2019

Thanks for the report. Let me know if you or @joeltio have any ideas on a permanent solution, I haven't had time to think about this more since the discussion above...

@christiangil0
Copy link

christiangil0 commented Apr 14, 2019

So over the last few days, I have been trying to solve this problem.
What seems to be happening is that 'makeproject-step3.sh' has a do-while loop that never executes. Or if it does, it doesn't work properly. The problem is that the line: ln -sf ${PROJECT_ROOT}/${PROJECT}.httpd.conf /etc/apache2/sites-enabled/ accesses a file that does not exist yet or tries to write it to a directory it cannot access.
I discovered this when trying to create a symbolic link right underneath that line using: ln -sf ${PROJECT_ROOT}/${PROJECT}.httpd.conf /etc/apache2/conf-enabled/${PROJECT}.httpd.conf

The /etc/apache2/ directory only exists once docker-compose finishes launching apache, not during the execution of 'supervisored.conf - project:start'

So in order to solve this bug, you need to find a way to execute this line ln -sf ${PROJECT_ROOT}/${PROJECT}.httpd.conf /etc/apache2/conf-enabled/${PROJECT}.httpd.conf && /etc/init.d/apache2 reload right after apache finished launching in docker-compose.

My current solution is to tack this code at the end of 'docker-compose.yml'
bash:
entrypoint: /bin/bash
depends_on:
- apache
- makeproject
- mysql
links:
- apache
- makeproject
- mysql
volumes:
- "project:$PROJECT_ROOT"
command: -c "sleep 10 && ls /etc/apache2/conf-enabled/; ln -sf ${PROJECT_ROOT}/${PROJECT}.httpd.conf /etc/apache2/conf-enabled/${PROJECT}.httpd.conf && /etc/init.d/apache2 reload"
image: ubuntu
tty: true

THIS DOES NOT WORK YET
I need to figure out how to mount the files that are in apache2 so that the symbolic link can be made. Any help would be appreciated.

@marius311
Copy link
Owner

Another solution is just to delete the following three lines:

DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
addgroup -gid ${DOCKER_GID} docker
addgroup ${BOINC_USER} docker

however, with either this or your solution, boinc2docker jobs will not work. But we definitely should find a solution such that at the very least the server keeps working.

@GerardoLSJ
Copy link

Another solution is just to delete the following three lines:

DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
addgroup -gid ${DOCKER_GID} docker
addgroup ${BOINC_USER} docker

however, with either this or your solution, boinc2docker jobs will not work. But we definitely should find a solution such that at the very least the server keeps working.

I tried with this configuration and still I'm getting the error
boinc-server-docker_makeproject_1 exited with code 0

I'm using: Docker version 18.09.2, build 6247962
System Version: macOS 10.14.4 (18E226)
Kernel Version: Darwin 18.5.0

@marius311
Copy link
Owner

Can you double check everything rebuilt correctly after you deleted those lines? Running docker-compose run apache cat /usr/bin/makeproject-step3.sh could be a good way to check.

@marius311
Copy link
Owner

marius311 commented May 14, 2019

Oh, also, boinc-server-docker_makeproject_1 exited with code 0 is the expected behavior, the makeproject container does not stay running once the project is built, and code 0 means success.

@FardinBehboudi
Copy link

Oh, also, boinc-server-docker_makeproject_1 exited with code 0 is the expected behavior, the makeproject container does not stay running once the project is built, and code 0 means success.

Hey everybody, I have the same problem with Docker Windows.
any solution for this bug? any workaround?

@marius311
Copy link
Owner

Does #53 (comment) work for you?

@FardinBehboudi
Copy link

FardinBehboudi commented Jul 25, 2019

yes it works with that, but how about the above-mentioned problem?
" however, with either this or your solution, boinc2docker jobs will not work. "

now I am facing this problem because I can't see my boinc2docker jobs ?

@marius311
Copy link
Owner

now I am facing this problem because I can't see my boinc2docker jobs ?

I don't have a workaround that works with boinc2docker yet unfortunately.

@siriak
Copy link

siriak commented Sep 11, 2019

I managed to hack a solution, maybe it will help you find the root problem.
I know that /etc/apache2/ is where all the configuration files are stored by default by apache. However, I could not find any config file that points to /home/boincadm/project/. So, I guess there was a missing link there.

I temporarily fixed it by making a symlink of the boincserver.httpd.conf in /etc/apache2/conf-enabled

$ ln -s /home/boincadm/project/boincserver.httpd.conf /etc/apache2/conf-enabled/boincserver.httpd.conf
$ /etc/init.d/apache2 reload

worked for me, how about adding it to the master branch so the project could work out of the box?

@Jordan-Hall
Copy link

git clone https://github.com/marius311/boinc-server-docker.git
cd boinc-server-docker

and then run,

docker-compose pull
docker-compose up -d
docker-compose exec apache bash
ln -s /home/boincadm/project/boincserver.httpd.conf /etc/apache2/conf-enabled/boincserver.httpd.conf
/etc/init.d/apache2 reload
bin/stop
bin/start

These are the steps required to run boinc server. If you change the environment file then you need to change the boincserver to the env project name

@philldresser
Copy link

I had a similar problem running on Mac.
I followed the pathway of removing the version line in docker-compose.yml and then executed the makeproject-step3.sh script and then the server website began to function

@salimbene
Copy link

@philldresser Im getting this issue on Mac as well. I'm trying to follow the steps you executed, but in addition to removing the version line from docker-compose.yaml, when or how did you execute the make project script. Did you run after doing docker-compose up -d, I mean, while the container were running?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants