Scala Config Error with GCP


#1

Hi,

I’m trying to integrate the GCP approach, but I get this error:

java -jar snowplow-stream-collector-google-pubsub-0.14.0.jar --config config.hocon [scala-stream-collector-akka.actor.default-dispatcher-2] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started [scala-stream-collector-akka.actor.default-dispatcher-2] ERROR com.snowplowanalytics.snowplow.collectors.scalastream.GooglePubSubCollector - REST interface could not be bound to 0.0.0.0:80
[scala-stream-collector-akka.actor.default-dispatcher-2] ERROR akka.io.TcpListener - Bind failed for TCP channel on endpoint [/0.0.0.0:80]
java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at akka.io.TcpListener.liftedTree1$1(TcpListener.scala:56)
at akka.io.TcpListener.(TcpListener.scala:53)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at akka.util.Reflect$.instantiate(Reflect.scala:65)
at akka.actor.ArgsReflectConstructor.produce(IndirectActorProducer.scala:96)
at akka.actor.Props.newActor(Props.scala:213)
at akka.actor.ActorCell.newActor(ActorCell.scala:562)
at akka.actor.ActorCell.create(ActorCell.scala:588)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:461)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:483)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
at akka.dispatch.Mailbox.run(Mailbox.scala:223)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Any suggestions?

in the config.hocon I’ve applied:

interface = “0.0.0.0”
port = 80

Many thanks in advance.

Nik


#2

If you’re trying to run the Scala stream collector on a privileged port (e.g., 80) you’ll need to run the command as root. It’s recommended to avoid this by running the collector on a non-privileged port (e.g., 8080) and using a Google HTTP(S) load balancer that will forward traffic from your load balancer on port 80 to your instance group on port 8080.


#3

In every Linux/Unix system you need root privileges to bind port below 1024.


#4

Thank you guys, this solved the issue :+1: