Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
artlog opened this issue Apr 9, 2022 · 2 comments
Open

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

artlog opened this issue Apr 9, 2022 · 2 comments

Comments

@artlog
Copy link

artlog commented Apr 9, 2022

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 added a commit to artlog/consoherozh that referenced this issue Apr 9, 2022
@artlog
Copy link
Author

artlog commented Apr 9, 2022

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

artlog added a commit to artlog/consoherozh that referenced this issue Apr 10, 2022
…ometers#9

- mark notificationAccount config property as dirty
  - this then will trigger an update
- when refresh token is refused, actualy set expired to 'true'
  - an execption was thrown that did rollback on exception
artlog added a commit to artlog/consoherozh that referenced this issue Apr 10, 2022
…ometers#9

- mark notificationAccount config property as dirty
  - this then will trigger an update
- when refresh token is refused, actualy set expired to 'true'
  - an exception was thrown that did rollback on exception
@artlog
Copy link
Author

artlog commented Apr 10, 2022

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]

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

No branches or pull requests

1 participant