Any Reason Asterisk Won’t Start Without A Rebuild On A Cloned VPS?

Home » Asterisk Users » Any Reason Asterisk Won’t Start Without A Rebuild On A Cloned VPS?
Asterisk Users 7 Comments

Any ideas why a VPS, cloned from another instance (DigitalOcean
“droplets” if it matters), won’t run on the new instance?

Everything else is the same; region, memory, disk, hypervisor version etc.

And everything else runs, just not Asterisk, unless I do a make distclean in the /usr/src/asterisk directory, rebuild, and then it runs just fine.

I’d understand if I was moving it to a machine with a different kernel, but this is just a cloned instance.

Here’s the kernel log for that time:

Nov 25 15:45:41 kernel: [ 519.943161] traps: asterisk[1909] trap invalid opcode ip:55a2ce786b63 sp:7ffc0f2604e0 error:0 in asterisk[55a2ce68b000+2f6000]
Nov 25 15:46:19 kernel: [ 557.633108] traps: asterisk[2677] trap invalid opcode ip:560385143b63 sp:7ffd846cb540 error:0 in asterisk[560385048000+2f6000]
Nov 25 15:46:22 kernel: [ 560.387907] traps: asterisk[2678] trap invalid opcode ip:5618d09a5b63 sp:7fff731341a0 error:0 in asterisk[5618d08aa000+2f6000]
Nov 25 15:46:28 systemd[1]: Starting LSB: Asterisk PBX… Nov 25 15:46:28 asterisk[2684]: * Starting Asterisk PBX: asterisk Nov 25 15:46:28 kernel: [ 566.681372] traps: asterisk[2692] trap invalid opcode ip:55b01c3feb63 sp:7ffd99b0dec0 error:0 in asterisk[55b01c303000+2f6000]
Nov 25 15:46:28 asterisk[2684]: Illegal instruction Nov 25 15:46:28 kernel: [ 566.689693] traps: asterisk[2696] trap invalid opcode ip:562036befb63 sp:7fff80876c80 error:0 in asterisk[562036af4000+2f6000]
Nov 25 15:46:28 systemd[1]: asterisk.service: Control process exited, code=exited status2
Nov 25 15:46:28 systemd[1]: Failed to start LSB: Asterisk PBX. Nov 25 15:46:28 systemd[1]: asterisk.service: Unit entered failed state. Nov 25 15:46:28 systemd[1]: asterisk.service: Failed with result ‘exit-code’.

BTW, while I’m in the log, any idea what this is about (less important)
63:Nov 28 11:31:23 kernel: [243839.969623] INFO: task asterisk:13711
blocked for more than 120 seconds.

7 thoughts on - Any Reason Asterisk Won’t Start Without A Rebuild On A Cloned VPS?

  • You probably need to select “DONT_OPTIMIZE” in make menuselect under
    “Compiler Flags”. This is generally required for VPS or any situation where the binary might be used on a slightly different CPU.

    Hope this helps

    -Barry Flanagan

  • Close! The compiler flag to disable is BUILD_NATIVE. It instructs GCC to build optimized for the CPU, if the binary is moved to a CPU that differs – it may or may not work depending on how close they are.

  • Thanks for the super-quick answer! Now I was able to find this:
    https://wiki.asterisk.org/wiki/display/AST/Building+and+Installing+Asterisk#BuildingandInstallingAsterisk-Buildingfornon-nativearchitectures

    I had just assumed a cloned vps would be identical.

    Out of interest, how unoptimized would the result be?

    I mean, on a low-end VPS with maybe 3 simultaneous calls at most and runs almost idle even then, is the difference going to be noticeable at all?

    Thanks again.

  • BTW, I had to disable it by defualt in the FreeBSD port, otherwise the official binary packages would be broken on CPUs different from the ones used by the FreeBSD project build cluster.

    I think all linux distributions are/should do the same for default package builds.

  • In fact there are chances the CPU will not be the same even by stopping and then restarting the same VM. The Hypervisor could choose to start the same VM on different iron depending on it’s load balancing settings and whim at the moment.