Author Topic: [FIXED] Oblige failing to generate on Linux  (Read 115 times)

Polygon

  • Posts: 8
[FIXED] Oblige failing to generate on Linux
« on: January 05, 2018, 12:46:46 PM »
When trying to generate maps this error often shows up resulting in it being unreliable.



This wouldn't normally be an issue but I'm trying to automate this process on a dedicated server and this is making it difficult to reliably generate maps.

This is happening both on my Ubuntu dedicated server and Arch Machine. The issue is seemingly not present in Windows or macOS.

And yes I have checked if the image exists, It does.

How can I fix this issue?
« Last Edit: January 09, 2018, 02:15:26 AM by andrewj »

Polygon

  • Posts: 8
Re: Oblige failing to generate on Linux
« Reply #1 on: January 05, 2018, 01:12:20 PM »
I may have fixed the issue. Not sure exactly where it is, But It may be a permissions issue.

Applying permissions 755 recursively to the oblige directory seems to fix the issue.

Code: [Select]
chmod -R 755 <obligedirectory>

Polygon

  • Posts: 8
Re: Oblige failing to generate on Linux
« Reply #2 on: January 05, 2018, 07:25:45 PM »
I am replying once again to report that this did not actually fix the issue. So once again I'm at a loss here.

andrewj

  • Developer
  • *****
  • Posts: 1535
Re: Oblige failing to generate on Linux
« Reply #3 on: January 06, 2018, 12:02:22 AM »
I had a quick look through the code, but I don't have any idea what is wrong.

If the TGA image was corrupt, then that would produce a different error that what you are seeing.

To make the error happen more often, edit scripts/title_gen.lua and find the following line:
Code: [Select]
  elseif rand.odds(35) then
    Title_gen_wall_scene()
and change the 35 to 100.  Change the odds of the other ones to zero and the error should happen every time.

You can try editing the gui/lib_tga.cc code, add the following to the beginning of the TGA_LoadImage function:
Code: [Select]
fprintf(stderr, "Image path: %s\n", path);
recompile Oblige and then check that the path is correct.  (Run in a terminal to see the message).

I don't know what else to suggest.  I develop in Debian Linux and have never seen something like this.

Polygon

  • Posts: 8
Re: Oblige failing to generate on Linux
« Reply #4 on: January 06, 2018, 10:33:19 AM »
I will try this and check if the path is correct  :'( This is disappointing as I was trying to make something really cool powered by Oblige.

Polygon

  • Posts: 8
Re: Oblige failing to generate on Linux
« Reply #5 on: January 06, 2018, 10:42:20 AM »
Here is exactly what I did and the output of the script and oblige.

Code: [Select]
zandronum@ngc:~/zandronum/obligegen$ ./genwadforserver.sh ir
Generating new wad oblige_ir_20180106_133922.wad
Image path: data/bg/airduct.tga
Script Error
FAILED!
Oblige Failed to Generate Mapset, Exiting.

and checking in data/bg/ with ls output this.
Code: [Select]
zandronum@ngc:~/Oblige-7.70-source/data/bg$ ls
airduct.tga  block1.tga  block2.tga  cement.tga  lamp1.tga  lamp2.tga  lamp3.tga

airduct.tga is indeed in that directory.

Permissions as well for these files

Code: [Select]
zandronum@ngc:~/Oblige-7.70-source/data/bg$ ls -la
total 340
drwxr-xr-x 2 zandronum zandronum   4096 Aug  6 13:12 .
drwxr-xr-x 4 zandronum zandronum   4096 Aug  6 13:12 ..
-rwxr-xr-x 1 zandronum zandronum  25465 Aug  6 13:12 airduct.tga
-rwxr-xr-x 1 zandronum zandronum 192534 Aug  6 13:12 block1.tga
-rwxr-xr-x 1 zandronum zandronum  40098 Aug  6 13:12 block2.tga
-rwxr-xr-x 1 zandronum zandronum  59565 Aug  6 13:12 cement.tga
-rwxr-xr-x 1 zandronum zandronum   3775 Aug  6 13:12 lamp1.tga
-rwxr-xr-x 1 zandronum zandronum   3412 Aug  6 13:12 lamp2.tga
-rwxr-xr-x 1 zandronum zandronum   3696 Aug  6 13:12 lamp3.tga

Another Successful Generation.

