Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

PHP Package Error #91

Closed
ryanirelan opened this issue May 1, 2020 · 7 comments
Closed

PHP Package Error #91

ryanirelan opened this issue May 1, 2020 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@ryanirelan
Copy link

The nitro init process results in a series of PHP package errors.

  • Installed Multipass via macOS app, running version 1.2.1+mac

  • Installed Nitro via terminal command in docs. Running version 0.11.2

  • macOS Mojave 10.14.6

  • 2 CPUs selected

  • 4G memory selected

  • 40G disk space selected

  • PHP 7.3 (and, previously, 7.4; both results errors)

  • mysql 8

~/training/craftycoffee-2020 $ nitro init
How many CPU cores?
Enter a value (Default is 2):

How much memory?
Enter a value (Default is 4G):

How much disk space??
Enter a value (Default is 40G):

Which version of PHP?

1. 7.4
2. 7.3
3. 7.2
4. 7.1
5. 7.0

Enter a number (Default is 1): 2

Which database engine?

1. mysql
2. postgres

Enter a number (Default is 1):

Select a version of mysql?

1. 8.0
2. 5.7
3. 5.6
4. 5

Enter a number (Default is 1):

Applying the changes now...
Launched: nitro-dev
Reading package lists...
Building dependency tree...
Reading state information...
Package php-imagick is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php-xdebug is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Unable to locate package php7.3
E: Couldn't find any package by glob 'php7.3'
E: Couldn't find any package by regex 'php7.3'
E: Unable to locate package php7.3-mbstring
E: Couldn't find any package by glob 'php7.3-mbstring'
E: Couldn't find any package by regex 'php7.3-mbstring'
E: Unable to locate package php7.3-cli
E: Couldn't find any package by glob 'php7.3-cli'
E: Couldn't find any package by regex 'php7.3-cli'
E: Unable to locate package php7.3-curl
E: Couldn't find any package by glob 'php7.3-curl'
E: Couldn't find any package by regex 'php7.3-curl'
E: Unable to locate package php7.3-fpm
E: Couldn't find any package by glob 'php7.3-fpm'
E: Couldn't find any package by regex 'php7.3-fpm'
E: Unable to locate package php7.3-gd
E: Couldn't find any package by glob 'php7.3-gd'
E: Couldn't find any package by regex 'php7.3-gd'
E: Unable to locate package php7.3-intl
E: Couldn't find any package by glob 'php7.3-intl'
E: Couldn't find any package by regex 'php7.3-intl'
E: Unable to locate package php7.3-json
E: Couldn't find any package by glob 'php7.3-json'
E: Couldn't find any package by regex 'php7.3-json'
E: Unable to locate package php7.3-mysql
E: Couldn't find any package by glob 'php7.3-mysql'
E: Couldn't find any package by regex 'php7.3-mysql'
E: Unable to locate package php7.3-opcache
E: Couldn't find any package by glob 'php7.3-opcache'
E: Couldn't find any package by regex 'php7.3-opcache'
E: Unable to locate package php7.3-pgsql
E: Couldn't find any package by glob 'php7.3-pgsql'
E: Couldn't find any package by regex 'php7.3-pgsql'
E: Unable to locate package php7.3-zip
E: Couldn't find any package by glob 'php7.3-zip'
E: Couldn't find any package by regex 'php7.3-zip'
E: Unable to locate package php7.3-xml
E: Couldn't find any package by glob 'php7.3-xml'
E: Couldn't find any package by regex 'php7.3-xml'
E: Unable to locate package php7.3-soap
E: Couldn't find any package by glob 'php7.3-soap'
E: Couldn't find any package by regex 'php7.3-soap'
E: Package 'php-xdebug' has no installation candidate
E: Package 'php-imagick' has no installation candidate
E: Unable to locate package blackfire-agent
E: Unable to locate package blackfire-php
Error: exit status 100

Confirmed this with @angrybrad via Tuple.

@jasonmccallister
Copy link
Contributor

jasonmccallister commented May 1, 2020

@ryanirelan I'm looking into this error and trying to reproduce it. I'm trying to narrow a few things down but I cannot reproduce the error.

The PHP packages are installed in the process of virtual machine initialization so it seems like that part is failing.

Can you run nitro init again if you get the same error, can you run nitro ssh and attach the contents of /var/log/cloud-init-output.log and /var/log/cloud-init.log?

Here are some steps to get the files from the machine to your host:

  1. multipass transfer nitro-dev:/var/log/cloud-init-output.log cloud-init-output.log
  2. multipass transfer nitro-dev:/var/log/cloud-init.log cloud-init.log

I will dig through the logs and see if I can correct this issue.

@jasonmccallister jasonmccallister self-assigned this May 1, 2020
@jasonmccallister jasonmccallister added the bug Something isn't working label May 1, 2020
@ryanirelan
Copy link
Author

Thanks, Jason.

I get this on two machines: one runs Catalina and the other Mojave.

Attached are the logs from the default nitro-dev machine from Catalina.
cloud-init-output.log
cloud-init.log

@ryanirelan
Copy link
Author

And the logs for the Mojave machine:

cloud-init-output.log
cloud-init.log

@jasonmccallister
Copy link
Contributor

jasonmccallister commented May 4, 2020

@ryanirelan looking through the logs gave me a few ideas:

I originally suspected that this was an error downloading packages and it was, this is what is in both of the output logs:

Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Temporary failure resolving 'security.ubuntu.com'

That leads me to suspect the following issue since you tried this at the same time 20.04 launched and they might have changed server configurations after you downloaded the multipass image.

I don't see a way to manually remove a downloaded image, so I might have to file an issue with the multipass team. In the meantime, can we try the following:

  1. Open a terminal and enter sudo su and enter your macOS password.
  2. Navigate to the cached images directory cd /var/root/Library/Caches/multipassd/vault/images.
  3. Perform and ls and remove any image directories (rm -rf bionic-20200407) you see in that directory. This will remove those images from your machine.
  4. Finally, exit the sudo session and try to run nitro init again.

@jasonmccallister
Copy link
Contributor

This was an issue when running dnsmasq on the host machine and troubleshot with this guide: https://discourse.ubuntu.com/t/troubleshooting-networking-on-macos/12901

This is going to be a common problem (nice finding this @ryanirelan and thanks for working through it with me). In order to prevent other issues, we are telling the machine to always use the DNS from CloudFlares 1.1.1.1 nameserver.

This is going to be resolved in the next release.

@jasonmccallister
Copy link
Contributor

@ryanirelan this has been addressed in https://github.com/craftcms/nitro/releases/tag/0.11.4. Can you run the installer again and let us know if you still have the same issue?

@ryanirelan
Copy link
Author

Thanks for the help, @jasonmccallister! The update fixed the issue for me and I'm able to successfully initialize a machine now. 🎊

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants