There are some reasons why you get that error.
First of all the error occurs if you a have filegroup with a damaged or missing data file, so you might want to check this first.
You can check in sys.databases state_desc column. If this states RECOVERY_PENDING, you need to set the file that is missing(or damaged) to offline state before you'll be able to get your database online and working.
ALTER DATABASE userDB MODIFY FILE (NAME=’damagedFile’, OFFLINE)
and then put the database online:
ALTER DATABASE userDB SET ONLINE
and it should work, but without you damaged file.
If you have a backup you can recover the damaged file from there.