Git Product home page Git Product logo

Comments (19)

nprasath002 avatar nprasath002 commented on June 9, 2024 2

I am new to puppet and spent some time on this today. Here are my findings

1

If so, does changing 88c47f7#diff-1d7b4e3b0e560baa0fae242b9b97f691R10 from /vagrant/${name} to have /chassis/${name} change anything?

The type has changed to the following since that commit

	define install {
		exec { "Installing Composer ${name}":
			environment => [ 'COMPOSER_HOME=/usr/bin/composer' ],
			path        => [ '/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/' ],
			cwd         => $name,
			command     => "composer install ${config[composer][options]}",
			require     => [ Exec['install composer'] ],
			logoutput   => true,
			onlyif      => 'test ! -d vendor'
		}
	}

2

I've tried replicating it with a new version of Chassis and the composer extension and I'm unable to replicate it.

I tried with fresh chasis install with composer extension and i am unable to replicate as well. The problem is

I'll need to see what's in your install.sh script as that's the only thing that's different.

We have a defined config that is copied to a chassis/config.local.yaml. There we have defined couple of composer paths

composer:
    paths:
    - /chassis/content/plugins-mu/vendor/memcached-adapter
    - /chassis/content/plugins-mu/vendor/simple-cache-bridge
    - /chassis/content/plugins-mu/vendor/PhpSpreadsheet

3

Placing a defined type outside the class works fine.

define tmpfile() {
    file { "/tmp/${name}.php": content => "Hello, world\n",
    }
  }

I tried defining below outside the class and called it inside the class and it worked fine.

tmpfile { ['a', 'b', 'c']: }

4

		if ( $config[composer] and $config[composer][paths]) {
			install { $config[composer][paths]: }
		}

I changed the above to code to below and it worked fine

		if ( $config[composer] and $config[composer][paths]) {
			composer::install { $config[composer][paths]: }
		}

From the documentation

Define statements may also be placed inside class definitions; this gives the user defined type a name in the class’ namespace (a user defined type ‘mytype’ inside the class ‘myclass’ is given the name ‘myclass::mytype’.

The above seems to be the issue.

from composer.

BronsonQuick avatar BronsonQuick commented on June 9, 2024 2

@nprasath002 Champion. The paths was the bit of information that I was missing which is why I couldn't replicate it. I'll fix that one up for you tonight

from composer.

ntwb avatar ntwb commented on June 9, 2024 1

p.s I'll get those additional details from the user shortly

from composer.

ntwb avatar ntwb commented on June 9, 2024 1

Thank you kind sir 🙇

from composer.

nprasath002 avatar nprasath002 commented on June 9, 2024 1

Thanks a lot @BronsonQuick

from composer.

BronsonQuick avatar BronsonQuick commented on June 9, 2024

Alright, so looking at the output of that one it's been installed from a shell script. I've tried replicating it with a new version of Chassis and the composer extension and I'm unable to replicate it.

My guess would be that the Chassis box you're using might be outdated? For some version the Vagrant CLI doesn't have a command to display the box version that a project is using but you should be able to look in ~/.vagrant.d/data/machine-index/index to find that information.

Let me know how you go as I'm more than happy to keep digging or try something else to replicate it!

from composer.

ntwb avatar ntwb commented on June 9, 2024

Thanks @BronsonQuick, the team has now got it working, not sure how it was resolved but we can close this now

from composer.

nprasath002 avatar nprasath002 commented on June 9, 2024

The team manually install composer inside the machine and removed composer chasis extension from config to get this working.

from composer.

ntwb avatar ntwb commented on June 9, 2024

Note: That Composer was installed inside Vagrant using brew inside the box

from composer.

ntwb avatar ntwb commented on June 9, 2024

User:
OS : macOS Catalina version 10.15.2
Vagrant Version : 2.2.0
VirtualBox 5.2.32r132073

Me:
No custom YAML file I believe, standard HM repo install for that project I work on
Extensions:
extensions:
- chassis/xdebug
- chassis/sequelpro
- chassis/cavalcade
- chassis/mailhog
- chassis/composer
- chassis/phpcs
- chassis/mailhog
- chassis/chassis_elasticsearch
- chassis/intl
- chassis/tester

from composer.

BronsonQuick avatar BronsonQuick commented on June 9, 2024

@ntwb Thanks for that.

Any chance you can let me know which Chassis box version you're using?

My guess would be that the Chassis box you're using might be outdated? For some version the Vagrant CLI doesn't have a command to display the box version that a project is using but you should be able to look in ~/.vagrant.d/data/machine-index/index to find that information.

from composer.

ntwb avatar ntwb commented on June 9, 2024

I'll check, as it was (I believe) a fresh install I would have thought the box was the latest release as that would have been pulled down, will go ask and confirm

from composer.

BronsonQuick avatar BronsonQuick commented on June 9, 2024

Awesome. Thank you Sir. I'm doing a fresh up with those extensions now. So I'll report back when it's provisioned.

from composer.

BronsonQuick avatar BronsonQuick commented on June 9, 2024

The provision was successful. I'm wondering if the composer extension might be out of date? It might be worth changing into the extensions/composer directory and run git pull && vagrant provision.

from composer.

ntwb avatar ntwb commented on June 9, 2024

Pulling it all down myself now in a test folder, nothing has changed in recent times for that project I have been working on forever, so I'll test it myself and see what results I get

Will try that also

from composer.

ntwb avatar ntwb commented on June 9, 2024

I get the same error on my test local, scroll to the end of this comment, then read back up ;)


Anyways, on my test:

cd chassis/extensions/composer/
~/Code/tmp/test/chassis/extensions/composer master
❯ git remote -v
origin  https://github.com/chassis/composer (fetch)
origin  https://github.com/chassis/composer (push)
~/Code/tmp/test/chassis/extensions/composer master
❯ git pull
Already up to date.
~/Code/tmp/test/chassis/extensions/composer master

Ran bash install.sh and working as expected:

Unpacking objects: 100% (91/91), done.
[vagrant] Bringing machine 'default' up with 'virtualbox' provider...
[vagrant] ==> default: Running action triggers before up ...
[vagrant] ==> default: Running trigger...
[vagrant] ==> default: 
[vagrant] ==> default: Box 'chassis/chassis' could not be found. Attempting to find and install...
[vagrant]     default: Box Provider: virtualbox
[vagrant]     default: Box Version: >= 3.0, < 4.0
[vagrant] ==> default: Loading metadata for box 'chassis/chassis'
[vagrant]     default: URL: https://vagrantcloud.com/chassis/chassis
[vagrant] ==> default: Adding box 'chassis/chassis' (v3.0.1) for provider: virtualbox
[vagrant]     default: Downloading: https://vagrantcloud.com/chassis/boxes/chassis/versions/3.0.1/providers/virtualbox.box
    default: Download redirected to host: vagrantcloud-files-production.s3.amazonaws.com
==> default: Successfully added box 'chassis/chassis' (v3.0.1) for 'virtualbox'!
[vagrant] ==> default: Importing base box 'chassis/chassis'...
==> default: Matching MAC address for NAT networking...
[vagrant] ==> default: Checking if box 'chassis/chassis' version '3.0.1' is up to date...
[vagrant] ==> default: Setting the name of the VM: chassis_default_1578900033572_25498
[vagrant] ==> default: Clearing any previously set network interfaces...
[vagrant] ==> default: Preparing network interfaces based on configuration...
[vagrant]     default: Adapter 1: nat
[vagrant]     default: Adapter 2: hostonly
[vagrant] ==> default: Forwarding ports...
[vagrant]     default: 80 (guest) => 8000 (host) (adapter 1)
[vagrant]     default: 22 (guest) => 2222 (host) (adapter 1)
[vagrant] ==> default: Running 'pre-boot' VM customizations...
[vagrant] ==> default: Booting VM...
[vagrant] ==> default: Waiting for machine to boot. This may take a few minutes...
[vagrant]     default: SSH address: 127.0.0.1:2222
[vagrant]     default: SSH username: vagrant
[vagrant]     default: SSH auth method: private key
[vagrant] ==> default: Machine booted and ready!
[vagrant] ==> default: Checking for guest additions in VM...
[vagrant]     default: The guest additions on this VM do not match the installed version of
[vagrant]     default: VirtualBox! In most cases this is fine, but in rare cases it can
[vagrant]     default: prevent things such as shared folders from working properly. If you see
[vagrant]     default: shared folder errors, please make sure the guest additions within the
[vagrant]     default: virtual machine match the version of VirtualBox you have installed on
[vagrant]     default: your host and reload your VM.
[vagrant]     default: 
[vagrant]     default: Guest Additions Version: 6.1.0
[vagrant]     default: VirtualBox Version: 6.0
[vagrant] ==> default: Setting hostname...
[vagrant] ==> default: Configuring and enabling network interfaces...
[vagrant] ==> default: Mounting shared folders...
[vagrant]     default: /chassis => /Users/netweb/Code/tmp/test
[vagrant]     default: /vagrant => /Users/netweb/Code/tmp/test/chassis
[vagrant] ==> default: Detected mount owner ID within mount options. (uid: 1000 guestpath: /vagrant)
[vagrant] ==> default: Detected mount group ID within mount options. (gid: 33 guestpath: /vagrant)
[vagrant]     default: /var/log/php => /Users/netweb/Code/tmp/test/chassis/logs/php
[vagrant] ==> default: Detected mount owner ID within mount options. (uid: 1000 guestpath: /var/log/php)
[vagrant] ==> default: Detected mount group ID within mount options. (gid: 33 guestpath: /var/log/php)
[vagrant]     default: /var/log/nginx => /Users/netweb/Code/tmp/test/chassis/logs/nginx
[vagrant] ==> default: Detected mount owner ID within mount options. (uid: 1000 guestpath: /var/log/nginx)
[vagrant] ==> default: Detected mount group ID within mount options. (gid: 33 guestpath: /var/log/nginx)
[vagrant]     default: /vagrant/extensions/_global => /Users/netweb/.chassis/extensions
[vagrant] ==> default: Detected mount owner ID within mount options. (uid: 1000 guestpath: /vagrant/extensions/_global)
[vagrant] ==> default: Detected mount group ID within mount options. (gid: 33 guestpath: /vagrant/extensions/_global)
[vagrant] ==> default: Running provisioner: shell...
[vagrant]     default: Running: /var/folders/33/6sh192cx64v_v4st4f6vpjsh0000gn/T/vagrant-shell20200113-7347-1kii7ir.sh
[vagrant]     default: Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
[vagrant]     default: Get:2 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
[vagrant]     default: Get:3 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease [20.8 kB]
[vagrant]     default: Get:4 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main i386 Packages [52.1 kB]
[vagrant]     default: Get:5 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages [417 kB]
[vagrant]     default: Get:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
...
...
... Box updates continuing....

