# Synthetics push command issues

**URL:** https://discuss.elastic.co/t/synthetics-push-command-issues/325650
**Category:** Synthetics
**Created:** [February 15, 2023, 4:56pm UTC](https://discuss.elastic.co/t/synthetics-push-command-issues/325650 "2023-02-15T16:56:27Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![BenB196](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benb196/32/83401_2.png) [@BenB196](https://discuss.elastic.co/u/BenB196)
#### Post date: [February 15, 2023, 4:56pm UTC](https://discuss.elastic.co/t/synthetics-push-command-issues/325650/1 "2023-02-15T16:56:27Z")

</div>

Hi All,

I'm testing out the `npx @elastic/synthetics push` command, but I'm running into a few issues, and was wondering if anyone has any ideas on how to fix them.

1. Push command doesn't respect NodeJS TLS settings.

I have Kibana behind a HTTPS with the cert being signed by a private CA. I'm trying to run the push command, but continuously get the error

```auto
Error: unable to get local issuer certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)
    at TLSSocket.emit (node:events:390:28)
    at TLSSocket._finishInit (node:_tls_wrap:944:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12) {
  code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
}

```

I attempt 2 workarounds, but neither worked:

`set NODE_TLS_REJECT_UNAUTHORIZED=0`  
`npm config set strict-ssl false`

An interesting note. The above settings work for the `npx @elastic/synthetics init` command. So, I suspect the issue is specific to the `push` command.

1. Lightweight monitors seem to expect to be in a file called `heartbeat.yml`

I would like to be able to have a project structure like:

```auto
lightweight/
    ICMP.yml
    TCP.yml
    HTTP.yml

```

An example of the contents of `ICMP.yml`

```auto
heartbeat.monitors:
  - type: icmp
    name: google.com
    id: google
    enabled: true
    hosts: ["google.com."]
    schedule: "@every 20s"

```

Then run a push command which only deploys a single file to a set of locations, using the `--pattern` option:

`npx @elastic/synthetics push --auth <token> --url <url> --id icmp --space default --private-locations 'ICMP' --pattern "lightweight/ICMP.yml"`

But when I run the above command, I get the following error:

```auto
C:\...\lightweight\ICMP.yml:1
heartbeat.monitors:
                  ^

SyntaxError: Unexpected token ':'
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1025:15)
    at Module._compile (node:internal/modules/cjs/loader:1059:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
    at Object.newLoader [as .js] (E:\GitHub\monitors\elastic-agents\synthetics\node_modules\pirates\lib\index.js:141:7)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at requireSuites (E:\GitHub\monitors\elastic-agents\synthetics\node_modules\@elastic\synthetics\src\loader.ts:123:5)

Node.js v17.0.1

```

Switching the file name from `ICMP.yml` to `heartbeat.yml` clears this error, but then breaks the desired project/file structure.

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [February 16, 2023, 10:35am UTC](https://discuss.elastic.co/t/synthetics-push-command-issues/325650/2 "2023-02-16T10:35:49Z")

</div>

Hi @BenB196, can you confirm which version of the `@elastic/synthetics` package that you're using?

---

<div class="post-metadata">

### Author: ![BenB196](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benb196/32/83401_2.png) [@BenB196](https://discuss.elastic.co/u/BenB196)
#### Post date: [February 16, 2023, 12:23pm UTC](https://discuss.elastic.co/t/synthetics-push-command-issues/325650/3 "2023-02-16T12:23:32Z")

</div>

Hi @carly.richmond, sure, below is the output of the version command:

```auto
npx @elastic/synthetics --version
1.0.0-beta.40

```

I believe that this is the current latest version from what I could find on GitHub.

---

<div class="post-metadata">

### Author: ![shahzad31](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shahzad31/32/51637_2.png) [@shahzad31](https://discuss.elastic.co/u/shahzad31)
#### Post date: [February 22, 2023, 9:56am UTC](https://discuss.elastic.co/t/synthetics-push-command-issues/325650/5 "2023-02-22T09:56:33Z")

</div>

if it doesn't allows file name as `ICMP.yml`, i believe this seems to be a bug. Can you please open an issue in the repo. We will fix it in upcoming release.

cc @vigneshshanmugam

---

<div class="post-metadata">

### Author: ![shahzad31](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shahzad31/32/51637_2.png) [@shahzad31](https://discuss.elastic.co/u/shahzad31)
#### Post date: [February 22, 2023, 9:57am UTC](https://discuss.elastic.co/t/synthetics-push-command-issues/325650/6 "2023-02-22T09:57:57Z")

</div>

We will test the push command with Kibana behind a HTTPS with the cert being signed by a private CA. Could be an issue as well.

---

<div class="post-metadata">

### Author: ![BenB196](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benb196/32/83401_2.png) [@BenB196](https://discuss.elastic.co/u/BenB196)
#### Post date: [February 22, 2023, 11:53am UTC](https://discuss.elastic.co/t/synthetics-push-command-issues/325650/7 "2023-02-22T11:53:21Z")

</div>

Thanks @shahzad31 I've opened [synthetics push command with lightweight monitors doesn't work for files other than heartbeat.yml · Issue #705 · elastic/synthetics · GitHub](https://github.com/elastic/synthetics/issues/705) for this.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 18, 2023, 11:53am UTC](https://discuss.elastic.co/t/synthetics-push-command-issues/325650/8 "2023-03-18T11:53:52Z")

</div>

This topic was automatically closed 24 days after the last reply. New replies are no longer allowed.
