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

Merlin 32 bit agent disconnects from 64 bit server: "connected with expired JWT" #93

Closed
3 tasks done
g3rzi opened this issue Jun 23, 2020 · 3 comments
Closed
3 tasks done

Comments

@g3rzi
Copy link
Contributor

g3rzi commented Jun 23, 2020

Prerequisite

Environment Data

  • Merlin Version: 0.8.0.BETA (dev branch)
  • Merlin Build: dev
  • Go Version: go1.14.4 linux/amd64
  • GOPATH Environment Variable: /home/jiren/go
  • GOROOT Environment Variable: /usr/local/go
  • Operating System: Linux Ubuntu 16.04.3 LTS

Expected Behavior

32 bit agent connect to 64 bit server without disconnections.

Actual Behavior

When the 64 bit server interacts with 32 bit agent it throws lots of errors:

Merlin[agent][5b4e726b-f310-40f4-9295-d874061b9afb]» [!]Agent 5b4e726b-f310-40f4-9295-d874061b9afb connected with expired JWT. Instructing agent to re-authenticate
[!]Agent 5b4e726b-f310-40f4-9295-d874061b9afb connected with expired JWT. Instructing agent to re-authenticate
[!]Agent 5b4e726b-f310-40f4-9295-d874061b9afb connected with expired JWT. Instructing agent to re-authenticate
[!]Agent 5b4e726b-f310-40f4-9295-d874061b9afb connected with expired JWT. Instructing agent to re-authenticate
[!]Agent 5b4e726b-f310-40f4-9295-d874061b9afb connected with expired JWT. Instructing agent to re-authenticate
[!]Agent 5b4e726b-f310-40f4-9295-d874061b9afb connected with expired JWT. Instructing agent to re-authenticate
[!]Agent 5b4e726b-f310-40f4-9295-d874061b9afb connected with expired JWT. Instructing agent to re-authenticate
[!]Agent 5b4e726b-f310-40f4-9295-d874061b9afb connected with expired JWT. Instructing agent to re-authenticate
[!]Agent 5b4e726b-f310-40f4-9295-d874061b9afb connected with expired JWT. Instructing agent to re-authenticate
[!]Agent 5b4e726b-f310-40f4-9295-d874061b9afb connected with expired JWT. Instructing agent to re-authenticate
[!]Invalid Activity: StatusCheckIn
[!]Invalid Activity: StatusCheckIn
[!]Agent 5b4e726b-f310-40f4-9295-d874061b9afb connected with expired JWT. Instructing agent to re-authenticate
[!]Agent 5b4e726b-f310-40f4-9295-d874061b9afb connected with expired JWT. Instructing agent to re-authenticate
[!]Agent 5b4e726b-f310-40f4-9295-d874061b9afb connected with expired JWT. Instructing agent to re-authenticate
[!]Agent 5b4e726b-f310-40f4-9295-d874061b9afb connected with expired JWT. Instructing agent to re-authenticate
[!]Invalid Activity: StatusCheckIn
[!]Invalid Activity: StatusCheckIn
[!]Invalid Activity: StatusCheckIn
[!]invalid message type
[!]invalid message type

Steps to Reproduce Behavior

  1. Run 64 bit server with -i <host_ip>-p 1337
  2. Compile 32 bit agent: set GOARCH=386 | go build cmd/merlinagent/main.go
  3. Run 32 bit agent: ./main32 -url https://<host_ip>:1337 -sleep 1s
  4. Once it connects to the server, interact with the agent: agent interact <agent_id>
  5. Run ls, it should print the output, run it again and should see the errors.

Misc Information

@g3rzi
Copy link
Contributor Author

g3rzi commented Jun 23, 2020

In #87 you suggested to increase the -sleep time, it seems to solve it when I run:

./main32 -url https://<host_ip>:1337 -sleep 11s

Any idea why the difference between the 64 to 32 bit?

@Ne0nd0g
Copy link
Owner

Ne0nd0g commented Jun 23, 2020

I'm looking into it, but I don't know off the top of my head. It seems like the 32-bit agent just runs slower and isn't as quick to send/receive/process messages and I think that might be getting it out of sync. Every checkin request is run in its own thread so I wonder if the requests are getting out of sync because they can't process fast enough. I'm still looking into this more.

@Ne0nd0g
Copy link
Owner

Ne0nd0g commented Feb 13, 2021

Fixed as of 43cecfe . Likely due to a restructure in how the sleep cycle and job processing works. The 32-bit agent is generally slower than the 64-bit agent.

@Ne0nd0g Ne0nd0g closed this as completed Feb 13, 2021
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

2 participants