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

(1048, "Column 'api_key' cannot be null") #138

Closed
keldnorman opened this issue Sep 17, 2022 · 1 comment
Closed

(1048, "Column 'api_key' cannot be null") #138

keldnorman opened this issue Sep 17, 2022 · 1 comment

Comments

@keldnorman
Copy link

Where do i miss an API key when i am seeing this error ? (1048, "Column 'api_key' cannot be null")


  • 18:06:22 home - SUCCESS Adding a new tower: <Tower: 238-1-2600-39752.0, loc: 55.872089437,12.358322492, time: 2022-09-17 18:06:22, freq: 1815.0>

Exception happened during processing of request from
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 747, in init
self.handle()
File "/root/source/CrocodileHunter/crocodilehunter/src/watchdog.py", line 563, in handle
wd_inst.process_tower(data)
File "/root/source/CrocodileHunter/crocodilehunter/src/watchdog.py", line 276, in process_tower
self.db_session.commit()
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/scoping.py", line 163, in do
return getattr(self.registry(), name)(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/session.py", line 1042, in commit
self.transaction.commit()
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/session.py", line 502, in commit
self._assert_active(prepared_ok=True)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/session.py", line 289, in _assert_active
raise sa_exc.InvalidRequestError(
sqlalchemy.exc.InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (MySQLdb._exceptions.OperationalError) (1048, "Column 'api_key' cannot be null")
[SQL: INSERT INTO tower_data (mcc, mnc, tac, cid, phyid, earfcn, lat, lon, timestamp, rssi, suspiciousness, frequency, enodeb_id, sector_id, cfo, rsrq, snr, rsrp, tx_pwr, est_dist, raw_sib1, classification, external_db, api_key, ext_id, uploaded) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)]
[parameters: (238, 1, 2600, 10176356, 401, 300, 55.871948207, 12.358092724, datetime.datetime(2022, 9, 17, 18, 4, 58), -42.5467, 0, 2140.0, 39751.0, 100.0, -2.04403, -13.8662, 4.09863, -11.6939, -4.5133, 0.4028981911256925, '4948e00391c00723800c28a026d1d9206006020611308d848d2e0000', 'unknown', 'unknown', None, None, None)]
(Background on this error at: http://sqlalche.me/e/13/e3q8) (Background on this error at: http://sqlalche.me/e/13/7s2a)

@cooperq
Copy link
Collaborator

cooperq commented Oct 25, 2022

Okay I finally looked into this. For some reason I made the api_key and some other fields "NOT NULL" which is not how it should be. I have fixed that and now it should all work. You might need to recreate your database or modify it manually for those changes to take effect. Fixed in 44298d0

@cooperq cooperq closed this as completed Oct 25, 2022
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