Guys i have a more simplified solution:-
1-Turn off your ps4
2-turn off your internet
3-wait for 5 minutes
4-Turn your internet and ps4 at the same time
5-done,see if it worked.
note:-you must have ps plus membership to be able sign in ps4.
note:-for those who use another psn account as primary(for ps plus) then you must sign in with the other account first
then with the other one(the one you usually play with online).