Uploaded image for project: 'TrueNAS'
  1. TrueNAS
  2. NAS-109006

SQL error generated when trying to create iSCSI authorized access group

    XMLWordPrintable

    Details

    • Impact:
      High

      Description

      I was unable to start the iSCSI service on anything higher than 12.0-Release until I not only disabled but deleted all authorized access groups. When I go to create a new one in 12.0-U1.1 I get the following error that appears to be SQL related.

      Error: Traceback (most recent call last):
        File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1247, in _execute_context
          self.dialect.do_execute(
        File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 590, in do_execute
          cursor.execute(statement, parameters)
      sqlite3.IntegrityError: NOT NULL constraint failed: services_iscsitargetauthcredential.iscsi_target_auth_peersecret
      
      The above exception was the direct cause of the following exception:
      
      Traceback (most recent call last):
        File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 137, in call_method
          result = await self.middleware._call(message['method'], serviceobj, methodobj, params, app=self,
        File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1195, in _call
          return await methodobj(*prepared_call.args)
        File "/usr/local/lib/python3.8/site-packages/middlewared/service.py", line 455, in create
          rv = await self.middleware._call(
        File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1195, in _call
          return await methodobj(*prepared_call.args)
        File "/usr/local/lib/python3.8/site-packages/middlewared/schema.py", line 973, in nf
          return await f(*args, **kwargs)
        File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/iscsi.py", line 333, in do_create
          data['id'] = await self.middleware.call(
        File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1238, in call
          return await self._call(
        File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1195, in _call
          return await methodobj(*prepared_call.args)
        File "/usr/local/lib/python3.8/site-packages/middlewared/schema.py", line 973, in nf
          return await f(*args, **kwargs)
        File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/datastore/write.py", line 31, in insert
          await self.middleware.call('datastore.execute_write', table.insert().values(**insert))
        File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1238, in call
          return await self._call(
        File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1195, in _call
          return await methodobj(*prepared_call.args)
        File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/datastore/connection.py", line 65, in execute_write
          return await self.middleware.run_in_executor(self.thread_pool, self._execute_write, sql, binds)
        File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1110, in run_in_executor
          return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
        File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
          result = self.fn(*self.args, **self.kwargs)
        File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/datastore/connection.py", line 68, in _execute_write
          result = self.connection.execute(sql, binds)
        File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 976, in execute
          return self._execute_text(object_, multiparams, params)
        File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1145, in _execute_text
          ret = self._execute_context(
        File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1287, in _execute_context
          self._handle_dbapi_exception(
        File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1481, in _handle_dbapi_exception
          util.raise_(
        File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
          raise exception
        File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1247, in _execute_context
          self.dialect.do_execute(
        File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 590, in do_execute
          cursor.execute(statement, parameters)
      sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) NOT NULL constraint failed: services_iscsitargetauthcredential.iscsi_target_auth_peersecret
      [SQL: INSERT INTO services_iscsitargetauthcredential (iscsi_target_auth_tag, iscsi_target_auth_user, iscsi_target_auth_secret, iscsi_target_auth_peeruser) VALUES (?, ?, ?, ?)]
      [parameters: (1, 'iqn.1991-05.com.microsoft:dc-server.cookiemonster.lan', '4vIyTOr+ie9g3K8quWktTFBa/f4f0LwWqPncbkHOnm5TwLaDnAXuPA==', '')]
      (Background on this error at: http://sqlalche.me/e/gkpj)

       

        Attachments

          Attachments

            JEditor

              Issue Links

                Activity

                  People

                  Assignee:
                  vladimirv Vladimir Vinogradenko
                  Reporter:
                  mouseskowitz Philip Cook
                  Votes:
                  2 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved: