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

Want to contribute but Vagrantfile is not working/up to date #3919

Closed
yuisheaven opened this issue Feb 7, 2023 · 4 comments
Closed

Want to contribute but Vagrantfile is not working/up to date #3919

yuisheaven opened this issue Feb 7, 2023 · 4 comments

Comments

@yuisheaven
Copy link

What I want to develop

The new android versions require apps to categorize push notifications into notification channels.
Unfortunately, Countly does not support a categorization of the push notifications yet, which is why I would like to add this with a Plugin.

My problem

I read the contribution markdown file which recommends using Vagrant and Virtual Box. But the Vagrantfile is not up to date and does not work.

List of errors

1. Ubuntu Version

With Vagrant and Virtual Box installed and "vagrant up" within the downloaded latest release repository, the command line shows that the old Ubuntu version 16.04 which is used is no longer supported. After switching this to Ubuntu Jammy64, there were more issues

2. The NPM package couldn't be installed due to symlink issues within Vagrant

5337 verbose stack Error: EPROTO: protocol error, symlink '../is-ci/bin.js' -> '/opt/countly/.local/lib/node_modules/npm/node_modules/.bin/is-ci'
5338 verbose cwd /opt/countly
5339 verbose Linux 5.15.0-57-generic
5340 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "[email protected]"
5341 verbose node v14.21.2
5342 verbose npm  v6.14.17
5343 error code EPROTO
5344 error syscall symlink
5345 error path ../is-ci/bin.js
5346 error dest /opt/countly/.local/lib/node_modules/npm/node_modules/.bin/is-ci
5347 error errno -71
5348 error EPROTO: protocol error, symlink '../is-ci/bin.js' -> '/opt/countly/.local/lib/node_modules/npm/node_modules/.bin/is-ci'
5349 verbose exit [ -71, true ]

symlink-error.log

The NPM Error then was fixed by changing all three "npm install" to npm install --no-bin-links in countly.install_ubuntu.sh

3. Command failed: git checkout HEAD within NPM

10111 warn [email protected] No license field.
10112 verbose stack Error: Command failed: git checkout HEAD
10112 verbose stack fatal: detected dubious ownership in repository at '/opt/countly/.npm/_cacache/tmp/git-clone-136a9e5f'
10112 verbose stack To add an exception for this directory, call:
10112 verbose stack
10112 verbose stack 	git config --global --add safe.directory /opt/countly/.npm/_cacache/tmp/git-clone-136a9e5f
10112 verbose stack
10112 verbose stack     at ChildProcess.exithandler (child_process.js:383:12)
10112 verbose stack     at ChildProcess.emit (events.js:400:28)
10112 verbose stack     at maybeClose (internal/child_process.js:1088:16)
10112 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
10113 verbose cwd /opt/countly
10114 verbose Linux 5.15.0-57-generic
10115 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "--no-bin-links"
10116 verbose node v14.21.2
10117 verbose npm  v6.14.17
10118 error code 128
10119 error Command failed: git checkout HEAD
10119 error fatal: detected dubious ownership in repository at '/opt/countly/.npm/_cacache/tmp/git-clone-136a9e5f'
10119 error To add an exception for this directory, call:
10119 error
10119 error 	git config --global --add safe.directory /opt/countly/.npm/_cacache/tmp/git-clone-136a9e5f
10120 verbose exit [ 1, true ]

git-error.log

I was not able to solve this one yet.

My Environment

  • Operating System and version: Windows 10 Enterprise Version 10.0.19045 Build 19045
  • Any changes you have made to your instance: None at first, just downloaded the latest release git repo - version 22.09.12, extracted it, opened a windows terminal (not powershell), changed the directory in the terminal to the extracted folder directory and entered vagrant up.

Final question

It seems like the Vagrantfile itself is outdated. Is there a newer version anywhere? I used the Vagrantfile in the root directory.

If there is none, I would like to ask if Vagrant is even still the recommended method to develop a plugin for Countly as the "CONTRIBUTING.md" is also already 5 years old.
Are there better solutions meanwhile? (Digital ocean is not an option for me, unfortunately).

@ar2rsawseen
Copy link
Member

Hello,
This is the problem with contributions :D
Someone contributes something, like a Vagrant file, but no one maintains it later. We definitely don't support it internally.

From an OS perspective, we only support Ubuntu and Centos/RHEL.

For local development, I would suggest using Docker containers, but I am honestly not sure how it would work on Windows.
I know someone tried to run it on Mac M1 and had problems with bitnami images, so they needed to replace them with something more compatible.

@ar2rsawseen
Copy link
Member

Would you be ok with having a discussion/call about this?
Then we can both see how we can help you and align together on the vision of the feature.

@yuisheaven
Copy link
Author

Would you be ok with having a discussion/call about this? Then we can both see how we can help you and align together on the vision of the feature.

I thank you very much for the offer and agree that a call would be helpful. I therefore sent you an email to the address linked to your github profile

@yuisheaven
Copy link
Author

Meanwhile, I've got news about the reason why the Vagrantfile did not work. I suppose this is very different on each operating system.
I am mainly in windows and the original Vagrantfile mounted all files from the github repository from the host system (so windows in my case) to the guest system. On this way, the permissions are not correctly set and it seems like some part of an automatic git download failed too, which was why it did not start.

For the Vagrantfile: Updating the OS to the current ubuntu and changing the automatic shell deployment to use your recommended self-install script wget -qO- https://c.ly/install | bash in the right directory of the guest system, it is now working. I attached the Vagrantfile which worked. There currently is a host volume mount within, but it is not required, just optional.

Regarding the normal install in ubuntu (tested in a Virtualbox Ubuntu22), we noticed that it is very important where a user starts the wget -qO- https://c.ly/install | bash command and with which user and which shell. In our environment, it only worked like this:

  • In bash: sudo su -
  • switch to the /opt directory (seems to be necessary for the script to work): cd /opt
  • wget -qO- https://c.ly/install | bash

Simply using sudo instead of switching to the root bash did not work for us and it also failed when trying to execute the script in a directory other than /opt.

I hope this helps.

Best regards,
Tobi

Vagrantfile.zip

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

2 participants