ConnMan network manager
 help / color / Atom feed
* Clearing service error from invalid-key will not invoke the agent anymore
@ 2021-06-22 18:10 Andrei Datcu
  2021-06-22 18:31 ` John Keeping
  2021-07-01  6:47 ` Daniel Wagner
  0 siblings, 2 replies; 5+ messages in thread
From: Andrei Datcu @ 2021-06-22 18:10 UTC (permalink / raw)
  To: connman

Using version 1.40, I'm trying to connect to a basic psk wifi hotspot.
If I input a wrong key to the agent request, the service will
correctly get Error == "invalid-key" (and State == "idle"). Invoking
Service::ClearProperty("Error") will put the service in a weird state:
every subsequent Service::Connect() call will fail without ever
requesting any agent input. To leave this state, one has to call
`Service::Remove()`.
Is this expected or is this a bug?

Thanks,
Andrei

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Clearing service error from invalid-key will not invoke the agent anymore
  2021-06-22 18:10 Clearing service error from invalid-key will not invoke the agent anymore Andrei Datcu
@ 2021-06-22 18:31 ` John Keeping
  2021-06-22 18:39   ` Andrei Datcu
  2021-06-24  8:10   ` Daniel Wagner
  2021-07-01  6:47 ` Daniel Wagner
  1 sibling, 2 replies; 5+ messages in thread
From: John Keeping @ 2021-06-22 18:31 UTC (permalink / raw)
  To: Andrei Datcu; +Cc: connman

Hi Andrei,

On Tue, 22 Jun 2021 21:10:05 +0300
Andrei Datcu <datcuandrei@gmail.com> wrote:

> Using version 1.40, I'm trying to connect to a basic psk wifi hotspot.
> If I input a wrong key to the agent request, the service will
> correctly get Error == "invalid-key" (and State == "idle"). Invoking
> Service::ClearProperty("Error") will put the service in a weird state:
> every subsequent Service::Connect() call will fail without ever
> requesting any agent input. To leave this state, one has to call
> `Service::Remove()`.
> Is this expected or is this a bug?

This sounds like the issue I reported here:

	https://lore.kernel.org/connman/20210615120930.2970caef.john@metanate.com/

I have reverted 8ea2d67a6e8935d06f71b1ec77a2f89d72be49eb locally and
that fixes this scenario.


Regards,
John

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Clearing service error from invalid-key will not invoke the agent anymore
  2021-06-22 18:31 ` John Keeping
@ 2021-06-22 18:39   ` Andrei Datcu
  2021-06-24  8:10   ` Daniel Wagner
  1 sibling, 0 replies; 5+ messages in thread
From: Andrei Datcu @ 2021-06-22 18:39 UTC (permalink / raw)
  To: John Keeping; +Cc: connman

Hello John,

Even though they share a great deal, these are not similar, because
a) I'm calling Service::ClearProperty("Error"); // there's no way to
do this from connman afaik
b) I'm getting operation aborted as an error

If I skip a) then I get subsequent agent calls. Also I'm able to
reproduce the issue on 1.36.

On Tue, Jun 22, 2021 at 9:31 PM John Keeping <john@metanate.com> wrote:
>
> Hi Andrei,
>
> On Tue, 22 Jun 2021 21:10:05 +0300
> Andrei Datcu <datcuandrei@gmail.com> wrote:
>
> > Using version 1.40, I'm trying to connect to a basic psk wifi hotspot.
> > If I input a wrong key to the agent request, the service will
> > correctly get Error == "invalid-key" (and State == "idle"). Invoking
> > Service::ClearProperty("Error") will put the service in a weird state:
> > every subsequent Service::Connect() call will fail without ever
> > requesting any agent input. To leave this state, one has to call
> > `Service::Remove()`.
> > Is this expected or is this a bug?
>
> This sounds like the issue I reported here:
>
>         https://lore.kernel.org/connman/20210615120930.2970caef.john@metanate.com/
>
> I have reverted 8ea2d67a6e8935d06f71b1ec77a2f89d72be49eb locally and
> that fixes this scenario.
>
>
> Regards,
> John

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Clearing service error from invalid-key will not invoke the agent anymore
  2021-06-22 18:31 ` John Keeping
  2021-06-22 18:39   ` Andrei Datcu
@ 2021-06-24  8:10   ` Daniel Wagner
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Wagner @ 2021-06-24  8:10 UTC (permalink / raw)
  To: John Keeping; +Cc: Andrei Datcu, connman

On Tue, Jun 22, 2021 at 07:31:32PM +0100, John Keeping wrote:
> Hi Andrei,
> 
> On Tue, 22 Jun 2021 21:10:05 +0300
> Andrei Datcu <datcuandrei@gmail.com> wrote:
> 
> > Using version 1.40, I'm trying to connect to a basic psk wifi hotspot.
> > If I input a wrong key to the agent request, the service will
> > correctly get Error == "invalid-key" (and State == "idle"). Invoking
> > Service::ClearProperty("Error") will put the service in a weird state:
> > every subsequent Service::Connect() call will fail without ever
> > requesting any agent input. To leave this state, one has to call
> > `Service::Remove()`.
> > Is this expected or is this a bug?
> 
> This sounds like the issue I reported here:
> 
> 	https://lore.kernel.org/connman/20210615120930.2970caef.john@metanate.com/
> 
> I have reverted 8ea2d67a6e8935d06f71b1ec77a2f89d72be49eb locally and
> that fixes this scenario.

Thanks for the reminder. I'll look into it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Clearing service error from invalid-key will not invoke the agent anymore
  2021-06-22 18:10 Clearing service error from invalid-key will not invoke the agent anymore Andrei Datcu
  2021-06-22 18:31 ` John Keeping
@ 2021-07-01  6:47 ` Daniel Wagner
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Wagner @ 2021-07-01  6:47 UTC (permalink / raw)
  To: Andrei Datcu; +Cc: connman

Hi Andrei,

On Tue, Jun 22, 2021 at 09:10:05PM +0300, Andrei Datcu wrote:
> Using version 1.40, I'm trying to connect to a basic psk wifi hotspot.
> If I input a wrong key to the agent request, the service will
> correctly get Error == "invalid-key" (and State == "idle"). Invoking
> Service::ClearProperty("Error") will put the service in a weird state:
> every subsequent Service::Connect() call will fail without ever
> requesting any agent input. To leave this state, one has to call
> `Service::Remove()`.
> Is this expected or is this a bug?

Sounds like a bug to me. I think it could be that we set the error state
but don't update the ipconfig/service state accordingly. Although you
are saying the service is in a error state.

So this here is probably not helping:

--- a/src/service.c
+++ b/src/service.c
@@ -3999,6 +3999,13 @@ static DBusMessage *clear_property(DBusConnection *conn,
        if (g_str_equal(name, "Error")) {
                set_error(service, CONNMAN_SERVICE_ERROR_UNKNOWN);
 
+               __connman_service_ipconfig_indicate_state(service,
+                                               CONNMAN_SERVICE_STATE_FAILURE,
+                                               CONNMAN_IPCONFIG_TYPE_IPV4);
+               __connman_service_ipconfig_indicate_state(service,
+                                               CONNMAN_SERVICE_STATE_FAILURE,
+                                               CONNMAN_IPCONFIG_TYPE_IPV6);
+
                __connman_service_clear_error(service);
                service_complete(service);
        } else

If possible could you check what the service state is when we hit the
__connman_service_clear_error?

@@ -6183,7 +6190,7 @@ int __connman_service_clear_error(struct connman_service *service)
 {
        DBusMessage *pending, *provider_pending;
 
-       DBG("service %p", service);
+       DBG("service %p state %d", service, service->state);
 
        if (!service)
                return -EINVAL;


TBH, the 'set_error' thing looks a bit strange. The commit message says

  service: Signal error property changes

  In order to allow clients to update the property in a manner similar to
  other service properties, signal changes in the service "Error" property
  key/value pair.

  The value "" is used when no error is asserted because D-Bus property
  changed convention has no semantics for indicating a key/value pair was
  removed.

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 18:10 Clearing service error from invalid-key will not invoke the agent anymore Andrei Datcu
2021-06-22 18:31 ` John Keeping
2021-06-22 18:39   ` Andrei Datcu
2021-06-24  8:10   ` Daniel Wagner
2021-07-01  6:47 ` Daniel Wagner

ConnMan network manager

Archives are clonable:
	git clone --mirror https://lore.kernel.org/connman/0 connman/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 connman connman/ https://lore.kernel.org/connman \
		connman@lists.linux.dev
	public-inbox-index connman

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/dev.linux.lists.connman


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git