Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

codegangsta/cli deprecated cli.App.RunAndExitOnError #223

Closed
a-andreyev opened this issue May 12, 2016 · 22 comments
Closed

codegangsta/cli deprecated cli.App.RunAndExitOnError #223

a-andreyev opened this issue May 12, 2016 · 22 comments
Assignees

Comments

@a-andreyev
Copy link

a-andreyev commented May 12, 2016

Hello! If I'm not mistaken, master branch uses cli.App.RunAndExitOnError, which is deprecated: https://github.com/codegangsta/cli/blob/master/CHANGELOG.md#deprecated-cli-app-runandexitonerror

@rickrich
Copy link

Two issues:

$ gcp-connector-util m
cups-printers=23
cups-raw-printers=0
gcp-printers=23
local-printers=23
cups-conn-qty=0
cups-conn-max-qty=50
jobs-done=0
jobs-error=0
jobs-in-progress=0
DEPRECATED Action signature. Must be cli.ActionFunc. This is an error in the application. Please contact the distributor of this application if this is not you. See https://github.com/codegangsta/cli/blob/master/CHANGELOG.md#deprecated-cli-app-action-signature

And:
$ cat nohup.out
DEPRECATED cli.App.RunAndExitOnError. This is an error in the application. Please contact the distributor of this application if this is not you. See https://github.com/codegangsta/cli/blob/master/CHANGELOG.md#deprecated-cli-app-runandexitonerror
Cloud Print Connector for CUPS version DEV-linux
Ready to rock as proxy 'home' and in local mode

@agoode agoode self-assigned this Jun 7, 2016
@agoode agoode mentioned this issue Jun 27, 2016
@kmlucy
Copy link

kmlucy commented Jul 2, 2016

I am getting both

DEPRECATED Action signature. Must be cli.ActionFunc. This is an error in the application. Please contact the distributor of this application if this is not you. See https://github.com/codegangsta/cli/blob/master/CHANGELOG.md#deprecated-cli-app-action-signature

and

DEPRECATED cli.App.RunAndExitOnError. This is an error in the application. Please contact the distributor of this application if this is not you. See https://github.com/codegangsta/cli/blob/master/CHANGELOG.md#deprecated-cli-app-runandexitonerror

when I try to create the config, and then when I try to run the connector. This isn't a problem when I run in a virtual machine, as it just continues. But I am trying to get it running in a Docker container, which exits when it gets the errors. How can I figure out what is causing the errors?

@mastermindg
Copy link

Getting this error on a Raspberry Pi 3 (not in a container or VM):

Jul 05 15:54:37 musicbox gcp-cups-connector[945]: DEPRECATED cli.App.RunAndExitOnError. This is an error in the application. Please contact the distributor of this application if this is not you. See https://github.com/urfave/cli/blob/master/CHANGELOG.md#deprecated-cli-app-runandexitonerror

@agoode
Copy link
Contributor

agoode commented Jul 11, 2016

Is this error causing problems in Docker? I started looking at fixing it but it was a bit involved and I didn't realize it was causing any real problems.

I can look at it again if necessary (also happy to review push requests).

@kmlucy
Copy link

kmlucy commented Jul 11, 2016

When run normally, it just continues after the error, but when run in a container, the Docker engine sees the error code and kills the container.

@agoode
Copy link
Contributor

agoode commented Jul 11, 2016

Can you give a link to your dockerfile?

@kmlucy
Copy link

kmlucy commented Jul 11, 2016

Sure. My repository is at: https://github.com/kmlucy/docker-cloudprint

@agoode
Copy link
Contributor

agoode commented Jul 11, 2016

Hmm, I can't quite tell what is going wrong with Docker.

Can you post a transcript of the output of Docker when it fails? I'd like to see as verbose output as possible, with the commands and arguments listed if you can.

@kmlucy
Copy link

kmlucy commented Jul 11, 2016

I successfully build it with:

docker build -t kmlucy/docker-cloudprint:latest .

Once built, I run the container to create the config:

docker run -it -v /opt/cloudprint/cloudprint:/config -w /config kmlucy/docker-cloudprint gcp-connector-util init

Here is the output:

"Local printing" means that clients print directly to the connector via local subnet,
and that an Internet connection is neither necessary nor used.
Enable local printing?
y

"Cloud printing" means that clients can print from anywhere on the Internet,
and that printers must be explicitly shared with users.
Enable cloud printing?
n

The config file /config/gcp-cups-connector.config.json is ready to rock.
DEPRECATED Action signature.  Must be `cli.ActionFunc`.  This is an error in the application.  Please contact the distributor of this application if this is not you.  See https://github.com/urfave/cli/blob/master/CHANGELOG.md#deprecated-cli-app-action-signature

I usually just go with local printing only for testing. The contents of /opt/cloudprint/cloudprint/gcp-cups-connector.config.json is:

{
  "local_printing_enable": true,
  "cloud_printing_enable": false,
  "log_level": "INFO",
  "log_file_name": "/tmp/cloud-print-connector"
}

I then create the actual container using:

docker create --name=cloudprint -v /opt/cloudprint/cloudprint:/config kmlucy/docker-cloudprint

I start the container, and checking the logs get:

Cloud Print Connector for CUPS version DEV-linux
DEPRECATED cli.App.RunAndExitOnError.  This is an error in the application.  Please contact the distributor of this application if this is not you.  See https://github.com/urfave/cli/blob/master/CHANGELOG.md#deprecated-cli-app-runandexitonerror

Docker shows a status of Exited (1)

@agoode
Copy link
Contributor

agoode commented Jul 11, 2016

Try setting log_level to DEBUG and set --log-to-console on the command line. I don't think that message is causing the problem.

@kmlucy
Copy link

kmlucy commented Jul 11, 2016

You were right:

I [11/Jul/2016:21:28:24 +0000] Cloud Print Connector for CUPS version DEV-linux
I [11/Jul/2016:21:28:24 +0000] Connecting to CUPS server at localhost:631 encrypting REQUIRED
X [11/Jul/2016:21:28:24 +0000] Failed to connect to CUPS server localhost:631 because 1282 Transport endpoint is not connected

Is there a way to set the cups server address in the config file? Or elsewhere?

@jacobmarble
Copy link
Contributor

We use the standard CUPS client library, so the usual rules apply:
https://github.com/google/cloud-print-connector/wiki/Install#run-the-cups-connector

@kmlucy
Copy link

kmlucy commented Jul 11, 2016

I passed the CUPS_SERVER variable, and managed to connect. Now it is failing here:

I [11/Jul/2016:22:03:24 +0000] Cloud Print Connector for CUPS version DEV-linux
I [11/Jul/2016:22:03:24 +0000] Connecting to CUPS server at 192.168.1.36:631 encrypting REQUIRED
I [11/Jul/2016:22:03:24 +0000] Connected to CUPS server successfully
X [11/Jul/2016:22:03:24 +0000] Failed to start Avahi client: Daemon not running

@jacobmarble
Copy link
Contributor

The Avahi daemon isn't running. It should be running to enable local mode.

@kmlucy
Copy link

kmlucy commented Jul 12, 2016

Got it working. It looks like local mode won't work in the container, or at least without the extra work to somehow get Avahi running. Thanks for all the help.

@kmlucy
Copy link

kmlucy commented Jul 12, 2016

I have one more question. When I remove and recreate my container, any settings I have changed online (the one that matters is shares) are cleared out. It seems like the printers are being removed and re-registered. I'm sure there is just some file that I have to keep between sessions, but can you tell me where that is located?

@agoode
Copy link
Contributor

agoode commented Jul 12, 2016

Are you deleting the credentials in your gcp-cups-connector.config.json file?

@kmlucy
Copy link

kmlucy commented Jul 12, 2016

No, the config file is stored outside the container, and is not touched.

@agoode
Copy link
Contributor

agoode commented Jul 12, 2016

It might be proxy_name. Are you keeping this constant?

@kmlucy
Copy link

kmlucy commented Jul 12, 2016

Yeah. I'm not changing the config file at all.

@kmlucy
Copy link

kmlucy commented Jul 12, 2016

Never mind. The sharing settings are fine. I got confused between printers. It does reset the name if you choose to rename it, but that is not a big deal.

@jacobmarble
Copy link
Contributor

Still getting the ActionFunc error on gcp-connector-util init

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants