Git repos hungs up unexpectedly - django

There is a strange thing.. I can clone small files repos, but when it starts to take some time, it hangs up. Like:
$ pip install -e git+https://github.com/django/django.git#egg=Django
Obtaining Django from git+https://github.com/django/django.git#egg=Django
Cloning https://github.com/django/django.git to ./virtualenvs/prp/src/django
error: RPC failed; result=56, HTTP code = 0
fatal: The remote end hung up unexpectedly
Complete output from command /usr/bin/git clone -q https://github.com/django/django.git /home/mamber/virtualenvs/prp/src/django:
----------------------------------------
Command /usr/bin/git clone -q https://github.com/django/django.git /home/mamber/virtualenvs/prp/src/django failed with error code 128 in None
Storing complete log in /home/mamber/.pip/pip.log
I've tried with some other public repos and getting the same result.
I also tried just cloning the repo, without virtualenv and pip, same result:
$ git clone https://github.com/django/django.git
Cloning into 'django'...
error: RPC failed; result=56, HTTP code = 0
fatal: The remote end hung up unexpectedly
Maybe there is some timeout config I need to change. I see no traffic in my system monitor while waiting.
I am doing that in a fresh installed Linux Mint, with fresh installed apt-get install git (with no configurations).
Any ideas?

Related

Vmware on Arch: Could not open /dev/vmmon: No such file or directory

