Skip to content

Instantly share code, notes, and snippets.

@blackwood821
blackwood821 / triton_image_copy_issue.md
Last active November 15, 2021 17:45
Triton Image Copy Issue
1. Copy image from DC1 to DC2 (19:06)
    triton image cp: error: error copying image: CloudAPI service is currently unavailable
2. Attempted to re-copy image from DC1 to DC2
    already exists
3. Deleted image from DC2
4. Re-copied image from DC1 to DC2 (succeeded)
5. Reprovisioned some VMs in DC2 to the image that was just copied to DC2
6. An hour after the initial copy image job (step 1 above) started it finally timed out 
 and Triton automatically deleted the image from IMGAPI (image still installed on CNs though)
@blackwood821
blackwood821 / alpine_drill.md
Last active November 8, 2021 18:22
Alpine DNS Issue

Alpine 3.14 (and 3.13):

/ # ping svn.vrcis.local
ping: bad address 'svn.vrcis.local'
/ # cat /etc/resolv.conf 
# DNS requests are forwarded to the host. DHCP DNS options are ignored.
[root@build ~/smartos-live]# make check
Submodule 'deps/eng' (https://github.com/joyent/eng.git) registered for path 'deps/eng'
Cloning into '/root/smartos-live/deps/eng'...
ls: cannot access 'projects/local': No such file or directory
head: cannot open '/root/smartos-live/proto/buildstamp' for reading: No such file or directory
head: cannot open '/root/smartos-live/proto/buildstamp' for reading: No such file or directory
head: cannot open '/root/smartos-live/proto/buildstamp' for reading: No such file or directory
Makefile:123: projects/illumos/usr/src/Makefile.testarchive: No such file or directory
make: *** No rule to make target 'projects/illumos/usr/src/Makefile.testarchive'. Stop.
@blackwood821
blackwood821 / triton-docker.md
Last active September 29, 2021 17:14
Triton Docker CLI issue
Chads-MacBook-Pro:~ chad$ eval "$(triton env)"
Chads-MacBook-Pro:~ chad$ echo $DOCKER_CERT_PATH
/Users/chad/.triton/docker/cschmelter@10_10_50_10
Chads-MacBook-Pro:~ chad$ triton-docker --help | grep tls
  --tls                                                         Use TLS; implied by --tlsverify
  --tlscacert=~/.triton/docker/cschmelter@10_10_50_10/ca.pem    Trust certs signed only by this CA
  --tlscert=~/.triton/docker/cschmelter@10_10_50_10/cert.pem    Path to TLS certificate file
  --tlskey=~/.triton/docker/cschmelter@10_10_50_10/key.pem      Path to TLS key file
  --tlsverify                                                   Use TLS and verify the remote
@blackwood821
blackwood821 / docker_heredoc.md
Created September 28, 2021 14:42
Dockerfile heredoc
RUN <<EOD
#!/usr/bin/env bash

cat <<EOF > foo
bar
EOF

EOD
@blackwood821
blackwood821 / log.md
Created September 24, 2021 15:21
postgres standby WAL creation issue
2021-09-23 22:01:46.174 UTC [14711]: user=,db=,app=,client= DEBUG:  could not restore file "0000000100000008000000A4" from archive: child process exited with exit code 0
2021-09-23 22:01:46.174 UTC [14711]: user=,db=,app=,client= DEBUG:  could not open file "pg_xlog/0000000100000008000000A4": No such file or directory
2021-09-23 22:01:46.174 UTC [14711]: user=,db=,app=,client= DEBUG:  switched WAL source from archive to stream after failure
2021-09-23 22:01:47.490 UTC [14703]: user=,db=,app=,client= DEBUG:  postmaster received signal 2
2021-09-23 22:01:47.490 UTC [14703]: user=,db=,app=,client= LOG:  received fast shutdown request
2021-09-23 22:01:47.490 UTC [14703]: user=,db=,app=,client= LOG:  aborting any active transactions
2021-09-23 22:01:47.490 UTC [14711]: user=,db=,app=,client= DEBUG:  shmem_exit(1): 1 before_shmem_exit callbacks to make
2021-09-23 22:01:47.490 UTC [14719]: user=,db=,app=,client= DEBUG:  shmem_exit(0): 1 before_shmem_exit callbacks to make
2021-09-23 22:01:47.490 UTC [14719]: use
@blackwood821
blackwood821 / error.md
Last active September 17, 2021 19:16
CloudAPI CreateMachine Error

From the CloudAPI log file:

==> /var/svc/log/smartdc-application-cloudapi:cloudapi-8082.log <==
[2021-09-17T17:11:55.265Z]  WARN: cloudapi/audit/985392 on a49ebf8b-e389-4992-a810-1e5c28bfd0c4: handled: 500 (req_id=4e92948c-5a93-45bb-ad24-792b3d026943, audit=true, remoteAddress=10.10.50.156, remotePort=55742, latency=4280, route=createmachine, _audit=true)
    POST /tlaurin/machines HTTP/1.1
    host: 10.10.50.10
    user-agent: triton-go/1.4.0-dev (amd64-linux; go1.15.8)
    content-length: 282
    accept: application/json
version: "2.0"
services:
nginx:
image: nginx
container_name: nginx01
ports:
- "80:80"
volumes:
- data01:/data
network_mode: bridge
@blackwood821
blackwood821 / supervisord.md
Last active July 15, 2021 15:06
Supervisord doesn't autorestart when autostart is false

Here is my supervisord.conf:

[supervisord]
nodaemon=true
user=root
loglevel = debug

[program:install]
command=/opt/admin/boot/install.sh
user=root
tasks:
- name: include tasks only if files exist
include_tasks: "{{ item }}"
ignore_errors: true
loop:
- "{{ ansible_os_family | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_pkg_mgr | lower }}.yml"
- "{{ ansible_service_mgr | lower }}.yml"