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

Loosing network on OVH VPS #18

Open
charlycoste opened this issue Jul 16, 2017 · 15 comments
Open

Loosing network on OVH VPS #18

charlycoste opened this issue Jul 16, 2017 · 15 comments

Comments

@charlycoste
Copy link

I tried on a VPS 2016 SSD 3 from OVH, each of these :

  • Debian 8
  • Debian 9
  • Ubuntu 16.04

And each time I run the script, then installation + reboot are going well. But after that, I can't connect to the VPS anymore. I accessed it by KVM to debug and it seems that the VPS just get disconnected from network.

@elitak
Copy link
Owner

elitak commented Jul 17, 2017

The network detection part of the script is not very robust and assumes digitalocean's idiosyncrasies. Likely , it didn't grab the right settings for your host. I'll probably improve it sometime in the future, but for now, try the following to manually provision your hosts:

(if you have console access to an already-provisioned host, do only step 5, instead using the ip info provided in the OVH web UI, and then nixos-rebuild switch)

  1. copy over the nixos-infect script
  2. edit it
  3. comment out the last 4 lines (makeSwap to reboot)
  4. run source nixos-infect; set +e. This will generate the config files but not try to install everything yet.
  5. edit /etc/nixos/networking.nix, correcting any obvious errors. Use commands ip addr, ip route, and cat /etc/resolv.conf to obtain any missing info. Probably remove eth1 entirely.
  6. edit nixos-infect again, and uncomment the lines you commented
  7. bash -x nixos-infect

Post me the networking.nix contents, if you still can't get it working.

@kniteli
Copy link

kniteli commented Jul 14, 2018

Yeah, for OVH, don't even bother with the networking, just rip it out completely.

Change this:

  imports = [
    ./hardware-configuration.nix
    ./networking.nix # generated at runtime by nixos-infect
    $NIXOS_IMPORT
  ];

to this:

  imports = [
    ./hardware-configuration.nix
    $NIXOS_IMPORT
  ];

I just successfully installed doing that. Debian 9

@elitak
Copy link
Owner

elitak commented Jul 15, 2018

I should probably add a --no-networking option that does this, or detect when the original system's network uses dhcp instead of manual config.

@asymmetric
Copy link
Contributor

Is this still an issue, since we do this?

@charlycoste
Copy link
Author

I'll try to check it out, then tell you if it's okay now.

@charlycoste
Copy link
Author

charlycoste commented May 5, 2019

@asymmetric Yes, this is still an issue.

@TheSirC
Copy link
Contributor

TheSirC commented Jul 3, 2019

I have big issues to make it run on master, does any of you (@asymmetric, @charlycoste, @kniteli ) would have a functioning version ? I could take care of piggy-backing on it to set up a PR for master to function on OVH.

@asymmetric
Copy link
Contributor

Don't use OVH, sorry.

@elitak
Copy link
Owner

elitak commented Jul 4, 2019

@TheSirC if you still need help, attach a .log here with the output after you set -x and run the script (comment out the reboot), because I have no detail on what your "big issues" are.

@TheSirC
Copy link
Contributor

TheSirC commented Jul 5, 2019

@elitak Yes, of course. Here is the error-log :

Error log
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 11.4978 s, 93.4 MB/s
swapon: /tmp/nixos-infect.rbzUv.swp: found swap signature: version 1d, page-size 4, same byte order
swapon: /tmp/nixos-infect.rbzUv.swp: pagesize=4096, swapsize=1073741824, devsize=1073741824

The problem lies in the fact that even with reboot command on the system does not reboot and the instance is not provided with usual NixOS commands (nix-env, nixos-rebuild, etc).
I "bisected" that execution arrive to the makeConf function and just "don't execute it" (I can not find any trace of the commands in there leaving any traces on the system). The script exits with error code 1.

@elitak
Copy link
Owner

elitak commented Jul 5, 2019

Run set -x, before you run the script, for more detail; that should get you the exact line that fails.

@TheSirC
Copy link
Contributor

TheSirC commented Jul 5, 2019

I actually added it to the script itself without further output.
I added to the interactive session with this output :

root@address:~# ./nixos-infect
+ ./nixos-infect

And immediately returning to the interactive prompt.

@TheSirC
Copy link
Contributor

TheSirC commented Jul 6, 2019

After further testing (and multiple reinstalls of the VPS to make sure to work on a clean system each time) I found that :

  1. the script is stopping here, on the grep part; running the command myself sends back an empty string, totally normal the file is empty but does exist ! (that is considered as a fail for grep: it sends back error code 1).
  2. Here the script does not include a refresh of the packages list (e.g. apt-get update) which can make it fail.

Fun fact :
The following commands do not produce the same output and I really would like to know why :

  1. bash -x script (<-- I ran this one to have output on the script)
  2. adding set -x to the script after the shebang
  3. doing set -x in your interactive prompt and then running ./script

TheSirC added a commit to TheSirC/nixos-infect that referenced this issue Jul 6, 2019
Fix both issues cited in this [comment](elitak#18 (comment))
TheSirC added a commit to TheSirC/nixos-infect that referenced this issue Jul 6, 2019
Fix both issues cited in this [comment](elitak#18 (comment))
@TheSirC
Copy link
Contributor

TheSirC commented Jul 6, 2019

So after applying patches for the above-cited issues I opened a pull-request that worked for me on OVH.

elitak pushed a commit that referenced this issue Jul 7, 2019
Fix both issues cited in this [comment](#18 (comment))
@raspher
Copy link

raspher commented Jul 31, 2022

Resolved since 3 years....

Anyway i've similar problem on different budget provider. It's kinda weird -> vps does respond to ping but seems that it have all ports closed. Any ideas what's the problem?

Anyway if i've enought time, i'll try do step by step what this script does and play a little with config. Maybe #61 is the solution?

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

6 participants