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

Reload not working with unleash edge in offline mode #594

Closed
DAGRSAG opened this issue Dec 5, 2024 · 7 comments · Fixed by #595
Closed

Reload not working with unleash edge in offline mode #594

DAGRSAG opened this issue Dec 5, 2024 · 7 comments · Fixed by #595
Assignees
Labels
bug Something isn't working

Comments

@DAGRSAG
Copy link

DAGRSAG commented Dec 5, 2024

Describe the bug

Hi
currently I'm in preparation of creating a new Enterprise Signing with Unleash. For that I'm testing different things.

We are planning to use the Unleash Edge in offline mode for our local development. To make it easy for our developers, I'm working on some scripting.

I have downloaded the latest windows binary from your GitHub repo and started it with the following commands

unleash-edge.exe offline --reload-interval 10 -c u1234e -f uf4321e -b "C:\Dev\toggles.json"

The parameter c, f and b works as expected. Unfortunately the most important one (r or reload-interval) not. I have the following toggle defined

{
  "SR27_Pack": {
    "enabled": false
  }
}

Initially the toggle is false, which is expected. Then I've changed the value for enabled to true. But even after some minutes, the toggle is still false.

I also have tested with the environment variable RELOAD_INTERVAL. This have the same issue. Environment variable for workers works.

Where is my issue? Can you provide me feedback please or is it an issue?

BR Daniel

Steps to reproduce the bug

  1. Start the unleash edge in offline mode (command see above)
  2. Switch a toggle value from false to true

Expected behavior

The toggle state should be changed from false to true

Logs, error output, etc.

2024-12-05T15:57:55.393295Z  INFO actix_server::builder: starting 10 workers
2024-12-05T15:57:55.393780Z  INFO actix_server::server: Actix runtime found; starting in Actix runtime
2024-12-05T15:57:55.394068Z  INFO actix_server::server: starting service: "actix-web-service-0.0.0.0:3063", workers: 10, listening on: 0.0.0.0:3063

Screenshots

No response

Additional context

What is also odd to me is, that the endpoint internal-backstage/tokens returns 500 and the message Requested application data is not configured correctly. View/enable debug logs for more details.

But no message gets logged.

Unleash version

19.6.2

Subscription type

None

Hosting type

Hosted by Unleash

SDK information (language and version)

No response

@DAGRSAG DAGRSAG added the bug Something isn't working label Dec 5, 2024
@DAGRSAG
Copy link
Author

DAGRSAG commented Dec 5, 2024

I have tested it with a Windows shell and Windows PowerShell

@chriswk chriswk transferred this issue from Unleash/unleash Dec 6, 2024
@chriswk
Copy link
Member

chriswk commented Dec 6, 2024

Hi @DAGRSAG . Thanks for reporting this.
You might've run into some windows path issues; I'll see if I can't reproduce.

For the /internal-backstage/tokens endpoint. It will not work in offline mode, since there is no TokenValidator available in offline mode, that's why you're getting the 500. We just haven't seen the need for this endpoint in offline mode.

@chriswk chriswk moved this from New to Investigating in Issues and PRs Dec 6, 2024
@chriswk chriswk self-assigned this Dec 6, 2024
@chriswk
Copy link
Member

chriswk commented Dec 6, 2024

Hi @DAGRSAG . I was wrong. This seems to have been an oversight when we added support for client/frontend tokens to offline mode. We no longer have tokens to refresh. I'll release a patch later today where this should work again. I'll also see if I can't find a way to make the /tokens endpoint be useful in offline mode.

Again, thanks for reporting, and sorry for the mixup, we don't test much on Windows, so my gut reaction was that I was sure I'd seen it work on Linux so it might be a Windows issue. I'll get it working on both platforms before releasing the patch.

@DAGRSAG
Copy link
Author

DAGRSAG commented Dec 6, 2024

Hi @DAGRSAG . Thanks for reporting this. You might've run into some windows path issues; I'll see if I can't reproduce.

For the /internal-backstage/tokens endpoint. It will not work in offline mode, since there is no TokenValidator available in offline mode, that's why you're getting the 500. We just haven't seen the need for this endpoint in offline mode.

This is fine for me. Just from the documentation my expectation was that this endpoint is also available in offline mode

@DAGRSAG
Copy link
Author

DAGRSAG commented Dec 6, 2024

I'll release a patch later today where this should work again

That would really be awesome if there is a fix in place. Because for the POC to present it, it would be good to have a working environment

I'll also see if I can't find a way to make the /tokens endpoint be useful in offline mode.

As mention already. If there is one ok, but at least from my point of view, the reload stuff is the absolute important one

BR Daniel

chriswk added a commit that referenced this issue Dec 6, 2024
After adding support for client and frontend tokens, we did not extend
the reloader to check client and frontend token Vecs, this PR extends
tokens with FE and Client tokens, to ensure that we refresh the data for
all our tokens.

In addition we make /internal-backstage/tokens useful for offline mode
as well, to at least be able to see which tokens you added to Edge.

Fixes: #594
chriswk added a commit that referenced this issue Dec 6, 2024
After adding support for client and frontend tokens, we did not extend
the reloader to check the client and frontend token arrays. This PR extends
tokens with FE and Client tokens, to ensure that we refresh the data for
all our tokens.

In addition we make /internal-backstage/tokens useful for offline mode
as well, to at least be able to see which tokens you added to Edge.

Fixes: #594
@github-project-automation github-project-automation bot moved this from Investigating to Done in Issues and PRs Dec 6, 2024
@chriswk
Copy link
Member

chriswk commented Dec 6, 2024

19.6.3 released with this fix in place. Again, thanks for the good report. Enjoy your weekend

@DAGRSAG
Copy link
Author

DAGRSAG commented Dec 6, 2024

Yes can confirm, that both things now working. Thanks for the quick response and fix. Awesome. Have a nice weekend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants