mirror of
https://github.com/amidaware/tacticalrmm.git
synced 2026-04-26 15:05:57 +03:00
[GH-ISSUE #1924] Cant move agent between sites #3142
Labels
No labels
In Process
bug
bug
dev-triage
documentation
duplicate
enhancement
fixed
good first issue
help wanted
integration
invalid
pull-request
question
requires agent update
security
ui tweak
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tacticalrmm#3142
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @davew909 on GitHub (Jul 23, 2024).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1924
Server Info (please complete the following information):
Installation Method:
Agent Info (please complete the following information):
Describe the bug
Moving agent to new site creates a 500: Internal Server Error
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Agent to move to new site
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
@dinger1986 commented on GitHub (Jul 23, 2024):
I can move agents to a new site without issues.
https://docs.tacticalrmm.com/troubleshooting/#error-500
@davew909 commented on GitHub (Jul 23, 2024):
Hi,
This is what i get out of the Djano log:
tactical@core ~$ tail -f /rmm/api/tacticalrmm/tacticalrmm/private/log/django_debug.log
File "/rmm/api/env/lib/python3.11/site-packages/django/db/utils.py", line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/rmm/api/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
raise ex.with_traceback(None)
django.db.utils.NotSupportedError: conversion between UTF8 and SQL_ASCII is not supported
LINE 1: ...2:07:52.290475+00:00'::timestamptz, "services" = E'[{"pid":...
^
[23/Jul/2024 14:53:31] ERROR [log.py:log_response:241] Internal Server Error: /agents/amUVPqUWjKaQIAOYRHEPjsjVJUlnXVoTKxsLHATQ/
Traceback (most recent call last):
File "/rmm/api/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
raise ex.with_traceback(None)
psycopg.errors.FeatureNotSupported: conversion between UTF8 and SQL_ASCII is not supported
LINE 1: ...2:07:52.290475+00:00'::timestamptz, "services" = E'[{"pid":...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/rmm/api/env/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
return view_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/rmm/api/env/lib/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/rmm/api/env/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/tacticalrmm/agents/views.py", line 231, in put
s.save()
File "/rmm/api/env/lib/python3.11/site-packages/rest_framework/serializers.py", line 203, in save
self.instance = self.update(self.instance, validated_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/rest_framework/serializers.py", line 1033, in update
instance.save()
File "/rmm/api/tacticalrmm/agents/models.py", line 148, in save
super().save(*args, **kwargs)
File "/rmm/api/tacticalrmm/logs/models.py", line 525, in save
super().save(*args, **kwargs)
File "/rmm/api/env/lib/python3.11/site-packages/django/db/models/base.py", line 814, in save
self.save_base(
File "/rmm/api/env/lib/python3.11/site-packages/django/db/models/base.py", line 877, in save_base
updated = self._save_table(
^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/django/db/models/base.py", line 990, in _save_table
updated = self._do_update(
^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/django/db/models/base.py", line 1054, in _do_update
return filtered._update(values) > 0
^^^^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/django/db/models/query.py", line 1231, in _update
return query.get_compiler(self.db).execute_sql(CURSOR)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1984, in execute_sql
cursor = super().execute_sql(result_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
cursor.execute(sql, params)
File "/rmm/api/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
with self.db.wrap_database_errors:
File "/rmm/api/env/lib/python3.11/site-packages/django/db/utils.py", line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/rmm/api/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rmm/api/env/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
raise ex.with_traceback(None)
django.db.utils.NotSupportedError: conversion between UTF8 and SQL_ASCII is not supported
LINE 1: ...2:07:52.290475+00:00'::timestamptz, "services" = E'[{"pid":...
@dinger1986 commented on GitHub (Jul 23, 2024):
so this thing here is pointing to something with the services on that agent
services" = E'[{"pidCan you check if theres any strangely named services?
Also what is the Agent OS?
@silversword411 commented on GitHub (Jul 23, 2024):
Are you doing anything custom with the django/postgres database?
@silversword411 commented on GitHub (Jul 23, 2024):
See https://github.com/amidaware/tacticalrmm/issues/1522
One of your services has a non supported character in it most likely. If you can find the service, can you post in the other issue. Thx!
@wh1te909 commented on GitHub (Jul 23, 2024):
@davew909 can you please run the following script to dump your database. It will create a file named
db-1924.psql.gzand then please send us that file by opening a ticket at https://support.amidaware.com@davew909 commented on GitHub (Jul 24, 2024):
Hi I have submitted this as requested. I can’t see any services that look abnormal, these are freshly built Windows 11 machines 23H2