KML import in 2.x

I’m using Siteground as the the hosting provider. I used the packaged tarball (which installed the package in a most horrible URL ever mysite//farmOS-2.0.0-beta1.tar/farmOS/web/…)
I have no idea how Docker works or how to use ir - or Composer - the more I read the more confused it became)
PHP 7.4.27

You might have luck contacting Siteground and telling them you want to install a Drupal 9 website. Maybe they have resources to help their customers do that.

Of course, you’ll excuse me if I suggest using Farmier for hosting? If you don’t want to deal with hosting/updating/backups/etc and just want to use farmOS it takes care of all that for you. :slight_smile:

Depends on what you need though… if you’re hoping to do some tinkering/development then self-hosting is the way to go. Farmier is more of a “farmOS-as-a-service” - handles the lower level hosting aspects, but you don’t get direct server access.

1 Like

their environment is at 9.x already - i already was getting annoying prompts urging me to upgrade from my version of drupal 9 to the latest incarnation. Farmier isn’t an option for us, I’m all the way in Africa and the internet breaks frequently

Well the fact that you have everything working except the private file uploads is great! You might want to reach out to Siteground about that issue specifically, and ask about file permissions…

I’ve even gone as far as changing the permissions on the both the parent directory and the folder itself to no avail.

Did you do this via a web UI that they provide (eg: CPanel)? Or via a command line terminal? Exactly what directories did you change the permissions of (this could have security concerns)?

Were you able to create a sites/default/private directory? Or not?

Can you please paste the exact lines that you added to your settings.php file?

The more specific details the better. :slight_smile:

i am tired - i ended up deleting the whole setup

Downloaded beta 2
Installed without a hitch :ok_hand:t4:

2 Likes

Glad to hear persistence paid off @debo ! :smile:

I have the same issue. I can’t upload images. I use docker with OS Windows 10. I also updated FarmOS to Beta2, but no luck with uploading images.

In settings.php I set $settings[‘file_private_path’] = ‘/opt/drupal/web/sites/default/private/files’;
I also tried other settings, but no luck. It seems to me that the settings.php is ignored.

1 Like

Folder permissions issue?
Or something in .htaccess file to block?

Is the file not uploading or just not being served by Apache when you try to view it?

1 Like

It seems I found a bug: Uploading pictures works in “Assets - seed”, but not in “Taxonomy - plant types”.

Also in “Taxonomy - plant types”: There are useful fields defined like “Days to transplant” or “Days to maturity”, but I don’t see them anywhere else.

1 Like

I can’t upload images. I use docker with OS Windows 10.

@Farmy are you using WSL2 to run Docker? Someone else reported that using WSL2 was the only way they were able to get bind-mounted Docker volumes (eg: for file uploads) to work.

In settings.php I set $settings[‘file_private_path’] = ‘/opt/drupal/web/sites/default/private/files’;

This is the correct path for a Docker-based install.

It seems to me that the settings.php is ignored.

Go to [your-farmOS-domain]/admin/config/media/file-system. Do you see /opt/drupal/web/sites/default/private/files under “Private file system path”? If so, then your settings.php is working, and therefore something else must be wrong.

It seems I found a bug: Uploading pictures works in “Assets - seed”, but not in “Taxonomy - plant types”.

Hmm. So that would suggest that your private filesystem is working correctly? If you’re able to upload ANYTHING ANYWHERE, then it’s probably working. I’m not sure why Plant Type uploads aren’t… that may indeed be a bug.

There are useful fields defined like “Days to transplant” or “Days to maturity”, but I don’t see them anywhere else.

These were fields added in farmOS v1 that never really got used anywhere, but we kept them in v2 in case anyone put data in there. They may get used by the Crop Planning module in the future…

I tested this and I cannot replicate it. Although I wonder: can you look in your sites/default/files directory to see if the plant type image was uploaded there instead of sites/default/private/files? The former is “public” while the latter is “private”. If it’s in the “public” directory, that might suggest there’s a bug when farmOS is installed without a private filesystem configured… please let me know.

Edit: oops I mixed things up - disregard the above. (Although maybe still worth checking to see if anything was uploaded into sites/default/files public directory (or a subdirectory therein)…

Cross-posting Share your JupyterLite Examples - #7 by Symbioquine for future reference since some folks may find JupyterLite a compelling way to do their KML imports - especially if they need more control over how fields are mapped/transformed during import.

3 Likes

I changed to Ubuntu Linux, also with Docker. Same thing here: I cant upload files. Here are some snapshots:



1 Like

@Farmy Hmm it does look like your configuration is correct. Is this only affecting the KML import? Are you able to upload to assets/terms now?

What Docker image are you using? farmos/farmos:2.0.0-beta2? Or farmos/farmos:2.x-dev?

I see that sites/default/private/files has full write access to everyone, but it is owned by papa:papa. Normally you would have a group of www-data, and only owner/group write access. I’m curious if a kml directory exists inside files and what the ownership/permission of that is…

After much sleuthing and pain here’s how I ultimately solved the upload issue
Seems to be a filepath problem
remove the first slash as in
change
/opt/drupal/web/sites/default/private/files
to
opt/drupal/web/sites/default/private/files

hopefully that’ll fix your problem

The problem is solved. Not that I changed anything, but suddenly it worked. I just can imagine that certain caches were not flushed or any garbage collection didn’t work for hours. Is there any other way to flush caches except under Configuration - Development - Performance - Clear all caches?

1 Like

Huh. Well glad it’s working! Although I wish we knew the cause. :thinking:

Is there any other way to flush caches except under Configuration - Development - Performance - Clear all caches?

That’s the main one - and should clear all Drupal caches. But I don’t think that would affect this…

Did you restart your server? I wonder if PHP’s opcache was affecting it…

Yes, I restarted the server several times.

1 Like

If it started working after restarting the server, then perhaps PHP’s Opcache was to blame. :person_shrugging: