Skip to content
Notifications
Clear all

Anyone else having issues with the CLI tool on Linux? It keeps crashing.

10 Posts
10 Users
0 Reactions
32 Views
(@cloud_ops_learner_2)
Honorable Member
Joined: 4 months ago
Posts: 561
Topic starter   [#22387]

Hey folks! I've been trying to integrate NordLayer into our automated cloud deployment workflows, specifically using the CLI tool on an Ubuntu 22.04 bastion host. The goal is to bring up secure connections for our Terraform and Ansible runs automatically.

But man, I keep hitting a wall! The `nordlayer` CLI tool crashes consistently for me. It seems to happen randomlyβ€”sometimes during `login`, sometimes when running `connect`. The process just dies without a helpful error message. 😕

Here's a snippet of what I'm trying to do in a script:
```bash
#!/bin/bash
# Attempt to login and connect to a specific server
nordlayer login --username $NORD_USER --password $NORD_PASS
if [ $? -eq 0 ]; then
nordlayer connect --group aws_us_east
else
echo "Login failed"
fi
```

Has anyone else run into this? Specifically:
* Are there known stability issues with the Linux CLI version?
* Could it be a conflict with existing network managers (like systemd-networkd)?
* Any workarounds to make it more stable for automation?

I really want to like this tool for our Infrastructure-as-Code pipeline, but the crashes are a major blocker. Would love to hear if the community has found fixes or alternatives for scripting secure VPN connections.

~CloudOps


Infrastructure as code is the only way


   
Quote
(@emmae)
Reputable Member
Joined: 2 months ago
Posts: 255
 

Oh, that sounds super frustrating! I haven't tried automating NordLayer like that yet, but random crashes are a total blocker for a pipeline. Have you checked if there are any system logs that might give you a clue? Something like `journalctl` output right after it dies?

I'm curious, does it crash in the same way if you run the commands manually in your terminal, not from the script? That might help figure out if it's something about the environment when it's run automatically.



   
ReplyQuote
(@emilya)
Reputable Member
Joined: 3 months ago
Posts: 323
 

Good call on system logs. journalctl -xe is always my first step when a CLI tool dies silently.

But if this is a daemon or service crash, there might also be a core dump. Check /var/crash/ or run `coredumpctl list`. If you find one, `coredumpctl debug` can give you a stack trace, which is infinitely more useful than "it died".

To answer your question about manual vs. script: environment differences are the usual suspect. A script might not have the same PATH, or it could be running in a stripped-down shell without necessary libraries. Always compare `env` outputs.


Prove it with a benchmark.


   
ReplyQuote
(@claireb)
Reputable Member
Joined: 3 months ago
Posts: 250
 

I haven't integrated it into an IaC pipeline yet, but the random crashes during both `login` and `connect` operations you describe are a serious red flag for any automated process. My immediate thought is environment variable handling; passing credentials via `$NORD_USER` and `$NORD_PASS` could be problematic if the CLI expects a specific tty or interactive session, even if it accepts those flags.

You asked about conflicts with network managers. That's a strong possibility. On Ubuntu 22.04, NetworkManager and systemd-resolved are active by default. I'd suggest testing with the CLI's `--verbose` flag if it exists, and also temporarily disabling any other VPN or network configuration services on that bastion host to isolate the conflict. For a quick diagnostic, compare the output of `ip link` and `resolvectl status` before and after a crash event.

If the core dump analysis user1054 suggested doesn't yield a clear stack trace, you might need to treat the CLI as an unstable component and wrap it in a restart loop with exponential backoff in your script - a frustrating but sometimes necessary workaround for automation with flaky tools. Have you checked NordLayer's own support channels for known issues with Ubuntu 22.04 LTS?


Method over hype


   
ReplyQuote
(@danielr23)
Reputable Member
Joined: 3 months ago
Posts: 359
 

Random crashes in a pipeline tool are a non-starter. Been there.

Skip the script wrapper for now. You need to isolate the failure mode. Run it manually from a clean terminal with `strace -f`.

```bash
strace -f -o nord_crash.log nordlayer login --username "$NORD_USER" --password "$NORD_PASS"
```

Check the last syscalls before the crash. Likely a race condition with network namespace setup or a missing library. It's often a failed `connect()` to a local daemon or a permission issue with `/dev/net/tun`.

Also, don't trust the exit code check in your script. If the daemon forks and dies, the CLI might return 0 before the crash.

For automation, consider if you really need this specific tool. A crashing VPN client on a bastion host is a single point of failure you can't afford.


Trust, but verify


   
ReplyQuote
(@chrisw2)
Reputable Member
Joined: 2 months ago
Posts: 309
 

Good suggestions in this thread already, especially `strace`. I'd add checking the exact version you're running - `nordlayer --version`. Sometimes the packaged version in a distro's repo is ancient and buggy compared to the direct download.

Also, for automation on a bastion host, I'd avoid the full CLI if it's flaky. Have you looked at whether they offer a simple API or even just the underlying OpenVPN/WireGuard configs? You could script the connection directly with `wg-quick` if they provide the config, which is way more stable for a pipeline.

If you're stuck with the CLI, run it inside `systemd-run` with a tight timeout to see if it's hanging before it crashes.


Run it yourself.


   
ReplyQuote
(@emma23)
Reputable Member
Joined: 3 months ago
Posts: 212
 

Oof, random crashes in a pipeline are a nightmare. I hit similar issues with a different SaaS CLI last year.

Have you tried running it with `timeout`? I found that sometimes the CLI was hanging on a DNS lookup or waiting for a lockfile, and the script would treat that as a crash. Adding `timeout 30 nordlayer login...` helped me spot the difference between a hang and a real segfault.

If it's a genuine crash, strace is your best bet like others said. Look for "SIGSEGV" in the output.


Trial first, ask later.


   
ReplyQuote
(@gregm)
Honorable Member
Joined: 3 months ago
Posts: 424
 

Yeah, journalctl's a decent start, but if the CLI is crashing hard it probably won't leave a polite message there. It's more likely to get a SIGSEGV and vanish before logging anything useful. The system logs are good for daemon issues, but a flaky CLI binary often just takes its secrets to the grave.

And asking if it crashes the same way manually versus in a script is the right basic diagnostic step, but it's almost always yes. The real question is whether it's a timing or race condition issue that only shows up under the specific constraints of a pipeline run.


Trust but verify


   
ReplyQuote
 amyt
(@amyt)
Reputable Member
Joined: 3 months ago
Posts: 221
 

Ugh, random CLI crashes in a pipeline are the worst. Been there with other tools.

I'd second checking the version, like user1506 mentioned. The packaged version in some repos is a major headache compared to a direct download from NordLayer's site. Might be an easy fix.

For stability on a bastion host, have you considered just using the native WireGuard configs they provide? I've found piping a stable `wg-quick` command into an automation script is way more reliable than hoping a closed-source CLI won't segfault. It's a few more lines of config management, but way less stress.

That `strace` suggestion is gold for debugging the actual crash, though. If you find it's a race condition, you could try adding a small `sleep 2` between your login and connect commands as a band-aid. Not elegant, but sometimes it's enough to keep a pipeline moving while you find a real fix.



   
ReplyQuote
(@annie82)
Reputable Member
Joined: 3 months ago
Posts: 232
 

Oh wow, that sounds exactly like the kind of thing that would completely derail a pipeline. I haven't used NordLayer's CLI specifically, but I've had similar random crashes with other SaaS tools during trial setups.

The suggestion about checking for WireGuard configs really stands out to me. If the core tool is this unstable, maybe the best workaround is to bypass it entirely for the actual connection. Have you checked your NordLayer account portal to see if you can download a raw WireGuard config file for that server group? Even if you still need the CLI for login, maybe you could use it just to fetch the config, then handle the connection with the native `wg-quick` command, which is rock solid.

It's frustrating when the official tool is the weak link. Did the `strace` command reveal anything useful yet?



   
ReplyQuote