lyft / presto-gateway

A load balancer / proxy / gateway for prestodb
Apache License 2.0
358 stars 156 forks source link

presto_cluster_state.json file not found #53

Closed skyahead closed 5 years ago

skyahead commented 5 years ago

I am trying this repo on my laptop and run it for the first time, got this error:

ERROR [2019-07-10 23:06:30,233] com.lyft.data.gateway.router.impl.GatewayBackendManagerImpl: Could not read previous backend cluster state ! java.io.FileNotFoundException: /var/log/prestoproxy/cache/presto_cluster_state.json (No such file or directory) !

puneetjaiswal commented 5 years ago

@skyahead You may not have cacheDir present. Can you please run the following commands

sudo mkdir -p /var/log/prestoproxy/cache
chown -R `id -u`:`id -g` /var/log/prestoproxy/

Please feel free to add a PR to update the setup instructions.

skyahead commented 5 years ago

I just did exactly what you instructed and got the same error. Maybe a better way is to initialize an empty json if this line fails?? https://github.com/lyft/presto-gateway/blob/master/gateway/src/main/java/com/lyft/data/gateway/router/impl/GatewayBackendManagerImpl.java#L108

skyahead commented 5 years ago

If I create that file manually and add {} in it, the code works.

puneetjaiswal commented 5 years ago

@skyahead - Its a harmless warning, did the application start after creating the cacheDir ? May be we should change the log level to warn instead of error and drop logging entire stacktrace. Please feel free to add a PR.

puneetjaiswal commented 5 years ago

I just did exactly what you instructed and got the same error. Maybe a better way is to initialize an empty json if this line fails?? https://github.com/lyft/presto-gateway/blob/master/gateway/src/main/java/com/lyft/data/gateway/router/impl/GatewayBackendManagerImpl.java#L108

The cluster state file is created when active/de-active state is changed through API call. IMO, its a harmless warning.

puneetjaiswal commented 5 years ago

If I create that file manually and add {} in it, the code works.

I would not recommend doing this, as this may override the cluster state loading from config file.

puneetjaiswal commented 5 years ago

Rephrased the logging message here - https://github.com/lyft/presto-gateway/pull/54/files#diff-6df3235fa747ebd415e084b03a5324bcR131