[SOLVED] Mattermost-push-proxy - Readme Instructions incomplete?

Hey there, I followed the setup instructions for

mattermost-push-proxy from

But am unable to connect to 127.0.0.1 over 8066

When I check out the logs I see

/bin/sh: 1: exec: bin/mattermost-push-proxy: not found

Which makes sense because mattermost-push-proxy isn’t in bin!

Did I miss something obvious in the instructions? There was no mention of making / building the application. Does that need to be done? If so are there instructions on that? I tried but kept hitting errors.

Thanks for the help!

1 Like

Hi @oscott,

Thanks for your feedback,

Not sure whether these mobile app docs will help with regards your question of building the app?:

Let us know if you still have questions and we can troubleshoot further.

Hi @oscott, did you resolve this issue? I am also having the same issue:

/bin/sh: 1: exec: bin/mattermost-push-proxy: not found

Thank you for your time.

1 Like

I’m having the same issue. Step 6. in the GitHub instructions lined above in the OP. The issue is getting Upstart daemon to start /etc/init/matter-most-push-proxy.conf.

Commenting out the line

exec bin/mattermost-push-proxy | logger

Allows the process to start but it obviously necessary for running the proxy.

@ronaldjhp @oscott

Edit:

I figured it out – it kept saying start: Job failed to start but I ran:

cut -d: -f1 /etc/passwd

Realized I had no user called ubuntu. I made one up called mattermost-proxy-push and used that beside the

setuid mattermost-push-proxy

command in the script. If the lads had of fleshed out Step 2 a bit more I might not have made this error.

Thanks for posting back your resolution @Dev2!

I’m pleased the issue is resolved!

Would you be interested in making a pull request to improve the documentation where you find it lacking in explanation?

@lindy65 Maybe just going with the guides own recommendation and issuing a step of creating a user called mattermost-push-proxy and updating the script to include that user handle and leaving out the “ubuntu for simplicity” would be a better approach. I thought ubuntu was a default account already created for such purposes on ubuntu. This would replace a conceptual example with a working one.

I should wait till I at least have push notifications fully working before giving a pull request.

Thanks for the feedback @Dev2,

Let us know if you need any help once you get to the stage of submitting a pull request :slight_smile:

Hey @Dev2,
-Did you resolve the issue?
-What are you getting executing this :
curl http://127.0.0.1:8066/api/v1/send_push -X POST -H “Content-Type: application/json” -d ‘{ “message”:“test”, “badge”: 1, “platform”:“apple”, “server_id”:“MATTERMOST_DIAG_ID”, “device_id”:“IPHONE_DEVICE_ID”}’

Thanks.

@ronaldjhp

I’m on Ubuntu 14.04 though as per the instructions at the top:

I initially got connection refused but ufw was blocking port so I ran

sudo ufw allow 8066

That unblocked the port but now I get

{"id":"api.context.404.app_error","message":"Sorry, we could not find the page.","detailed_error":"There doesn't appear to be an api call for the url='/api/v1/send_push'.  Typo? are you missing a team_id or user_id as part of the url?","status_code":404}

I’m guessing next I have to create that API using maybe something like this:

AirNotifier or PHP GitHub Gist – Manual Way

Worth noting you can’t be using Ubuntu 16.04 as that dist uses systemd and not Upstart daemon so would need a different script in case you’re getting a command not found error.

That would involve something like:

[Unit]
Description=Mattermost Push Proxy

[Service]
StartLimitInterval=200
StartLimitBurst=5
WorkingDirectory=/home/ubuntu/mattermost-push-proxy
User=mattermost-push-proxy
ExecStart=/bin/mattermost-push-proxy

[Install]
WantedBy=multi-user.target

in
/etc/systemd/sytem/mattermost-push-proxy.service

using commands

sudo systemctl enable nginx.service
systemctl status nginx.service
sudo systemctl daemon-reload
sudo systemctl start nginx.service

to try and debug – let me know if anyone gets that going updating the guide to include Ubuntu 16.04 would be nice.

Hi Dev2,

I am using Ubuntu 16.04 and trying to create the service daemon but not having success.

I currently have the following:

[Unit]
Description=Mattermost Push Proxy
[Service]
StartLimitInterval=200
StartLimitBurst=5
WorkingDirectory=/opt/mattermost-push-proxy
User=mattermost-push-proxy
ExecStart=/bin/mattermost-push-proxy
[Install]
WantedBy=multi-user.target

It fails to start with the following:

I can confirm that running this manually works:

2018/10/01 03:37:38 INFO Loading /opt/mattermost-push-proxy/config/mattermost-push-proxy.json
2018/10/01 03:37:38 INFO Push proxy server is initializing…
2018/10/01 03:37:38 INFO Initializing apple notification server for type=apple
2018/10/01 03:37:38 ERROR Apple push notifications not configured. Missing ApplePushCertPrivate. for type=apple
2018/10/01 03:37:38 INFO Initializing apple notification server for type=apple_rn
2018/10/01 03:37:38 ERROR Apple push notifications not configured. Missing ApplePushCertPrivate. for type=apple_rn
2018/10/01 03:37:38 INFO Initializing Android notificaiton server for type=android
2018/10/01 03:37:38 INFO Initializing Android notificaiton server for type=android_rn
2018/10/01 03:37:38 INFO Server is listening on :8066

I am only using Android for notifications, hence the warning about no apple keys found.

Following works using systemd.

[Unit]
Description=Mattermost Push Proxy

[Service]
StartLimitInterval=200
StartLimitBurst=5
WorkingDirectory=/home/ubuntu/mattermost-push-proxy
User=mpush
ExecStart=/home/ubuntu/mattermost-push-proxy/bin/mattermost-push-proxy | logger

[Install]
WantedBy=multi-user.target
1 Like