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

Client stops working (Event { type: 'error', message: undefined })? #172

Open
DanijelDomazet opened this issue Sep 3, 2021 · 6 comments

Comments

@DanijelDomazet
Copy link

DanijelDomazet commented Sep 3, 2021

My smee client is started as a system process, and works OK for some time, a few hours, and then it seems like the process is "ready", but notifications aren't received.

% > sudo systemctl status smee
smee.service - smee.io webhook delivery from GitHub
   Loaded: loaded (/etc/systemd/system/smee.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2021-09-03 01:27:01 CEST; 13h ago
 Main PID: 9587 (node)
    Tasks: 11 (limit: 4915)
   Memory: 14.8M
   CGroup: /system.slice/smee.service
           └─9587 node /usr/bin/smee -u https://smee.io/1234abcde1234abcde --path /jenkins/github-webhook/ --port 8080

Sep 03 01:27:01 systemd[1]: Started smee.io webhook delivery from GitHub.
Sep 03 01:27:01 smee[9587]: Forwarding https://smee.io/1234abcde1234abcde to http://127.0.0.1:8080/jenkins/github-webhook/
Sep 03 01:27:04 smee[9587]: Connected https://smee.io/1234abcde1234abcde
Sep 03 03:09:02 smee[9587]: Event { type: 'error', message: undefined }
Sep 03 03:09:03 smee[9587]: Connected https://smee.io/1234abcde1234abcde

Could it be that Sep 03 03:09:02 smee[9587]: Event { type: 'error', message: undefined } is the problem?

After I restart the service with sudo /etc/init.d/smee restart, it starts working again, and the status is very similar:

Sep 03 14:31:19 systemd[1]: Started smee.io webhook delivery from GitHub.
Sep 03 14:31:20 smee[9622]: Forwarding https://smee.io/1234abcde1234abcde to http://127.0.0.1:8080/jenkins/github-webhook/
Sep 03 14:31:22 smee[9622]: Connected https://smee.io/1234abcde1234abcde
Sep 03 14:31:53 smee[9622]: POST http://127.0.0.1:8080/jenkins/github-webhook/ - 200

It is just that there is no Event { type: 'error', message: undefined } any more.

Thanks.

@DanijelDomazet
Copy link
Author

Please note that this repeatedly happens: few hours after smee restart, the event Event { type: 'error', message: undefined } happens, and the client stops working. What could confuse it?

@DanijelDomazet
Copy link
Author

DanijelDomazet commented Sep 6, 2021

Can I somehow configure the client to log more info?

@gr2m
Copy link
Contributor

gr2m commented Sep 6, 2021

I don't think we have any additional debug logs that could be enabled. I'd recommend to clone the repository to your machine, run

npm run build

and

npm link .

then the smee should point to the local repository. You can add more console.log() statements directly into the code, just remember to run npm run build to transpile the changes from TypeScript to JavaScript, otherwise they will get ignored. Or edit the transpiled code directly

@DanijelDomazet
Copy link
Author

Here is the smee.service file:

[Unit]
Description=smee.io webhook delivery from GitHub
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=1
User=jenkins
ExecStart=/usr/bin/smee -u https://smee.io/1234abcde1234abcde --path /jenkins/github-webhook/ --port 8080

[Install]
WantedBy=multi-user.target

Could something be changed here to help resolve the problem?

@santiagob
Copy link

This might be related to issue #179.

@tcbyrd
Copy link
Contributor

tcbyrd commented Dec 3, 2021

This might be related to issue #179.

Agreed. In general because of how smee.io is hosted, the server might restart and drop the connection. We intended smee-client to be used more as a development tool, but I think it's really interesting that people are setting it up as a systemd service. I'll follow up in #179 because I think that comment is a solid path forward.

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

4 participants