I’m getting a ‘Site can’t be reached” page when I go to my local binafsaj.test site

I’m getting a ‘Site can’t be reached” page when I go to my local test site,
i made all guideline from her https://github.com/roots/trellis
until Local development setup when I Run vagrant up all is good and fine and the Virtual Box is running my binafsaj.test when i try to open it from chrome and all browsers I’m getting a ‘Site can’t be reached” page!

This is from terminal: when I Run vagrant up:

        ==> default: Checking if box 'bento/ubuntu-18.04' is up to date...
    ==> default: [vagrant-hostmanager:guests] Updating hosts file on active guest virtual machines...
    ==> default: [vagrant-hostmanager:host] Updating hosts file on your workstation (password may be required)...
    ==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
    ==> default: flag to force provisioning. Provisioners marked to run always will still run.
    ==> default: Running triggers after up ...
    ==> default: Running trigger...
    ==> default: Adding vagrant ssh-config for binafsaj.test to ~/.ssh/config

    ==> default: Machine 'default' has a post `vagrant up` message. This is a message
    ==> default: from the creator of the Vagrantfile, and not from Vagrant itself:
    ==> default: 
    ==> default: Your Trellis Vagrant box is ready to use!
    ==> default: * Composer and WP-CLI commands need to be run on the virtual machine
    ==> default:   for any post-provision modifications.
    ==> default: * You can SSH into the machine with `vagrant ssh`.
    ==> default: * Then navigate to your WordPress sites at `/srv/www`
    ==> default:   or to your Trellis files at `/home/vagrant/trellis`.

------

I searched here
https://discourse.roots.io/search?q=Site%20can’t%20be%20reached

I didn’t find a solution until this topic
Http does not redirect to https only at the first access

I try this command:
ansible-playbook server.yml -e env=development

and this is the result:

    $ ansible-playbook server.yml -e env=development

PLAY [Ensure necessary variables are defined] **********************************

TASK [Ensure environment is defined] *******************************************
skipping: [localhost]

PLAY [Test Connection and Determine Remote User] *******************************

TASK [connection : Require manual definition of remote-user] *******************
skipping: [xxx.xxx.xx.5]

TASK [connection : Specify preferred HostKeyAlgorithms for unknown hosts] ******
ok: [[xxx.xxx.xx.5]

TASK [connection : Check whether Ansible can connect as root] ******************
ok: [[xxx.xxx.xx.5 -> localhost]

TASK [connection : Warn about change in host keys] *****************************
skipping: [[xxx.xxx.xx.5]

TASK [connection : Set remote user for each host] ******************************
ok: [[xxx.xxx.xx.5]

TASK [connection : Announce which user was selected] ***************************
Note: Ansible will attempt connections as user = ohoudalawad

Note: The host `[xxx.xxx.xx.5` was not detected in known_hosts
so Trellis prompted the host to offer a key type that will work with
the stronger key types Trellis configures on the server. This avoids future
connection failures due to changed host keys. Trellis used this SSH option:

  -o HostKeyAlgorithms=ssh-ed25519-cert-v01@openssh.com,ssh-rsa-
cert-v01@openssh.com,ssh-ed25519,ssh-rsa

To prevent Trellis from ever using this SSH option, add this to group_vars:

  dynamic_host_key_algorithms: false
ok: [[xxx.xxx.xx.5]

TASK [connection : Load become password] ***************************************
ok: [[xxx.xxx.xx.5]

PLAY [Set ansible_python_interpreter] ******************************************

TASK [python_interpreter : Get Ubuntu release] *********************************
System info:
  Ansible 2.7.5; Darwin
  Trellis version (per changelog): "Add Python 2 explicitly"
---------------------------------------------------
non-zero return code
sudo: a password is required

fatal: [xxx.xxx.xx.5]: FAILED! => {"changed": false, "rc": 1, "stderr_lines": ["sudo: a password is required"], "stdout": "", "stdout_lines": []}
	to retry, use: --limit @/Users/ohoudalawad/sites/binafsaj.com/trellis/server.retry

PLAY RECAP *********************************************************************
xxx.xxx.xx.5               : ok=5    changed=0    unreachable=0    failed=1   
localhost                  : ok=0    changed=0    unreachable=0    failed=0   

-----------

I don’t understand is this is the problem?! and how can i solve it?

The error you’re receiving is pretty clear:

sudo: a password is required

Have you tried searching on this error either here or on Google?

1 Like

I searched here and on google i try some solutions but its the same error!

non-zero return code

sudo: a password is required

fatal: [xxx.xxx.xx.5]: FAILED! => {"changed": false, "rc": 1, "stderr_lines": ["sudo: a password is required"], "stdout": "", "stdout_lines": []}

You can’t run the remote playbook for development environments, so this isn’t going to work

1 Like

What about the other topics from your search? What other solutions did you try?

There’s several in just this one Local development issues —can't get example page up on browser

1 Like

i will try, thank you for your replay.

Good catch, @ben; I was busy digging through the errors and didn’t even look at the commands!

I’m guessing your first vagrant up had some kind of error. Your best bet is to simply vagrant destroy && vagrant up and rebuild the whole darn thing and watch for errors.

1 Like

Thank you for you replay,
the errors are

[WARNING]: Module remote_tmp /root/.ansible/tmp did not exist and was created

with a mode of 0700, this may cause issues when running as another user. To

avoid this, create the remote_tmp dir with the correct permissions manually

and

[WARNING]: The src option requires state to be ‘link’ or ‘hard’. This will

become an error in Ansible 2.10

Those are warnings and don’t indicate any error has occurred.

You said you followed the instructions at https://github.com/roots/trellis. Can you confirm that you have a site directory and its contents?

1 Like

yes, I have.

this is the error on the page

What is that mean, please?

Self-signed

The self-signed provider should only be used for development or internal server purposes . Trellis will generate a “fake” (or “snake-oil”) certificate which is not recognized by browsers.

Browsers will prompt you with an error/warning that they don’t recognize the Certificate Authority (which is yourself in this case).

    # group_vars/development/wordpress_sites.yml (example)

    example.com:
      # rest of site config
      ssl:
        enabled: true
        provider: self-signed
    ```

**https://roots.io/trellis/docs/ssl/**

**is this is the problem? how can i solve it, please?**

Lots of stuff to dive into:

https://discourse.roots.io/search?q=ERR_EMPTY_RESPONSE

1 Like

Thanks a lot I found the solution here and its work with me:

Post#7.

1 Like

Thank you for the follow up! I added this scenario to the troubleshooting docs:

1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.