I want to install VMware Workstation on Arch. I used the command yay -S vmware-workstation to install. After installation finished, I ran VMware, created an VM, started it, and got the error:
Could not open /dev/vmmon: No such file or directory.
Please make sure that the kernel module `vmmon' is loaded.
I tried to install linux-header but it still didn't work.
OS: Arch Linux, 5.10.56-1-lts.
Thanks for any help!
I ran into this problem too, and the solutions I found online ended up having their own problems that needed to be solve, which I'll document here.
To solve the error Could not open /dev/vmmon/: you need to run:
sudo vmware-mod-config --console --install-all
If this returns an error about Glib not having support, you need to clone https://github.com/mkubecek/vmware-host-modules.git and make it.
$ git clone https://github.com/mkubecek/vmware-host-modules.git
$ cd vmware-host-modules
$ git checkout -b 16.2.1 origin/workstation-16.2.1
$ sudo make
If this returns an error containing fatal error: generated/autoconf.h: No such file or directory, you need to install linux-headers and make sure it matches your linux kernel version. Probably also make sure your kernel is up to date, although I'm not sure if that's necessary.
$ sudo pacman -S linux
$ sudo reboot
$ sudo pacman -S linux-headers
Now you should be able to make install in that cloned repo, which should install the required modules for you to be able to run the vmware-mod-config --console --install-all command, which should solve the issue.
So working backwards, the steps are:
Update your linux kernel and install the right linux-headers for it.
Clone this git repo, cd into it, git checkout -b 16.2.1 origin/workstation-16.2.1, and run sudo make install
Run sudo vmware-mod-config --console --install-all
More about can be found at my post here: https://bbs.archlinux.org/viewtopic.php?pid=2020372#p2020372
I also encountered same problem. Most of the stackoverflow pages suggest to reinstall the vmware but its not a fair solution and even its not a solution. Its just like if you have pain in teeth remove that teeth.
Another thing is that some post and even vmware official posts said to disable secure boot.
But after trying both nothing changed so i goto to cd /dev and found that the file vmmmon exists.
And when i tries to load the file it loaded successfully.
So from here i concluded that to solve this issue do the following:
Either disable the secure boot or sign the vmmon.
CD to /dev/
Load vmmon using modprobe
and as always Happy coding....
The command: sudo vmware-modconfig --console --install-all works, but every time that I reboot the system the error come out again.
In my case, the cause of this problem was the vmmon didn't be load. So I just
sudo modprobe -v vmmon
and it work.

Deploying Rails 6.0 to AWS EB, Webpacker requires Node.js version error

I am attempting to upload a rails app that was recently updated from rails 5.2 to 6 to AWS Elastic Beanstalk. We had someone else working on this, but with the pandemic he had to step away - and now our site is kind of in limbo and I have not been able to update it. I have searched many different variations of my problem but no solutions have worked yet.
The app was working on EB with rails 5.2. I have the app running in 6.0 locally. When I eb deploy I get this error:
MacBook-Pro:app $ eb deploy
Starting environment deployment via CodeCommit
--- Waiting for Application Versions to be pre-processed ---
Finished processing application version app-0e294-200420_110159
2020-04-21 00:22:24 INFO Environment update is starting.
2020-04-21 00:23:07 INFO Deploying new version to instance(s).
2020-04-21 00:27:59 ERROR [Instance: i-0e613ac1fe175f3f6] Command failed on instance. Return code: 1 Output: (TRUNCATED)...-- : Writing /var/app/ondeck/public/assets/application-06fe3df6175ba0def3d0e732489f883d0c09de.css.gz
Webpacker requires Node.js ">=10.13.0" and you are using v6.17.1
Please upgrade Node.js https://nodejs.org/en/download/
Exiting!.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2020-04-21 00:27:59 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2020-04-21 00:28:00 ERROR Unsuccessful command execution on instance id(s) 'i-0e613ac1fe175f3f6'. Aborting the operation.
2020-04-21 00:28:00 ERROR Failed to deploy application.
ERROR: ServiceError - Failed to deploy application.
It was giving me a bundler error before this, that I was able to fix by adding a file into .ebextensions that installs the correct version of bundler. I figured the solution to this would be similar.
This post was close to my problem:
Deploy rails react app with webpacker gem on AWS elastic beanstalk
So I added this file to my .ebextensions based off the selected answer of that:
01_update_note.config
commands:
01_download_nodejs:
command: curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -
02_install_nodejs:
command: yum -y install nodejs
However, it did not appear to do anything, I still get the same error. I tried a couple variations of the file based off a few other blog posts about the issue, but the error remains. Is anyone able to point me in the right direction or offer any insight into the problem? I apologize for not being very familiar with AWS or EB yet, but I will do my best to answer additional questions.
Maybe it is caused by yarn install later.
I try the following scripts and remove yarn install then set RAILS_SKIP_ASSET_COMPILATION=false and it works for me.
commands:
01_install_yarn:
command: "sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash - && sudo yum install yarn -y"
02_download_nodejs:
command: curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash -
03_install_nodejs:
command: yum -y install nodejs
04_install_packages:
command: sudo yum install -y yarn
This is how I did it on Amazon Linux 2:
Create this file in .platform/hooks/prebuild/yarn_config.sh:
#!/usr/bin/env bash
curl --silent --location https://rpm.nodesource.com/setup_16.x | sudo bash -
sudo yum -y install nodejs
sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo
sudo yum -y install yarn
yarn install
Give it the right permission: chmod +x .platform/hooks/prebuild/yarn_config.sh
And the error is gone, while you assets still compile (unlike with accepted answer)

not ok 1 PhantomJS exited unexpectedly when running `ember test` on CI

Since updating to ember-cli 1.13.8 and Ember 2.0.0 (from 1.13.1 / 1.12.x) I can't get the test suite to run on CircleCI, because of the error:
not ok 1 PhantomJS - Browser "phantomjs /home/ubuntu/app-name/node_modules/ember-cli/node_modules/testem/assets/phantom.js http://localhost:7357/7887" exited unexpectedly.
1..1
tests 1
pass 0
fail 1
npm ERR! Test failed. See above for more details.
npm test returned exit code 1
It used to work before and what is weird, it works locally (OS X El Capitan, PhantomJS 2.0). On CircleCI it also runs on 2.0 version which is installed the following way:
$ sudo apt-get update; sudo apt-get install libicu52
$ curl --output /home/ubuntu/bin/phantomjs-2.0.1-linux-x86_64-dynamic https://s3.amazonaws.com/circle-support-bucket/phantomjs/phantomjs-2.0.1-linux-x86_64-dynamic
$ chmod a+x /home/ubuntu/bin/phantomjs-2.0.1-linux-x86_64-dynamic
$ sudo ln -s --force /home/ubuntu/bin/phantomjs-2.0.1-linux-x86_64-dynamic /usr/local/bin/phantomjs
Tried also downloading it from the Travis, but still the same thing happened.
Any idea what's the cause and how to solve it?
Try running phantomjs individually to find out which dependency is failing, I had the same issue on a Docker container and after running it i found out I needed an extra library to run it.
I was lacking the following dependencies on Ubuntu
libgtk2.0-0 libidn11 libglu1-mesa
Actually after updating Ember to 2.3.1 PhantomJS started to work without any problems, no idea what's the real reason behind this, but if anyone experiences this issue, try updating Ember and check again.

Docker build has no network, but docker run has

If I want to build my Dockerfile, it can't connect to the network or at least DNS:
Sending build context to Docker daemon 15.95 MB
Sending build context to Docker daemon
Step 0 : FROM ruby
---> eeb85dfaa855
Step 1 : RUN apt-get update -qq && apt-get install -y build-essential libpq-dev
---> Running in ec8cbd41bcff
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/InRelease
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/InRelease
W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/Release.gpg Could not resolve 'httpredir.debian.org'
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/Release.gpg Could not resolve 'httpredir.debian.org'
W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg Could not resolve 'security.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package build-essential
INFO[0001] The command "/bin/sh -c apt-get update -qq && apt-get install -y build-essential libpq-dev" returned a non-zero code: 100
But if I run exactly the same command via docker run it works:
docker run --name="test" ruby /bin/sh -c 'apt-get update -qq && apt-get install -y build-essential libpq-dev'
Does anybody have an idea, why docker build does not work? I have tried all DNS related tipps on StackOverflow, like starting docker with --dns 8.8.8.8 etc.
Thanks in advance
Check what networks are available on your host with the below command:
docker network ls
then pick one that you know is working, the host one could be a good candidate.
Now assuming you are in the directory where it is available your Dokerfile, build your image appending the flag --networks and change the <image-name> with yours:
docker build . -t <image-name> --no-cache --network=host
Docker definitely seems to have some network issues. I managed to fix this problem with
systemctl restart docker
... which is basically just the unix-level 'restart-the-daemon' command in Debian 8.
I had similar problem. But as I was running AWS linux i had no systemctl. I solved using:
sudo service docker restart
My docker build also failed while trying to run apt-get upgrade with the exact same errors. I was using docker-machine on Mac OSX and a simple docker-machine restart default solved this issue. No idea what initially caused this, though.
Another case of the above reported behaviour - this time building a docker image from Jenkins:
[...]
Step 3 : RUN apt-get update && apt-get install -y curl libapache2-mod-proxy-html
---> Running in ea7aca5dea9b
Err http://security.debian.org jessie/updates InRelease
Err http://security.debian.org jessie/updates Release.gpg
Could not resolve 'security.debian.org'
Err http://httpredir.debian.org jessie InRelease
[...]
In my case it turned out that the DNS wasn't reachable from within the container - but still from the docker host !? (The containers resolver configuration was okay(!))
After restarting the docker machine (a complete reboot - a 'docker.service restart' didn't do the trick) it's been working again.
So one of my activities (or of a colleague of mine) must have broken the docker networking then !?? Maybe some firewalld modification activity ???
I'm still investigating as I'm not sure which activity may have corrupted the docker networking then ...
I have the exact same issue with a Raspberry.
Start/stopping the service did not help, but re-installing the package (dpkg -i docker-hypriot_1.10.3-1_armhf.deb && service docker start in my case) immediately solved the situation : apt-get update manages to resolve and reach the servers.
There must be some one-shot actions in the installation process...
Also faced the same issue today. My workaround was to restart your docker-machine. In my case, it's on VirtualBox.
Once you power off it and then restart the machine, http://security.debian.org seemed resolved.
Hope this helps.
A couple of suggestions, not sure if they will work or not. Can you change the ...apt-get install -y... to ...apt-get install -yqq...
Also, has that image changed that you're trying to build from?

How do I make bower install work with aws.push?

As a starting point to making my own app that uses meanjs, I went to the meanjs website and used their yeomen generator to create the template/sample app. Following the instructions getting the sample application running out of the box on my local desktop machine worked within minutes. To complete the exercise I tried to deploy the sample app to an AWS/EC2 instance before making any changes to it. I have used the command line deployment tools in the past and liked it. Also it is nice how now you can just select an EC2 Linux instance with node and npm already installed and ready.
After checking the sample into git, I run "git aws.push" to deploy the app.
The problem is in the package.json the line:
"postinstall": "bower install --config.interactive=false"
In the eb-activity.log:
npm WARN cannot run in wd meansample#0.0.1 bower install --config.interactive=false (wd=/tmp/deployment/application)
The result is that AngularJS ends up not getting installed in /public/lib.
First thing I tried was giving the full path in the package.json file: node_modules/bower/bin/bower. This didn't help and results in the same error. Also noting that other commands like "grunt" don't need the full path specified in the package.json and they work.
I don't understand enough of the black box magic that aws.push does to understand why this error is happening. For example what user does it run as? What permissions does that user have? what options if any does it use when it runs npm install?
I did figure out a work-around, but it adds a lot of extra steps that shouldn't be required if aws.push was able to run bower install directly. Basically I can manually run the bower install in the ssh client connected to my EC2 instance, set the owner/group on the installed files, and restart the server.
Work-around steps:
1) On local command prompt run git aws.push. Wait for unsuccessfully deployment to finish.
2) Connect ssh client to EC2 instance. From the command prompt:
cd /var/app/current
/* NOTE: if I don't use sudo the ec2user I am logged in as does not have permission to create /public/lib needed to install AngularJS into*/
sudo node_modules/bower/bin/bower install --config.interactive=false --allow-root
/* NOTE: just changing the owner and group to match the same as the other files that aws.push deployed */
sudo chown -R nodejs public/lib
sudo chgrp -R nodejs public/lib
From AWS dashboard, select the correct EC2 instance, Action = Restart App Server(s)
Now AngularJS is install and the sample app works.
How do I eliminate the extra steps and make it so aws.push can do the bower install successfully?
I have experienced the same problem when trying to publish my nodejs app in a private server running CentOs using root user. The same error is fired by "postinstall": "./node_modules/bower/bin/bower install" in my package.json file so the only solution that was working for me is to use both options to avoid the error:
1: use --allow-root option for bower install command
"postinstall": "./node_modules/bower/bin/bower --allow-root install"
2: use --unsafe-perm option for npm install command
npm install --unsafe-perm