Recent

Author Topic: Lazarus corrupted my entire project and Itself  (Read 1132 times)

Codrut1001

  • New Member
  • *
  • Posts: 22
Lazarus corrupted my entire project and Itself
« on: November 28, 2023, 08:01:41 pm »
I was using lazarus developing a application like normal, then suddenly I got a weird error

So I restarted the IDE, and I got a dialog telling me to upgrade lazarus to the new files? And It was like a welcome dialog asking me where to store project by default.

The IDE factory reset all settings to default, and all the files of the project I was working on are empty.

The Lazarus GUI is still a bit glitchy, the object inspector dissapears everytime I reopen lazarus.

What is even going on?

Is there a way to restore my files? I spent hours working on that project and have absolutely no backups whatsoever. :(

Edit:
I reinstalled lazarus, and now It wont even work anymore, It's giving me this error:
Code: [Select]
The system default lazarus executable "/usr/lib/lazarus/2.0.6/lazarus" is missing, but your customexecutable is still there:
/home/codrut/.lazarus/bin/lazarus
This will be started ...
« Last Edit: November 28, 2023, 08:06:28 pm by Codrut1001 »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9708
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus corrupted my entire project and Itself
« Reply #1 on: November 28, 2023, 08:12:02 pm »
What version of Lazarus?

Your OS?




As for backups, the IDE would usually have saved some in a backup folder in your project folder (4 or 5 recent versions).

Then when you say your files are empty => is that what the IDE says, or have you opened them in an external editor (notepad/gedit/...)?


Your config would be in a patch called "primary config path". On Windows
Code: Text  [Select][+][-]
  1. C:\Users\USERNAME\AppData\Local\lazarus

Since something has gone wrong => make a separate backup of everything mentioned above.




The question you were asked, means you likely tried to upgrade your IDE.
(Or downgrade, in which case you may need to upgrade again, as older IDE can not read the files from the newest IDE)

That should not normally cause any such issues.
In any case if you have installed packages (e.g. via online package manager) then you need to rebuild that IDE.

I suggest, that as soon as you made the above backups, you go to
menu: Tools > Configure build Lazarus.
There find the radio "clean all" and select it
Then click "build".

After that, restart the IDE, and try opening your project again.



Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9708
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus corrupted my entire project and Itself
« Reply #2 on: November 28, 2023, 08:13:47 pm »
Ok was missing the last bit
Quote
The system default lazarus executable "/usr/lib/lazarus/2.0.6/lazarus" is missing, but your customexecutable is still there:
/home/codrut/.lazarus/bin/lazarus
This will be started ...

Codrut1001

  • New Member
  • *
  • Posts: 22
Re: Lazarus corrupted my entire project and Itself
« Reply #3 on: November 28, 2023, 08:14:10 pm »
What version of Lazarus?

I was using lazarus 2.0.6 on linux Zorin OS 16.3 x86_64, and I tried no upgrades. I was just modifying some controls on the form before the error occurred and corrupted my files.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9708
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus corrupted my entire project and Itself
« Reply #4 on: November 28, 2023, 08:14:26 pm »
Ok was missing the last bit
Quote
The system default lazarus executable "/usr/lib/lazarus/2.0.6/lazarus" is missing, but your customexecutable is still there:
/home/codrut/.lazarus/bin/lazarus
This will be started ...

Backap the folder
/home/codrut/.lazarus/

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9708
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus corrupted my entire project and Itself
« Reply #5 on: November 28, 2023, 08:16:22 pm »
OK, someone with more Linux experience may add more info....

Did you install
- our release from sourceforge?
- the lazarus that comes with your distro (using the packagemanager that comes with your distro? yum/dnf/...)?

Codrut1001

  • New Member
  • *
  • Posts: 22
Re: Lazarus corrupted my entire project and Itself
« Reply #6 on: November 28, 2023, 08:18:34 pm »
OK, someone with more Linux experience may add more info....

Did you install
- our release from sourceforge?
- the lazarus that comes with your distro (using the packagemanager that comes with your distro? yum/dnf/...)?

I installed lazarus from the Ubuntu Software application, I am trying to install the forge version now

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9708
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus corrupted my entire project and Itself
« Reply #7 on: November 28, 2023, 08:21:42 pm »
In order to get back to a clean install.

The folder /home/codrut/.lazarus/ is you configuration (editoropts, other opts) and some internal stuff stored by the IDE.
You can/should backup then rename that folder.

- You may then have to use dnf/yum/rpm to run an uninstall of whatever broken remains there are
- Then do a new install.
- As you moved your config, you need to install any package again that you had installed (online package manager, etc).

Depending on how many config change you had made, we can then check how to restore parts of the config.
E.g. editoroptions.xml can usually be copied back. Other files may contain info that change with a new install..




Alternatively you can use a tool like FpcUpDeluxe and create an independent 2nd install.
(It installs some scripts into the chosen folder, and those must always be used to start the IDE)

Then you can use that to work on your files.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9708
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus corrupted my entire project and Itself
« Reply #8 on: November 28, 2023, 08:23:25 pm »

I installed lazarus from the Ubuntu Software application,

Ok, I don't know much about that. I am mainly Windows, but some Linux experience.

Anyway, until the Linux Gurus kick in, I hope there is something useful in my answers.

Codrut1001

  • New Member
  • *
  • Posts: 22
Re: Lazarus corrupted my entire project and Itself
« Reply #9 on: November 28, 2023, 08:27:41 pm »
In order to get back to a clean install.

Then you can use that to work on your files.

I was able to successfully reinstall Lazarus 2.0.6, but I cannot install packages as I get the error "error while linking"

I think I will reinstall the entire operating system, since I was planning to to that anyways, maybe than I will be able to use the IDE again.

It's a bit annoying that I lost that project of mine, but since It was written over, I don't have any hope on recovering my lost progress :/

Thanks for the help anyways! I appreciate It

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9708
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus corrupted my entire project and Itself
« Reply #10 on: November 28, 2023, 08:33:11 pm »
Some background, in case it is needed.

On linux the installation is usually made with root rights into /usr/*/*
Files there can not be changed, by normal users.

But when you install packages into the IDE, then the IDE needs to be rebuild. => For that a new "lazarus" exe is created in your home folder. /home/codrut/.lazarus/bin/lazarus

When you call "startlazarus" it will find this, and start it.

So that is where this message comes from.


For some reason your original files in /usr/ seem to have gone.
Maybe Ubuntu installed an upgrade (though I wouldn't expect them to have one now). In anycase something caused those files to be gone.

That most likely also meant the source code of lazarus itself => but the IDE uses that for code navigation. So you would get complaints from the IDE
.
You can search your /usr/lib/lazarus if there is any other version.




Quote
So I restarted the IDE, and I got a dialog telling me to upgrade lazarus to the new files? And It was like a welcome dialog asking me where to store project by default.

THis is why I though maybe a newer version (but that would have to be the release candidate) was installed.

The IDE knows were it used to be installed, and it can detect the version of the files that in finds as installation in /usr/

When that happens, normally you click ok. And in most case you need to rebuild the IDE to upgrade the /home/codrut/.lazarus/bin/lazarus copy.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9708
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus corrupted my entire project and Itself
« Reply #11 on: November 28, 2023, 08:33:45 pm »
In order to get back to a clean install.

Then you can use that to work on your files.

I was able to successfully reinstall Lazarus 2.0.6, but I cannot install packages as I get the error "error while linking"


Try the "clean all" I mentioned before.

Codrut1001

  • New Member
  • *
  • Posts: 22
Re: Lazarus corrupted my entire project and Itself
« Reply #12 on: November 29, 2023, 08:18:01 am »
Try the "clean all" I mentioned before.

That's what I used. And the liker error occured.

But I was able to pinpoint the issue to the fact that my disk is out of storage, I had around 50MB left. Could that also be the reason Lazarus got corrupted and emptied my files?

Thaddy

  • Hero Member
  • *****
  • Posts: 14031
  • Probably until I exterminate Putin.
Re: Lazarus corrupted my entire project and Itself
« Reply #13 on: November 29, 2023, 08:37:09 am »
Yes, basically. But as far as I understood Lazarus would check for storage space.
Checking for storage space on its own can still be not enough during install because of temp files.
In general your problems would also occur with other software installs.
Specialize a type, not a var.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9708
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus corrupted my entire project and Itself
« Reply #14 on: November 29, 2023, 08:50:09 am »
Try the "clean all" I mentioned before.

That's what I used. And the liker error occured.

But I was able to pinpoint the issue to the fact that my disk is out of storage, I had around 50MB left. Could that also be the reason Lazarus got corrupted and emptied my files?

It would explain why it may became unable to load. And as you said you tried a reinstall => that may have corrupted the files in /usr/ and then gotten you the next error.

Your project files would still fit that, but there may have temporary been less space. I wonder why you didn't get an error though, when it tried to save files.

Depending how often you tried to save files (and saved them empty) you may or may not still have something in the backup folder of your project (unless you explicitly disabled that)

 

TinyPortal © 2005-2018