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

Server Error (500) - Component modification #78

Open
SnowEdyX opened this issue Feb 22, 2023 · 5 comments
Open

Server Error (500) - Component modification #78

SnowEdyX opened this issue Feb 22, 2023 · 5 comments

Comments

@SnowEdyX
Copy link

Hello everyone ,

First of all, sorry for my english, i'm french..

I have been trying to modify the reports integrated with WriteHat for a few days now, but each time I make a modification (even a small one), when I restart the Docker I get an error like this:

image

Here is what happens in my docker-compose when I relaunch the page in question:

writehat_1  | 2023-02-22 06:52:01 - DEBUG   - views.py:  141 - reportEdit() called; UUID: 82b44866-2ddc-4e5d-844f-6023393e397f
writehat_1  | 2023-02-22 06:52:01 - DEBUG   - views.py:  142 - Found 14 available components
writehat_1  | 2023-02-22 06:52:01 - DEBUG   - models.py:   54 - Report.get() called
writehat_1  | 2023-02-22 06:52:01 - DEBUG   - models.py:   55 -   args: ()
writehat_1  | 2023-02-22 06:52:01 - DEBUG   - models.py:  189 - Report.populateForm() called
writehat_1  | 2023-02-22 06:52:01 - DEBUG   - models.py:  196 - validFormFields: ['name', 'pageTemplateID']
writehat_1  | 2023-02-22 06:52:01 - DEBUG   - models.py:  201 -    Successfully copied: name
writehat_1  | 2023-02-22 06:52:01 - DEBUG   - models.py:  201 -    Successfully copied: pageTemplateID
writehat_1  | 2023-02-22 06:52:01 - DEBUG   - models.py:   54 - Engagement.get() called
writehat_1  | 2023-02-22 06:52:01 - DEBUG   - models.py:   55 -   args: ()
writehat_1  | 2023-02-22 06:52:01 - DEBUG   - base.py:  123 - BaseComponent.get() called; ID: 9a1f2eff-2d7e-47aa-b1c5-e6ee6b98f9c4
writehat_1  | 2023-02-22 06:52:01 - DEBUG   - base.py:  416 - BaseComponent.getType() called; UUID: 9a1f2eff-2d7e-47aa-b1c5-e6ee6b98f9c4
writehat_1  | 2023-02-22 06:52:31 - ERROR   - log.py:  224 - Internal Server Error: /engagements/report/82b44866-2ddc-4e5d-844f-6023393e397f/edit
writehat_1  | Traceback (most recent call last):
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 829, in _resolve_lookup
writehat_1  |     current = current[bit]
writehat_1  | TypeError: 'Report' object is not subscriptable
writehat_1  | 
writehat_1  | During handling of the above exception, another exception occurred:
writehat_1  | 
writehat_1  | Traceback (most recent call last):
writehat_1  |   File "/opt/writehat/./writehat/lib/db.py", line 337, in _mongo_op
writehat_1  |     return operation(*args, **kwargs)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/pymongo/collection.py", line 1319, in find_one
writehat_1  |     for result in cursor.limit(-1):
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/pymongo/cursor.py", line 1207, in next
writehat_1  |     if len(self.__data) or self._refresh():
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/pymongo/cursor.py", line 1100, in _refresh
writehat_1  |     self.__session = self.__collection.database.client._ensure_session()
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/pymongo/mongo_client.py", line 1816, in _ensure_session
writehat_1  |     return self.__start_session(True, causal_consistency=False)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/pymongo/mongo_client.py", line 1766, in __start_session
writehat_1  |     server_session = self._get_server_session()
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/pymongo/mongo_client.py", line 1802, in _get_server_session
writehat_1  |     return self._topology.get_server_session()
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/pymongo/topology.py", line 485, in get_server_session
writehat_1  |     self._select_servers_loop(
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/pymongo/topology.py", line 215, in _select_servers_loop
writehat_1  |     raise ServerSelectionTimeoutError(
writehat_1  | pymongo.errors.ServerSelectionTimeoutError: mongo:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: 63f5f5dc471e4c9bc1fc384e, topology_type: Single, servers: [<ServerDescription ('mongo', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('mongo:27017: [Errno 111] Connection refused')>]>
writehat_1  | 
writehat_1  | During handling of the above exception, another exception occurred:
writehat_1  | 
writehat_1  | Traceback (most recent call last):
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/exception.py", line 47, in inner
writehat_1  |     response = get_response(request)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/base.py", line 181, in _get_response
writehat_1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/views/decorators/http.py", line 40, in inner
writehat_1  |     return func(request, *args, **kwargs)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/utils/decorators.py", line 130, in _wrapped_view
writehat_1  |     response = view_func(request, *args, **kwargs)
writehat_1  |   File "/opt/writehat/./writehat/views.py", line 147, in reportEdit
writehat_1  |     return render(request,"pages/reportEdit.html", \
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/shortcuts.py", line 19, in render
writehat_1  |     content = loader.render_to_string(template_name, context, request, using=using)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/loader.py", line 62, in render_to_string
writehat_1  |     return template.render(context, request)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/backends/django.py", line 61, in render
writehat_1  |     return self.template.render(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 170, in render
writehat_1  |     return self._render(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 162, in _render
writehat_1  |     return self.nodelist.render(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 938, in render
writehat_1  |     bit = node.render_annotated(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 905, in render_annotated
writehat_1  |     return self.render(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/loader_tags.py", line 150, in render
writehat_1  |     return compiled_parent._render(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 162, in _render
writehat_1  |     return self.nodelist.render(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 938, in render
writehat_1  |     bit = node.render_annotated(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 905, in render_annotated
writehat_1  |     return self.render(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/loader_tags.py", line 62, in render
writehat_1  |     result = block.nodelist.render(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 938, in render
writehat_1  |     bit = node.render_annotated(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 905, in render_annotated
writehat_1  |     return self.render(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/loader_tags.py", line 192, in render
writehat_1  |     return template.render(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 172, in render
writehat_1  |     return self._render(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 162, in _render
writehat_1  |     return self.nodelist.render(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 938, in render
writehat_1  |     bit = node.render_annotated(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 905, in render_annotated
writehat_1  |     return self.render(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/defaulttags.py", line 163, in render
writehat_1  |     values = self.sequence.resolve(context, ignore_failures=True)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 671, in resolve
writehat_1  |     obj = self.var.resolve(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 796, in resolve
nginx_1     | 10.208.194.139 - - [22/Feb/2023:11:52:32 +0000] "GET /engagements/report/82b44866-2ddc-4e5d-844f-6023393e397f/edit HTTP/1.1" 500 145 "https://192.168.254.39/engagements/edit/44b33c39-2064-4658-9609-539679cb39eb" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" "-"
writehat_1  |     value = self._resolve_lookup(context)
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 837, in _resolve_lookup
writehat_1  |     current = getattr(current, bit)
writehat_1  |   File "/opt/writehat/./writehat/lib/report.py", line 79, in components
writehat_1  |     self._component_objects = self.populateComponentChildren(json.loads(self._components))
writehat_1  |   File "/opt/writehat/./writehat/lib/report.py", line 293, in populateComponentChildren
writehat_1  |     component = BaseComponent.get(uuid)
writehat_1  |   File "/opt/writehat/./writehat/components/base.py", line 125, in get
writehat_1  |     componentType = BaseComponent.getType(id)
writehat_1  |   File "/opt/writehat/./writehat/components/base.py", line 421, in getType
writehat_1  |     result = JSONComponentModel._mongo_op(settings.MONGO_DB['report_' + JSONComponentModel._collection].find_one, \
writehat_1  |   File "/opt/writehat/./writehat/lib/db.py", line 345, in _mongo_op
writehat_1  |     raise DatabaseError(error)
writehat_1  | writehat.lib.errors.DatabaseError: mongo:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: 63f5f5dc471e4c9bc1fc384e, topology_type: Single, servers: [<ServerDescription ('mongo', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('mongo:27017: [Errno 111] Connection refused')>]>
writehat_1  | []
writehat_1  | [pid: 27|app: 0|req: 3/8] 10.208.194.139 () {62 vars in 1465 bytes} [Wed Feb 22 06:52:01 2023] GET /engagements/report/82b44866-2ddc-4e5d-844f-6023393e397f/edit => generated 145 bytes in 30787 msecs (HTTP/1.1 500) 6 headers in 184 bytes (1 switches on core 0)
mongo_1     | {"t":{"$date":"2023-02-22T11:52:45.240+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1677066765:240802][1:0x7fbabcb46700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 219, snapshot max: 219 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 6558"}}

Does anyone have any idea how to fix this problem ? This will be my hero.

@s0alqasim1d
Copy link

I faced a similar issue after facing an issue with the mongo service that kept it crashing but all other services were fine. In my case, I solved the issue with mongo but would always get Errno 111 .

I attempted to connect from the writehat container via shell to the mongo service and I could connect without an issue. I had no errors on the mongo service as well so it wasn't the mongo service. It may have been that pymongo client on writehat service was initialized while the mongo service was down that caused the issue, because after I restarted the writehat service it worked fine.

Are you certain that your edits in python/django are valid? Do you get any errors in the mongo service logs?

@SnowEdyX
Copy link
Author

Hello and thank you for your response. As you requested, here are the Mongo logs :

{"t":{"$date":"2023-02-24T08:46:38.001+00:00"},"s":"I", "c":"CONTROL", "id":23285, "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"} {"t":{"$date":"2023-02-24T08:46:38.089+00:00"},"s":"I", "c":"NETWORK", "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."} {"t":{"$date":"2023-02-24T08:46:38.102+00:00"},"s":"I", "c":"STORAGE", "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":1,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"e714fa27db7b"}} {"t":{"$date":"2023-02-24T08:46:38.102+00:00"},"s":"I", "c":"CONTROL", "id":23403, "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.18","gitVersion":"8ed32b5c2c68ebe7f8ae2ebe8d23f36037a17dea","openSSLVersion":"OpenSSL 1.1.1f 31 Mar 2020","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2004","distarch":"x86_64","target_arch":"x86_64"}}}} {"t":{"$date":"2023-02-24T08:46:38.102+00:00"},"s":"I", "c":"CONTROL", "id":51765, "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"20.04"}}} {"t":{"$date":"2023-02-24T08:46:38.102+00:00"},"s":"I", "c":"CONTROL", "id":21951, "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"*"},"security":{"authorization":"enabled"}}}} {"t":{"$date":"2023-02-24T08:46:38.103+00:00"},"s":"W", "c":"STORAGE", "id":22271, "ctx":"initandlisten","msg":"Detected unclean shutdown - Lock file is not empty","attr":{"lockFile":"/data/db/mongod.lock"}} {"t":{"$date":"2023-02-24T08:46:38.109+00:00"},"s":"I", "c":"STORAGE", "id":22270, "ctx":"initandlisten","msg":"Storage engine to use detected by data files","attr":{"dbpath":"/data/db","storageEngine":"wiredTiger"}} {"t":{"$date":"2023-02-24T08:46:38.109+00:00"},"s":"W", "c":"STORAGE", "id":22302, "ctx":"initandlisten","msg":"Recovering data from the last clean checkpoint."} {"t":{"$date":"2023-02-24T08:46:38.109+00:00"},"s":"I", "c":"STORAGE", "id":22297, "ctx":"initandlisten","msg":"Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem","tags":["startupWarnings"]} {"t":{"$date":"2023-02-24T08:46:38.109+00:00"},"s":"I", "c":"STORAGE", "id":22315, "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=1461M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress,compact_progress],"}} {"t":{"$date":"2023-02-24T08:46:42.364+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1677228402:364054][1:0x7ff73fabfcc0], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 9 through 10"}} {"t":{"$date":"2023-02-24T08:46:42.672+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1677228402:672086][1:0x7ff73fabfcc0], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 10 through 10"}} {"t":{"$date":"2023-02-24T08:46:44.172+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1677228404:172108][1:0x7ff73fabfcc0], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Main recovery loop: starting at 9/150528 to 10/256"}} {"t":{"$date":"2023-02-24T08:46:44.189+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1677228404:189845][1:0x7ff73fabfcc0], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 9 through 10"}} {"t":{"$date":"2023-02-24T08:46:44.437+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1677228404:437411][1:0x7ff73fabfcc0], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 10 through 10"}} {"t":{"$date":"2023-02-24T08:46:44.621+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1677228404:621499][1:0x7ff73fabfcc0], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Set global recovery timestamp: (0, 0)"}} {"t":{"$date":"2023-02-24T08:46:44.622+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1677228404:622611][1:0x7ff73fabfcc0], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Set global oldest timestamp: (0, 0)"}} {"t":{"$date":"2023-02-24T08:46:44.690+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1677228404:690194][1:0x7ff73fabfcc0], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 4, snapshot max: 4 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 6840"}} {"t":{"$date":"2023-02-24T08:46:44.795+00:00"},"s":"I", "c":"STORAGE", "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":6686}} {"t":{"$date":"2023-02-24T08:46:44.796+00:00"},"s":"I", "c":"RECOVERY", "id":23987, "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}} {"t":{"$date":"2023-02-24T08:46:44.859+00:00"},"s":"I", "c":"STORAGE", "id":22262, "ctx":"initandlisten","msg":"Timestamp monitor starting"} {"t":{"$date":"2023-02-24T08:46:44.866+00:00"},"s":"W", "c":"CONTROL", "id":22178, "ctx":"initandlisten","msg":"/sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never'","tags":["startupWarnings"]} {"t":{"$date":"2023-02-24T08:46:45.010+00:00"},"s":"I", "c":"STORAGE", "id":20536, "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"} {"t":{"$date":"2023-02-24T08:46:45.066+00:00"},"s":"I", "c":"FTDC", "id":20625, "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"/data/db/diagnostic.data"}} {"t":{"$date":"2023-02-24T08:46:45.067+00:00"},"s":"I", "c":"REPL", "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigReplicationDisabled","oldState":"ConfigPreStart"}} {"t":{"$date":"2023-02-24T08:46:45.123+00:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"/tmp/mongodb-27017.sock"}} {"t":{"$date":"2023-02-24T08:46:45.124+00:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"0.0.0.0"}} {"t":{"$date":"2023-02-24T08:46:45.124+00:00"},"s":"I", "c":"NETWORK", "id":23016, "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}} {"t":{"$date":"2023-02-24T08:46:46.085+00:00"},"s":"I", "c":"FTDC", "id":20631, "ctx":"ftdc","msg":"Unclean full-time diagnostic data capture shutdown detected, found interim file, some metrics may have been lost","attr":{"error":{"code":0,"codeName":"OK"}}} {"t":{"$date":"2023-02-24T08:46:46.396+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.4:36078","connectionId":1,"connectionCount":1}} {"t":{"$date":"2023-02-24T08:46:46.403+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn1","msg":"client metadata","attr":{"remote":"172.18.0.4:36078","client":"conn1","doc":{"driver":{"name":"PyMongo","version":"3.11.0"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"4.19.0-23-amd64"},"platform":"CPython 3.8.10.final.0"}}} {"t":{"$date":"2023-02-24T08:46:46.446+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.4:36090","connectionId":2,"connectionCount":2}} {"t":{"$date":"2023-02-24T08:46:46.448+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn2","msg":"client metadata","attr":{"remote":"172.18.0.4:36090","client":"conn2","doc":{"driver":{"name":"PyMongo","version":"3.11.0"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"4.19.0-23-amd64"},"platform":"CPython 3.8.10.final.0"}}} {"t":{"$date":"2023-02-24T08:46:55.101+00:00"},"s":"I", "c":"-", "id":20883, "ctx":"conn1","msg":"Interrupted operation as its client disconnected","attr":{"opId":33}} {"t":{"$date":"2023-02-24T08:46:55.291+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn2","msg":"Connection ended","attr":{"remote":"172.18.0.4:36090","connectionId":2,"connectionCount":1}} {"t":{"$date":"2023-02-24T08:46:55.453+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn1","msg":"Connection ended","attr":{"remote":"172.18.0.4:36078","connectionId":1,"connectionCount":0}} {"t":{"$date":"2023-02-24T08:46:58.808+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.4:38480","connectionId":3,"connectionCount":1}} {"t":{"$date":"2023-02-24T08:46:58.810+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn3","msg":"client metadata","attr":{"remote":"172.18.0.4:38480","client":"conn3","doc":{"driver":{"name":"PyMongo","version":"3.11.0"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"4.19.0-23-amd64"},"platform":"CPython 3.8.10.final.0"}}} {"t":{"$date":"2023-02-24T08:46:58.845+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.4:38494","connectionId":4,"connectionCount":2}} {"t":{"$date":"2023-02-24T08:46:58.846+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn4","msg":"client metadata","attr":{"remote":"172.18.0.4:38494","client":"conn4","doc":{"driver":{"name":"PyMongo","version":"3.11.0"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"4.19.0-23-amd64"},"platform":"CPython 3.8.10.final.0"}}} {"t":{"$date":"2023-02-24T08:47:03.065+00:00"},"s":"I", "c":"-", "id":20883, "ctx":"conn3","msg":"Interrupted operation as its client disconnected","attr":{"opId":187}} {"t":{"$date":"2023-02-24T08:47:03.066+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn3","msg":"Connection ended","attr":{"remote":"172.18.0.4:38480","connectionId":3,"connectionCount":1}} {"t":{"$date":"2023-02-24T08:47:03.227+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn4","msg":"Connection ended","attr":{"remote":"172.18.0.4:38494","connectionId":4,"connectionCount":0}} {"t":{"$date":"2023-02-24T08:47:03.863+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.4:38510","connectionId":5,"connectionCount":1}} {"t":{"$date":"2023-02-24T08:47:03.865+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn5","msg":"client metadata","attr":{"remote":"172.18.0.4:38510","client":"conn5","doc":{"driver":{"name":"PyMongo","version":"3.11.0"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"4.19.0-23-amd64"},"platform":"CPython 3.8.10.final.0"}}} {"t":{"$date":"2023-02-24T08:47:03.940+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.4:38526","connectionId":6,"connectionCount":2}} {"t":{"$date":"2023-02-24T08:47:03.949+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn6","msg":"client metadata","attr":{"remote":"172.18.0.4:38526","client":"conn6","doc":{"driver":{"name":"PyMongo","version":"3.11.0"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"4.19.0-23-amd64"},"platform":"CPython 3.8.10.final.0"}}} {"t":{"$date":"2023-02-24T08:47:05.900+00:00"},"s":"I", "c":"-", "id":20883, "ctx":"conn5","msg":"Interrupted operation as its client disconnected","attr":{"opId":250}} {"t":{"$date":"2023-02-24T08:47:05.901+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn5","msg":"Connection ended","attr":{"remote":"172.18.0.4:38510","connectionId":5,"connectionCount":1}} {"t":{"$date":"2023-02-24T08:47:06.154+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn6","msg":"Connection ended","attr":{"remote":"172.18.0.4:38526","connectionId":6,"connectionCount":0}} {"t":{"$date":"2023-02-24T08:47:06.756+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.4:38534","connectionId":7,"connectionCount":1}} {"t":{"$date":"2023-02-24T08:47:06.757+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn7","msg":"client metadata","attr":{"remote":"172.18.0.4:38534","client":"conn7","doc":{"driver":{"name":"PyMongo","version":"3.11.0"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"4.19.0-23-amd64"},"platform":"CPython 3.8.10.final.0"}}} {"t":{"$date":"2023-02-24T08:47:06.774+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.4:38538","connectionId":8,"connectionCount":2}} {"t":{"$date":"2023-02-24T08:47:06.782+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn8","msg":"client metadata","attr":{"remote":"172.18.0.4:38538","client":"conn8","doc":{"driver":{"name":"PyMongo","version":"3.11.0"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"4.19.0-23-amd64"},"platform":"CPython 3.8.10.final.0"}}} {"t":{"$date":"2023-02-24T08:47:09.282+00:00"},"s":"I", "c":"-", "id":20883, "ctx":"conn7","msg":"Interrupted operation as its client disconnected","attr":{"opId":289}} {"t":{"$date":"2023-02-24T08:47:09.282+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn7","msg":"Connection ended","attr":{"remote":"172.18.0.4:38534","connectionId":7,"connectionCount":1}} {"t":{"$date":"2023-02-24T08:47:09.480+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn8","msg":"Connection ended","attr":{"remote":"172.18.0.4:38538","connectionId":8,"connectionCount":0}} {"t":{"$date":"2023-02-24T08:47:11.212+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.4:59384","connectionId":9,"connectionCount":1}} {"t":{"$date":"2023-02-24T08:47:11.213+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn9","msg":"client metadata","attr":{"remote":"172.18.0.4:59384","client":"conn9","doc":{"driver":{"name":"PyMongo","version":"3.11.0"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"4.19.0-23-amd64"},"platform":"CPython 3.8.10.final.0"}}} {"t":{"$date":"2023-02-24T08:47:11.255+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.4:59394","connectionId":10,"connectionCount":2}} {"t":{"$date":"2023-02-24T08:47:11.263+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn10","msg":"client metadata","attr":{"remote":"172.18.0.4:59394","client":"conn10","doc":{"driver":{"name":"PyMongo","version":"3.11.0"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"4.19.0-23-amd64"},"platform":"CPython 3.8.10.final.0"}}} {"t":{"$date":"2023-02-24T08:47:44.871+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1677228464:871819][1:0x7ff738ab0700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 6, snapshot max: 6 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 6840"}} {"t":{"$date":"2023-02-24T08:48:44.905+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1677228524:904996][1:0x7ff738ab0700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 9, snapshot max: 9 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 6840"}} {"t":{"$date":"2023-02-24T08:49:44.970+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1677228584:970101][1:0x7ff738ab0700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 11, snapshot max: 11 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 6840"}} {"t":{"$date":"2023-02-24T08:50:44.981+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1677228644:981249][1:0x7ff738ab0700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 13, snapshot max: 13 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 6840"}}

Thanks again for your help.

@s0alqasim1d
Copy link

I don't think this is mongo's fault. As you can see in the mongo logs it mentions that some connections are interrupted because the client disconnected.

{
  "t": {
    "$date": "2023-02-24T08:46:46.403+00:00"
  },
  "s": "I",
  "c": "NETWORK",
  "id": 51800,
  "ctx": "conn1",
  "msg": "client metadata",
  "attr": {
    "remote": "172.18.0.4:36078",
    "client": "conn1",
    "doc": {
      "driver": {
        "name": "PyMongo",
        "version": "3.11.0"
      },
      "os": {
        "type": "Linux",
        "name": "Linux",
        "architecture": "x86_64",
        "version": "4.19.0-23-amd64"
      },
      "platform": "CPython 3.8.10.final.0"
    }
  }
}
{
  "t": {
    "$date": "2023-02-24T08:46:55.101+00:00"
  },
  "s": "I",
  "c": "-",
  "id": 20883,
  "ctx": "conn1",
  "msg": "Interrupted operation as its client disconnected",
  "attr": {
    "opId": 33
  }
}
{
  "t": {
    "$date": "2023-02-24T08:46:55.453+00:00"
  },
  "s": "I",
  "c": "NETWORK",
  "id": 22944,
  "ctx": "conn1",
  "msg": "Connection ended",
  "attr": {
    "remote": "172.18.0.4:36078",
    "connectionId": 1,
    "connectionCount": 0
  }
}

It looks like an error in python caused the error with the connection to mongo.

From your first post:

...
writehat_1  | 2023-02-22 06:52:31 - ERROR   - log.py:  224 - Internal Server Error: /engagements/report/82b44866-2ddc-4e5d-844f-6023393e397f/edit
writehat_1  | Traceback (most recent call last):
writehat_1  |   File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 829, in _resolve_lookup
writehat_1  |     current = current[bit]
writehat_1  | TypeError: 'Report' object is not subscriptable
...

What kind of changes did you make to which file(s)? Are you certain there aren't any bad reactions to your modifications?

@SnowEdyX
Copy link
Author

Hello, and thank you for your quick response.

So I modified the TitlePage.py and TitlePage.html file to add new fields to my report. Except that by pure chance, now it works and I manage to return to the page. A new problem occurs to me, I can no longer preview the report :

image

Here are the changes made :

image

And :

image

Thank you very much for your availability

@s0alqasim1d
Copy link

s0alqasim1d commented Feb 24, 2023

writehat logs would help debug faster.

This happened to me when I tried adding some new property to the engagement class and then use it in a markdown component with the reference utility. The problem was that the property I added to the class was not added in the user_context and caused a similar reaction to yours. Without logs I cannot be sure.

Edit: I think you forgot the {% endif %} to close the if statement

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