Code: [Select]
zandronum@ngc:~/zandronum/obligegen$ ./genwadforserver.sh ir
Generating new wad oblige_ir_20180106_134951.wad
Image path: data/logo1.tga
Making MAP01
Making MAP02

But seemingly whenever an image path is called from data/bg/ it seems to fail

Code: [Select]
zandronum@ngc:~/zandronum/obligegen$ ./genwadforserver.sh ir
Generating new wad oblige_ir_20180106_135101.wad
Image path: data/bg/cement.tga
Script Error
FAILED!
Oblige Failed to Generate Mapset, Exiting.
« Last Edit: January 06, 2018, 10:53:22 AM by Polygon »

andrewj

  • Developer
  • *****
  • Posts: 1535
Re: Oblige failing to generate on Linux
« Reply #6 on: January 07, 2018, 05:31:08 AM »
What is the output of "ls -la" from the data/ directory?

Oblige has a virtual file system to support addons, implemented using the PHYSFS library (bundled with the code).  This issue may be related to that library, though *everything* goes through the VFS so any issue would normally cause a failure much earlier, like when loading the scripts.  If you want to try disabling the VFS, you will need to clone the GIT repository and build that, because I tried it myself and had to fix something.

Polygon

  • Posts: 8
Re: Oblige failing to generate on Linux
« Reply #7 on: January 07, 2018, 10:32:32 AM »
Here is the ls -la output for the data/ directory

Code: [Select]
zandronum@ngc:~/Oblige-7.70-source/data$ ls -la
total 20
drwxr-xr-x  4 zandronum zandronum 4096 Aug  6 13:12 .
drwxr-xr-x 17 zandronum zandronum 4096 Jan  6 13:37 ..
drwxr-xr-x  2 zandronum zandronum 4096 Aug  6 13:12 bg
-rwxr-xr-x  1 zandronum zandronum 2714 Aug  6 13:12 logo1.tga
drwxr-xr-x  2 zandronum zandronum 4096 Aug  6 13:12 masks

Also I'm not sure I follow with this whole other library and needing to compile that as well. I'm not a developer, I'm an administrator.
« Last Edit: January 07, 2018, 12:16:26 PM by Polygon »

andrewj

  • Developer
  • *****
  • Posts: 1535
Re: Oblige failing to generate on Linux
« Reply #8 on: January 08, 2018, 01:56:35 AM »
Here is the ls -la output for the data/ directory
That looks ok too.

I don't have any more ideas on what could be wrong.

If you want to package up your project into a tar or zip file, I am happy to try running it here.  You can PM me a link if you'd rather keep it private.

andrewj

  • Developer
  • *****
  • Posts: 1535
Re: Oblige failing to generate on Linux
« Reply #9 on: January 08, 2018, 06:45:27 PM »
I have figured out the problem.

You see, I personally always run Oblige in a "local" way, i.e. using "./Oblige" which loads files from the shell's current directory.

So I forgot that some people do a "make install", which stores files to a directory like /usr/share/oblige.  And since make install is not installing the "data/bg/*" files, Oblige is not finding them when it runs, causing your error.

Hence I need to fix the makefiles and re-upload the source package.

For your use case, I don't think you want to install all the files globally.  You can force running locally like this:
Code: [Select]
Oblige --install .or
Code: [Select]
Oblige --install /full/path/to/oblige

Polygon

  • Posts: 8
Re: Oblige failing to generate on Linux
« Reply #10 on: January 08, 2018, 06:57:21 PM »
One moment I will take a look. I sent you a pm but the file is not there anymore because I would REALLY prefer not to make the script we use public for it. Not yet at least. But I will try doing that.

Polygon

  • Posts: 8
Re: Oblige failing to generate on Linux
« Reply #11 on: January 08, 2018, 07:03:47 PM »
This indeed fixes the problem. Before I was not using the --install flag and yes you are correct. Oblige is not actually globally installed on the system. Just within that folder. Adding in the install folder as the source directory where the oblige binary was compiled definitely fixes the issue, Thank you very much.

andrewj

  • Developer
  • *****
  • Posts: 1535
Re: Oblige failing to generate on Linux
« Reply #12 on: January 09, 2018, 02:15:09 AM »
Good to know it is working now :)

I have uploaded a fixed source package to SourceForge (fixing the Makefile to install the data/bg/* files).