msf error in binding while exploiting blue

when i set my ip as a local host it give me following error

[] 10.10.10.40:445 - Connecting to target for exploitation.
[-] 10.10.10.40:445 - NameError
[-] 10.10.10.40:445 - uninitialized constant RubySMB::Error::CommunicationError
[-] 10.10.10.40:445 - /usr/share/metasploit-framework/modules/exploits/windows/smb/ms17_010_eternalblue.rb:167:in rescue in smb_eternalblue' /usr/share/metasploit-framework/modules/exploits/windows/ /usr/bin/msfconsole:48:in
[
] Exploit completed, but no session was created.

and when i try my hackthebox ip it gives me this error

Handler failed to bind to 10.10.10.12:4444:- -
[-] Handler failed to bind to 0.0.0.0:4444:- -
[-] 10.10.10.40:445 - Exploit failed [bad-config]: Rex::BindFailed The address is already in use or unavailable: (0.0.0.0:4444).
[*] Exploit completed, but no session was created.

where is the prob while using HTB ip exploiting completes but i get no session on it

You have to use LHOST the Hack The Box IP
Look at what IP tun0 gave you and use that
You should get something like:
[] 10.10.10.40:445 - Connecting to target for exploitation.
[+] 10.10.10.40:445 - Connection established for exploitation.
[+] 10.10.10.40:445 - Target OS selected valid for OS indicated by SMB reply
[
] 10.10.10.40:445 - CORE raw buffer dump (42 bytes)

@Cybernix said:
when i set my ip as a local host it give me following error

[] 10.10.10.40:445 - Connecting to target for exploitation.
[-] 10.10.10.40:445 - NameError
[-] 10.10.10.40:445 - uninitialized constant RubySMB::Error::CommunicationError
[-] 10.10.10.40:445 - /usr/share/metasploit-framework/modules/exploits/windows/smb/ms17_010_eternalblue.rb:167:in rescue in smb_eternalblue' /usr/share/metasploit-framework/modules/exploits/windows/ /usr/bin/msfconsole:48:in
[
] Exploit completed, but no session was created.

and when i try my hackthebox ip it gives me this error

Handler failed to bind to 10.10.10.12:4444:- -
[-] Handler failed to bind to 0.0.0.0:4444:- -
[-] 10.10.10.40:445 - Exploit failed [bad-config]: Rex::BindFailed The address is already in use or unavailable: (0.0.0.0:4444).
[*] Exploit completed, but no session was created.

where is the prob while using HTB ip exploiting completes but i get no session on it

ALL things oKAy …only u have to change your LPORT and LHOST…

i had issues on that box just cause its so busy so you might have to hammer it with the exploit a few times, pretty sure i ran it at least 4 times and it finally took