Failure on install: "sed: -e: No such file or directory" #40

Closed
opened 2024-12-17 23:15:19 -03:00 by KMFSousa · 3 comments
KMFSousa commented 2024-12-17 23:15:19 -03:00 (Migrated from gitlab.com)

On the first install of sed in the install.sh I error out with sed: -e: No such file or directory

I put some aditional echo's in before it to issolate which one failed. It does appear the cp command also failed to copy the yaml and env files over. I ran that manually but it is still failing

I'm running this on macOS which from what I can tell should work

Here is my output with additional echos included

Checking prerequisites...
docker exists ✅ 
docker compose exists ✅ 
Where do you want to install the docker-compose file? [/opt/yams]: ~/Code/YAMS/
What's the user that is going to own the media server files? [kmfsousa]: 
Please, input your media directory [/srv/media]: ~/Code/srv/media
Are you sure your media directory is "~/Code/srv/media"? (y/N) [Default = n]: y



Time to choose your media service.
Your media service is responsible for serving your files to your network.
By default, YAMS supports 3 media services:
- jellyfin (recommended, easier)
- emby
- plex (advanced, always online)
Choose your media service [jellyfin]: 

YAMS is going to install "jellyfin" on port "8096"

Time to set up the VPN.
You can check the supported VPN list here: https://yams.media/advanced/vpn.
Do you want to configure a VPN? (Y/n) [Default = y]: n
Configuring the docker-compose file for the user "kmfsousa" on "~/Code/YAMS/"...

Copying docker-compose.example.yaml to ~/Code/YAMS//docker-compose.yaml...
docker-compose.example.yaml was copied successfuly! ✅

Copying .env.example to ~/Code/YAMS//.env...
.env.example was copied successfuly! ✅

Copying docker-compose.custom.yaml to ~/Code/YAMS//docker-compose.custom.yaml...
docker-compose.custom.yaml was copied successfuly! ✅
first sed
~/Code/YAMS//.env
502
20
~/Code/srv/media
jellyfin
~/Code/YAMS//docker-compose.yaml
sed: -e: No such file or directory

Install.sh modifications (added echos):

for file_mapping in "${copy_files[@]}"; do
    source_file="${file_mapping%%:*}"
    destination_file="${file_mapping##*:}"

    echo -e "\nCopying $source_file to $destination_file..."
    if cp "$source_file" "$destination_file"; then
        send_success_message "$source_file was copied successfuly! ✅"
    else
        send_error_message "Failed to copy $source_file to $destination_file. Ensure your user ($USER) has the necessary permissions ❌"
    fi
done

echo "first sed"

echo "$env_file"
echo "$puid"
echo "$pgid"
echo "$media_directory"
echo "$media_service"
echo "$filename"

sed -i -e "s|<your_PUID>|$puid|g" "$env_file" \
 -e "s|<your_PGID>|$pgid|g" "$env_file" \
 -e "s|<media_directory>|$media_directory|g" "$env_file" \
 -e "s|<media_service>|$media_service|g" "$env_file" \
 -e "s|<media_service>|$media_service|g" "$filename"
On the first install of `sed` in the install.sh I error out with `sed: -e: No such file or directory` I put some aditional echo's in before it to issolate which one failed. It does appear the `cp` command also failed to copy the yaml and env files over. I ran that manually but it is still failing I'm running this on macOS which from what I can tell should work Here is my output with additional echos included ``` Checking prerequisites... docker exists ✅ docker compose exists ✅ Where do you want to install the docker-compose file? [/opt/yams]: ~/Code/YAMS/ What's the user that is going to own the media server files? [kmfsousa]: Please, input your media directory [/srv/media]: ~/Code/srv/media Are you sure your media directory is "~/Code/srv/media"? (y/N) [Default = n]: y Time to choose your media service. Your media service is responsible for serving your files to your network. By default, YAMS supports 3 media services: - jellyfin (recommended, easier) - emby - plex (advanced, always online) Choose your media service [jellyfin]: YAMS is going to install "jellyfin" on port "8096" Time to set up the VPN. You can check the supported VPN list here: https://yams.media/advanced/vpn. Do you want to configure a VPN? (Y/n) [Default = y]: n Configuring the docker-compose file for the user "kmfsousa" on "~/Code/YAMS/"... Copying docker-compose.example.yaml to ~/Code/YAMS//docker-compose.yaml... docker-compose.example.yaml was copied successfuly! ✅ Copying .env.example to ~/Code/YAMS//.env... .env.example was copied successfuly! ✅ Copying docker-compose.custom.yaml to ~/Code/YAMS//docker-compose.custom.yaml... docker-compose.custom.yaml was copied successfuly! ✅ first sed ~/Code/YAMS//.env 502 20 ~/Code/srv/media jellyfin ~/Code/YAMS//docker-compose.yaml sed: -e: No such file or directory ``` Install.sh modifications (added echos): ``` for file_mapping in "${copy_files[@]}"; do source_file="${file_mapping%%:*}" destination_file="${file_mapping##*:}" echo -e "\nCopying $source_file to $destination_file..." if cp "$source_file" "$destination_file"; then send_success_message "$source_file was copied successfuly! ✅" else send_error_message "Failed to copy $source_file to $destination_file. Ensure your user ($USER) has the necessary permissions ❌" fi done echo "first sed" echo "$env_file" echo "$puid" echo "$pgid" echo "$media_directory" echo "$media_service" echo "$filename" sed -i -e "s|<your_PUID>|$puid|g" "$env_file" \ -e "s|<your_PGID>|$pgid|g" "$env_file" \ -e "s|<media_directory>|$media_directory|g" "$env_file" \ -e "s|<media_service>|$media_service|g" "$env_file" \ -e "s|<media_service>|$media_service|g" "$filename" ```
rogs commented 2024-12-17 23:22:44 -03:00 (Migrated from gitlab.com)

I'm running this on macOS which from what I can tell should work

YAMS doesn't work in MacOS. Read https://yams.media/install/steps/#dependencies

TL;DR MacOS sed is not the same as gnu-sed.

Screenshot_20241217_232227_Firefox

> I'm running this on macOS which from what I can tell should work YAMS doesn't work in MacOS. Read https://yams.media/install/steps/#dependencies TL;DR MacOS `sed` is not the same as `gnu-sed`. ![Screenshot_20241217_232227_Firefox](/uploads/8d467140cb8e151b1ec8c2fcb10f83a1/Screenshot_20241217_232227_Firefox.jpg)
rogs (Migrated from gitlab.com) closed this issue 2024-12-17 23:22:45 -03:00
KMFSousa commented 2024-12-17 23:59:44 -03:00 (Migrated from gitlab.com)

Ahh drats, thanks!

Ahh drats, thanks!
methbkts commented 2024-12-24 07:05:37 -03:00 (Migrated from gitlab.com)

@KMFSousa take a look at Colima if you absolutely want to run it on macOS

@KMFSousa take a look at [Colima](https://github.com/abiosoft/colima) if you absolutely want to run it on macOS
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rogs/yams#40
No description provided.