Flag file 'afterfirstboot.lock' not found, can't complete install

I have been trying everything for well over 8 hours now, and nothing I do can get this thing working. I am on Pi 3 B+ and I have used multiple power supplies, multiple image loaders, multiple flavors of linux including raspbian and debian, and no matter what I do, following the instructions on this site word for word I cannot get openhab running. I had to do a reset because in my last build I lost root to all my accounts. I have tried re-running the first boot script, I have tried deleting /opt/openhab2, I have tried it over wifi and ethernet, nothing is working. It just keeps failing and I don’t know what to do at this point. On some installations it says failed to clone and on some it hasn’t

Lots of info packed into this small post. Can we start from the beginning.

What image are you flashing on your sd card to try to install?

I swear this is like throwing darts at a gorilla
 The next time I tried it again it worked. So now its back up, except there’s an error that says “No FireMotD ExportFile detected, generate with sudo .\FireMotD -S” and I tried everything on this post and nothing worked [SOLVED] OpenHAB 2.3.0-1 Stable: No FireMotD ExportFile detected

After getting cloud and paperui set up, all of a sudden none of my sitemaps work and I can’t access my local host or via cloud, and it was weird because it slowly stopped working. First classic ui stopped so I looked at paper ui and it wasn’t working, so I switched to paper ui over cloud and it was working fine along with my IFTTT commands, so I tried to open up the log over port 9001 and then it all stopped working. This all happened in a span of maybe 2 minutes
 I can still ssh into my pi but nothing is working. This whole thing has been a shit show

10 minutes later and it’s magically back up
 :roll_eyes:

Sorry, I’ve been frustrated. I haven’t touched it since the last post and it’s down again, so I have no idea what’s going on

Between this and your other thread. I believe you may have a hardware issue. Smells of power supply, possibly corrupting sd card.

I have a test RPI with openhabian image and get this same error each time. The solution is to be in the correct directory when you run sudo ./FireMotD. Like this:

cd /opt/FireMotD$ sudo ./FireMotD -I -v

As for your other issues I agree with @Thedannymullen sounds like a hardware problem. You mentioned trying multiple power supplies, just make sure it’s 5v 2.5A. If you used a weak power supply when installing then I would reflash the image as it may have gotten corrupted. If the power is good and the image is clean then get another SD card. I can verify the image from https://github.com/openhab/openhabian/releases/tag/v1.4.1 is good, I did an install yesterday. If you still have problems, try installing Raspian or another OS from here https://www.raspberrypi.org/downloads/ to verify it’s not an issue with the RPI.

1 Like

I installed rasbian via NOOBS yesterday and attempted to put openhab on there that way, and was unsuccesful. Clean install of openhabian and a multitude of errors. I tried cd /opt/FireMotD$ sudo ./FireMotD -I -v and it didn’t work, further adding to my frustration lol. I am going to grab my biggest power supply later (5v 2.4A) and try another clean install and see what I can get out of that.

That should be enough power to run RPI. If you’ve been using less, that may be the problem. I would also make sure the Ethernet cable is good and connect directly to your router for installing. I’ve never needed to do this but read it worked for others.

I have always used the ethernet cable. I just re-flashed the card and plugged it in and I am still getting the first boot script error.

Did you flash with Etcher or something different? I ask b/c Etcher takes care of re-formatting before flashing.

I did use Etcher, yes. I have tried all the free ones and I still get the same error every time.

Where is the “afterfirstboot.lock” file located?

Does your output look similar to this post https://community.openhab.org/t/solved-initial-setup-exiting-with-an-error/43318/2?u=h102

Not sure where afterfirstboot.lock is located. First-boot.sh and .log are in the /boot dir

I get the same error line that he does

Flag file ‘afterfirstboot.lock’ not found, continuing with /boot/first-boot.sh

The problem keeps pointing to the power supply. I try to use only the power supply that comes with the RPI. Some may list as 5v 2.1A but actually much less.

Someone you can borrow a power supply from?

Can you post a picture of the error?

This is what I’ve got after the first boot

Well looks like it was successful this time except the firemotd.

All I see it a typo.

You need to tyep cd /opt/FireMotD
Then type sudo ./FireMotD -I -v