Question

Why am I getting this error when deploying (running remote build): Expecting value: line 1 column 1 (char 0)

I am trying to deploy a Python script that requires external libraries from a windows machine. I have tried using a .sh build script like in all of the digital ocean sample repos. But that gives me an error that build.sh won’t run on this platform, and no build.cmd is provided. So I try to replace it with a build.cmd but it gives me json decoding error in my logs.

This is the final output it gives me Error: While deploying action ‘test-slack-2/test’ (running remote build): Expecting value: line 1 column 1 (char 0)

Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi thank you for the help and quick response. But that didn’t work my VS code environment already uses LF and when I ran the build.sh through dos2unix it still gave me the error below.

build.sh’ won’t run on this platform and no ‘build.cmd’ is provided

And trying to run dos2unix on build.cmd gives the same error as well.

(running remote build): Expecting value: line 1 column 1 (char 0)

Bobby Iliev
Site Moderator
Site Moderator badge
April 28, 2023

Hi there,

It sounds the issue might be related to newline characters in your script files. Windows and Linux use different newline characters: Windows uses \r\n (carriage return and line feed), while Linux uses \n (line feed).

To resolve this issue, you can try converting your build script and other relevant files to use the appropriate newline characters for your target platform (Linux in your case).

Here are a couple of ways to convert newline characters:

  1. Using a text editor: Many text editors, such as Notepad++, Visual Studio Code, or Sublime Text, allow you to change the newline characters’ format. You can usually find this option in the editor’s settings, preferences, or status bar. Look for “Line Endings” or “EOL Conversion” and change it to “Unix (LF)”.

  2. Using dos2unix tool: If you have access to a Unix-based system or WSL (Windows Subsystem for Linux) on your Windows machine, you can use the dos2unix tool to convert the newline characters. To use dos2unix, install it first, and then run the following command:

dos2unix build.sh

Replace build.sh with the name of your script file. This command will convert the newline characters in the file to Unix-style line endings.

After converting the newline characters, try deploying your Python script again.

Let me know how it goes!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel