consometers / consoherozh

Visualisation de conso d’énergie
https://www.consoherozh.fr
Other
1 stars 1 forks source link

[grails3] after migration enedis token refreshing is not working #9

Open artlog opened 2 years ago

artlog commented 2 years ago

Enedis linky counter are not refreshed anymore, token refreshed is requested and obtained but its value in NotificationAccount does not persist at .save().

2022-03-28 17:10:06.344 ERROR --- [eduler_Worker-4] s.a.d.DataConnectDataSourceProvider      : Dataconnect.consumptionLoadCurve : DataConnect#consumptionLoadCurve : star
t = end !
2022-03-28 17:20:05.272 ERROR --- [eduler_Worker-4] a.s.DataSourceProviderCronPaginateSubJob : Provider Enedis DataConnect [351125] : Dataconnect.refresh_token : HTTP re
quest error [401] : Valid authentication credentials are mandatory to access the resource. !
artlog commented 2 years ago

tentative fix with flush:true does not work, refresh_token 'after' as seen in traces does not persist.

artlog commented 2 years ago

setting config in NotificationAccount does not mark objet as dirty. Even setting markdirty does not trigger update, but markDirty('config') does it.

when it works :

2022-04-10 18:51:21.455 DEBUG --- [eduler_Worker-3] o.h.e.i.AbstractFlushingEventListener    : Flushed: 0 insertions, 1 updates, 0 deletions to 3 objects
(...)
2022-04-10 18:51:21.478 DEBUG --- [       Thread-7] o.h.e.t.internal.TransactionImpl         : begin
2022-04-10 18:51:21.478 DEBUG --- [       Thread-7] o.s.j.d.DriverManagerDataSource          : Creating new JDBC DriverManager Connection to [jdbc:postgresql://localhost:5432/smarthome2]
2022-04-10 18:51:21.485 DEBUG --- [       Thread-7] o.h.e.t.internal.TransactionImpl         : committing
(...)
2022-04-10 19:00:04.933 DEBUG --- [eduler_Worker-1] o.a.camel.spring.SpringCamelContext      : onApplicationEvent: org.grails.datastore.mapping.engine.event.PreUpdateEvent[source=HibernateDatastore: DEFAULT]
2022-04-10 19:00:04.933 DEBUG --- [eduler_Worker-1] org.hibernate.SQL                        : update smarthome.notification_account set version=?, notification_account_sender_id=?, user_id=?, config=? where id=? and version=?
2022-04-10 19:00:04.935 DEBUG --- [eduler_Worker-1] o.a.camel.spring.SpringCamelContext      : onApplicationEvent: org.grails.datastore.mapping.engine.event.PostUpdateEvent[source=HibernateDatastore: DEFAULT]