geerlingguy / drupal-vm

A VM for Drupal development
https://www.drupalvm.com/
MIT License
1.37k stars 647 forks source link

Ansible task "Add NodeSource repositories for Node.js." generates an error. #2180

Closed kruczi closed 2 years ago

kruczi commented 3 years ago

Issue Type

Your Environment

Vagrant 2.2.10
VirtualBox 6.1.26r145957
ansible 2.9.24
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/goss/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.17 (default, Feb 27 2021, 15:10:58) [GCC 7.5.0]

Your OS

Full console output

https://gist.github.com/kruczi/9685729ce314817ca9d9aaf97eacc837

Summary

I clone the repo drupal-vm, and turn it on only the extras nodejs. vagrant up fails during updating repositories for Node.js.

mladenrtl commented 3 years ago

I think it is related to this issue https://github.com/nodesource/distributions/issues/1266

SadeeshKumarMN commented 2 years ago

@mladenrtl you are right. @kruczi The following steps solved the issue. Just give it a try in case if you are still looking for the solution. Do vagrant ssh Then run sudo apt-get update Then run sudo apt-get upgrade Then again run vagrant reload --provision

mladenrtl commented 2 years ago

@mladenrtl you are right. @kruczi The following steps solved the issue. Just give it a try in case if you are still looking for the solution. Do vagrant ssh Then run sudo apt-get update Then run sudo apt-get upgrade Then again run vagrant reload --provision

Thank you @SadeeshKumarMN One addition. We should first disable nodejs, vagrant up, ssh, then update, upgrade and vagrant reload with provision again. Right?

kruczi commented 2 years ago

Hi @SadeeshKumarMN and @mladenrtl.

I can confirm that the above workaround works and I could finally provision the vagrant instance, and didn't disable nodejs during testing. I mostly use a default configuration about images:

vagrant_box: geerlingguy/drupal-vm

Is there a possibility that the above image will be fixed? I assume that is a place to fix that.

SadeeshKumarMN commented 2 years ago

@mladenrtl It works without disabling node.js. Also, the following other work-around with installing ca-certificates also helped for us. Do vagrant ssh Then run sudo apt install ca-certificates exit from ssh and do vagrant provision @kruczi As geerlingguy.nodejs role uses the Nodesource binary sources and the bug belongs to their end, I'm not sure any temporary fix is required in that image since the bug is in upstream but @geerlingguy may please clarify and confirm this.

kruczi commented 2 years ago

I could confirm that the issue was resolved.