Right up until this:

[vagrant]     default: Get:49 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [4,044 B]
[vagrant]     default: Get:50 http://archive.ubuntu.com/ubuntu bionic-backports/universe Translation-en [1,900 B]
[vagrant]     default: Fetched 32.5 MB in 14s (2,332 kB/s)
[vagrant]     default: Reading package lists...
[vagrant]     default: Reading package lists...
[vagrant]     default: Building dependency tree...
[vagrant]     default: Reading state information...
[vagrant]     default: puppet is already the newest version (5.4.0-2ubuntu3).
[vagrant]     default: 0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.
[vagrant] ==> default: Running provisioner: shell...
[vagrant]     default: Running: inline script
[vagrant]     default: Error: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'install' (file: /vagrant/extensions/composer/modules/composer/manifests/init.pp, line: 63, column: 4) on node sctest.local
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Open http://sctest.local/wp-admin/ in your browser? [y/N] 

So, same error:

[vagrant]     default: Error: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'install' (file: /vagrant/extensions/composer/modules/composer/manifests/init.pp, line: 63, column: 4) on node sctest.local

Here's the contents of my ~/.vagrant.d/data/machine-index/index file

		"1f38abc92f664170aa0fb684d519298f": {
			"local_data_path": "/Users/netweb/Code/tmp/test/chassis/.vagrant",
			"name": "default",
			"provider": "virtualbox",
			"state": "running",
			"vagrantfile_name": null,
			"vagrantfile_path": "/Users/netweb/Code/tmp/test/chassis",
			"updated_at": null,
			"extra_data": {
				"box": {
					"name": "chassis/chassis",
					"provider": "virtualbox",
					"version": "3.0.1"
				}
			}
		}

from composer.

BronsonQuick avatar BronsonQuick commented on June 9, 2024

@ntwb I'll need to see what's in your install.sh script as that's the only thing that's different.

from composer.

ntwb avatar ntwb commented on June 9, 2024

Looking inside Vagrant, Composer has not been installed

vagrant@sctest:/chassis$ which curl
/usr/bin/curl
vagrant@sctest:/chassis$ php --version
PHP 7.3.13-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Dec 18 2019 14:48:49) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.13, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.13-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
vagrant@sctest:/chassis$ which curl
/usr/bin/curl
vagrant@sctest:/chassis$ puppet --version
5.4.0

So this 88c47f7 commit still appears to be the cause, for whatever reason of the environment inside the Vagrant box Composer is not being installed

🤔

from composer.

BronsonQuick avatar BronsonQuick commented on June 9, 2024

Does this happen to be Chassis with a paths setup? If so, does changing 88c47f7#diff-1d7b4e3b0e560baa0fae242b9b97f691R10 from /vagrant/${name} to have /chassis/${name} change anything?

from composer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.