Is there a solution for the odd error of bitbake? - linux

When I used yocto to build my first linux system and after 'bitbake imx-image-multimedia' was excuted, I faced the odd error:
ERROR: gnu-config-native-20190501+gitAUTOINC+b98424c249-r0 do_unpack: Unpack failure for URL: 'git://git.savannah.gnu.org/config.git'. No up to date source found: clone directory not available or not up to date: /home/admin/Linux/Yocto/fsl/downloads//git2/git.savannah.gnu.org.config.git; shallow clone not enabled
ERROR: Logfile of failure stored in: /home/admin/Linux/Yocto/fsl/build/tmp/work/x86_64-linux/gnu-config-native/20190501+gitAUTOINC+b98424c249-r0/temp/log.do_unpack.73483
ERROR: Task (virtual:native:/home/admin/Linux/Yocto/fsl/sources/poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb:do_unpack) failed with exit code '1'
Curious about the logfile, I opened /home/admin/Linux/Yocto/fsl/build/tmp/work/x86_64-linux/gnu-config-native/20190501+gitAUTOINC+b98424c249-r0/temp/log.do_unpack.73483 and I see:
DEBUG: Executing python function do_unpack
DEBUG: Executing python function base_do_unpack
DEBUG: Running 'export PSEUDO_DISABLED=1; unset _PYTHON_SYSCONFIGDATA_NAME; export SSH_AUTH_SOCK="/run/user/0/vscode-ssh-auth-sock-7925763"; export PATH="/home/admin/Linux/Yocto/fsl/sources/poky/scripts/native-intercept:/home/admin/Linux/Yocto/fsl/sources/poky/scripts:/home/admin/Linux/Yocto/fsl/build/tmp/work/x86_64-linux/gnu-config-native/20190501+gitAUTOINC+b98424c249-r0/recipe-sysroot-native/usr/bin/x86_64-linux:/home/admin/Linux/Yocto/fsl/build/tmp/work/x86_64-linux/gnu-config-native/20190501+gitAUTOINC+b98424c249-r0/recipe-sysroot-native/usr/bin:/home/admin/Linux/Yocto/fsl/build/tmp/work/x86_64-linux/gnu-config-native/20190501+gitAUTOINC+b98424c249-r0/recipe-sysroot-native/usr/sbin:/home/admin/Linux/Yocto/fsl/build/tmp/work/x86_64-linux/gnu-config-native/20190501+gitAUTOINC+b98424c249-r0/recipe-sysroot-native/usr/bin:/home/admin/Linux/Yocto/fsl/build/tmp/work/x86_64-linux/gnu-config-native/20190501+gitAUTOINC+b98424c249-r0/recipe-sysroot-native/sbin:/home/admin/Linux/Yocto/fsl/build/tmp/work/x86_64-linux/gnu-config-native/20190501+gitAUTOINC+b98424c249-r0/recipe-sysroot-native/bin:/home/admin/Linux/Yocto/fsl/sources/poky/bitbake/bin:/home/admin/Linux/Yocto/fsl/build/tmp/hosttools"; export HOME="/root"; git -c core.fsyncobjectfiles=0 branch --contains b98424c249119b79d3f709e26eb86f2fd4d5e5f3 --list master 2> /dev/null | wc -l' in /home/admin/Linux/Yocto/fsl/downloads//git2/git.savannah.gnu.org.config.git
ERROR: Unpack failure for URL: 'git://git.savannah.gnu.org/config.git'. No up to date source found: clone directory not available or not up to date: /home/admin/Linux/Yocto/fsl/downloads//git2/git.savannah.gnu.org.config.git; shallow clone not enabled
DEBUG: Python function base_do_unpack finished
DEBUG: Python function do_unpack finished
What is 'ERROR: Unpack failure for URL: git://git.savannah.gnu.org/config.git'. No up to date source found: clone directory not available or not up to date: /home/admin/Linux/Yocto/fsl/downloads//git2/git.savannah.gnu.org.config.git; shallow clone not enabled means?
What can I do to fix it? Thanks!

See first if this is similar to this thread
Currently, for my Yocto builds (for nxp and other boards) I used to share a same "downloads" DL_DIR to avoid unnecessary fetch operations.
I tried to use an empty DL_DIR...and it worked fine.
After investigating, I found out there is something wrecked in the "git2" sub-directory of DL_DIR.
I don't know what exactly.
So if you have a custom DL_DIR with a lot of stuff, try to rename your "git2" subdir as "git2.bak".
Check also if the // seen in /home/admin/Linux/Yocto/fsl/downloads//git2/git.savannah.gnu.org.config.git means an empty environment variable, meaning check if there should be an intermediate folder between downloads/ and /git2.

I've recently encountered this problem. I had an empty do_fetch function
do_fetch(){
:
}
. Just by removing it, the git repo was cloned properly.

Related

bitbake do_fetch[nostamp] = "1" has no effect

I am trying to install the compiled firmware for a microprocessor in my yocto image. This firmware is sent to a microprocessor on startup. The compiler for this firmware only runs on windows, therefore it is not possible to just clone the git repository and compile during build. I get this firmware file from the artifacts of a GitLab CI CD pipeline.
For debugging purposes, i would like to download this firmware file from the master branch, everytime that I build the image.
I previously worked with a custom do_fetch task and had set do_fetch[nostamp] = "1". This worked, but I ran into trouble when curl just put the 404 Error into the file. I have now tried to switch to wget and SRC_URI, but even though the nostamp is still set, it generates a .done file. It now never downloads the file again.
Here is the Recipe file I use:
S = "${WORKDIR}/"
PRIVATE_TOKEN = "xxxxxxxxxxx" # redacted
PROJECT_ID = "224"
VERSION = "2.00.01"
TAG = "master"
DOWNLOAD_FILE_PATH = "Production/firmware.bin"
INSTALL_NAME = "my-firmware-file.bin"
VERSION_FILE = "version.txt"
URL = "https://git.mycompany.com/api/v4/projects/${PROJECT_ID}/jobs/artifacts/${TAG}/raw/${DOWNLOAD_FILE_PATH}?job=publish_executable"
FETCHCMD_wget = "/usr/bin/env wget --header "PRIVATE-TOKEN: ${PRIVATE_TOKEN}""
BB_STRICT_CHECKSUM = "0"
SRC_URI = "${URL};downloadfilename=${INSTALL_NAME}"
do_fetch[nostamp] = "1"
do_patch(){
echo ${VERSION} > ${VERSION_FILE}
}
do_install(){
install -d ${D}${libdir}/test-dir/${PN}
# Install binary from artifacts
install -m 644 ${S}${INSTALL_NAME} ${D}${libdir}/test-dir/${PN}/${INSTALL_NAME}
# Instal version file created from tag
install -m 644 ${S}${VERSION_FILE} ${D}${libdir}/test-dir/${PN}/${VERSION_FILE}
}
FILES_${PN} += "${libdir}/test-dir/${PN}"
After running the recipe (either bitbake <PN> or bitbake <PN> -c fetch -f) I can run ls -la build/download | grep my-firmware-file and it shows two entries:
-rw-rw-r-- 1 root root 613924 Nov 11 11:50 my-firmware-file.bin
-rw-rw-r-- 1 root root 463 Nov 14 14:26 my-firmware-file.bin.done
As you see, it generated a .done file, that is newer than the last download of the actual file. Even when changing the TAG variable, no new file is downloaded. However for some reason, it always puts the correct version into the version.txtfile.
What am I missing? I could run a cleanall before every build, but that does not seem like a permanent solution. Also, the endgoal is to version the recipe and use the package version to pull from the correct release, but currently it pulls from master, so this does not make much sense.
Update: I checked the logfiles, and it seems wget is not the problem, as the command is never even executed. The first time after a clean, the log for do_fetch looks like this:
DEBUG: Executing python function extend_recipe_sysroot
NOTE: Direct dependencies are []
NOTE: Installed into sysroot: []
NOTE: Skipping as already exists in sysroot: []
DEBUG: Python function extend_recipe_sysroot finished
DEBUG: Executing python function do_fetch
DEBUG: Executing python function base_do_fetch
DEBUG: Trying PREMIRRORS
DEBUG: Trying Upstream
DEBUG: Fetching https://git.mycompany.com/api/v4/projects/224/jobs/artifacts/master/raw/Production/firmware.bin?job=publish_executable;downloadfilename=my-firmware-file.bin using command '/usr/bin/env wget -r --header "PRIVATE-TOKEN: xxxxxxxxxxxxxx" -O /home/.../build/downloads/my-firmware-file.bin.tmp -P /home/.../build/downloads 'https://git.mycompany.com/api/v4/projects/224/jobs/artifacts/master/raw/Production/firmware.bin?job=publish_executable''
DEBUG: Fetcher accessed the network with the command /usr/bin/env wget -r --header "PRIVATE-TOKEN: xxxxxxxxxxxxxx" -O /home/.../build/downloads/my-firmware-file.bin.tmp -P /home/.../build/downloads 'https://git.mycompany.com/api/v4/projects/224/jobs/artifacts/master/raw/Production/firmware.bin?job=publish_executable'
DEBUG: Running export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1005/bus"; export PATH="..."; export HOME="/home/..."; /usr/bin/env wget -r --header "PRIVATE-TOKEN: xxxxxxxxxxxxxx" -O /home/.../build/downloads/my-firmware-file.bin.tmp -P /home/.../build/downloads 'https://git.mycompany.com/api/v4/projects/224/jobs/artifacts/master/raw/Production/firmware.bin?job=publish_executable' --progress=dot -v
WARNING: combining -O with -r or -p will mean that all downloaded content
will be placed in the single file you specified.
--2022-11-18 07:01:11-- https://git.mycompany.com/api/v4/projects/224/jobs/artifacts/master/raw/Production/firmware.bin?job=publish_executable
Resolving git.mycompany.com (git.mycompany.com)... <IP>
Connecting to git.mycompany.com (git.mycompany.com)|<IP>|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 613924 (600K) [application/octet-stream]
Saving to: ‘/home/.../build/downloads/my-firmware-file.bin.tmp’
2022-11-18 07:01:11 (70.4 MB/s) - ‘/home/.../build/downloads/my-firmware-file.bin.tmp’ saved [613924/613924]
FINISHED --2022-11-18 07:01:11--
Total wall clock time: 0.5s
Downloaded: 1 files, 600K in 0.008s (70.4 MB/s)
WARNING: Missing checksum for '/home/.../build/downloads/my-firmware-file.bin', consider adding at least one to the recipe:
SRC_URI[sha256sum] = "83aa3c373228b48eea58964b4ffec7ad42226014351d18bed12cb9b5eb3d261e"
DEBUG: Python function base_do_fetch finished
DEBUG: Python function do_fetch finished
When I then run do_fetch again (even when changing the TAG variable, so SRC_URI changes), the log looks as follows:
DEBUG: Executing python function extend_recipe_sysroot
NOTE: Direct dependencies are []
NOTE: Installed into sysroot: []
NOTE: Skipping as already exists in sysroot: []
DEBUG: Python function extend_recipe_sysroot finished
DEBUG: Executing python function do_fetch
DEBUG: Executing python function base_do_fetch
WARNING: Missing checksum for '/home/.../build/downloads/my-firmware-file.bin', consider adding at least one to the recipe:
SRC_URI[sha256sum] = "83aa3c373228b48eea58964b4ffec7ad42226014351d18bed12cb9b5eb3d261e"
WARNING: Missing checksum for '/home/.../build/downloads/my-firmware-file.bin', consider adding at least one to the recipe:
SRC_URI[sha256sum] = "83aa3c373228b48eea58964b4ffec7ad42226014351d18bed12cb9b5eb3d261e"
DEBUG: Python function base_do_fetch finished
DEBUG: Python function do_fetch finished
Notice the duplicated missing checksum warning in the second log. I also tried to delete only the ./downloads/my-firmware-file.bin.done file, but it still is not redownloaded, the log is the same as the second one.
try to add -r flag to force wget to re-download even if the file exists:
FETCHCMD_wget = "/usr/bin/env wget -r --header "PRIVATE-TOKEN: ${PRIVATE_TOKEN}""
I have tried a lot of things, and by now I feel like it is a bug in bitbake. For the moment I implemented this workaround, that seems to work fine. It deletes the downloaded file as well as the .done file before the execution of do_fetch.
# Deletes the old, cached version of the firmware file
do_fetch_prepend(){
import os
fw_file = f"{d.getVar('DL_DIR')}/{d.getVar('INSTALL_NAME')}"
done_file = f"{fw_file}.done"
if os.path.isfile(fw_file):
os.remove(fw_file)
if os.path.isfile(done_file):
os.remove(done_file)
}
I hope to soon be able to correctly version my recipe, so I don't have to rely on such hacks.

Can't connect dbt to Databricks

I am trying to connect to a Spark cluster on Databricks and I am following this tutorial: https://docs.databricks.com/dev-tools/dbt.html. And I have the dbt-databricks connector installed (https://github.com/databricks/dbt-databricks). However, no matter how I configure it, I keep getting "Database error, failed to connect" when I run dbt test / dbt debug.
This is my profiles.yaml:
databricks_cluster:
outputs:
dev:
connect_retries: 5
connect_timeout: 60
host: <my_server_hostname>
http_path: <my_http_path>
schema: default
token: <my_token>
type: databricks
target: dev
This is my dbt_project.yml:
# Name your project! Project names should contain only lowercase characters
# and underscores. A good package name should reflect your organization's
# name or the intended use of these models
name: 'dbt_dem'
version: '1.0.0'
config-version: 2
# This setting configures which "profile" dbt uses for this project.
profile: 'databricks_cluster'
# These configurations specify where dbt should look for different types of files.
# The `model-paths` config, for example, states that models in this project can be
# found in the "models/" directory. You probably won't need to change these!
model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]
target-path: "target" # directory which will store compiled SQL files
clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_packages"
# Configuring models
# Full documentation: https://docs.getdbt.com/docs/configuring-models
# In this example config, we tell dbt to build all models in the example/ directory
# as tables. These settings can be overridden in the individual model files
# using the `{{ config(...) }}` macro.
models:
dbt_dem:
# Config indicated by + and applies to all files under models/example/
example:
+materialized: view
I have also tried using the spark connector, but I still get the same error using that. Any ideas as to why I can't connect to the Databricks cluster?
These are the logs corresponding to the error:
============================== 2022-02-18 08:43:22.123066 | 4b91f9d3-28ad-4f5a-93db-f431b6d9af14 ==============================
08:43:22.123066 [info ] [MainThread]: Running with dbt=1.0.1
08:43:22.123841 [debug] [MainThread]: running dbt with arguments Namespace(cls=<class 'dbt.task.debug.DebugTask'>, config_dir=False, debug=None, defer=None, event_buffer_size=None, fail_fast=None, log_cache_events=False, log_format=None, partial_parse=None, printer_width=None, profile=None, profiles_dir='/Users/keremaslan/.dbt', project_dir=None, record_timing_info=None, rpc_method=None, send_anonymous_usage_stats=None, single_threaded=False, state=None, static_parser=None, target=None, use_colors=None, use_experimental_parser=None, vars='{}', version_check=None, warn_error=None, which='debug', write_json=None)
08:43:22.124057 [debug] [MainThread]: Tracking: tracking
08:43:22.143750 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb751ef42e0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb751ef4eb0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb751eca730>]}
08:43:22.236001 [debug] [MainThread]: Executing "git --help"
08:43:22.264682 [debug] [MainThread]: STDOUT: "b"usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]\n [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n <command> [<args>]\n\nThese are common Git commands used in various situations:\n\nstart a working area (see also: git help tutorial)\n clone Clone a repository into a new directory\n init Create an empty Git repository or reinitialize an existing one\n\nwork on the current change (see also: git help everyday)\n add Add file contents to the index\n mv Move or rename a file, a directory, or a symlink\n restore Restore working tree files\n rm Remove files from the working tree and from the index\n sparse-checkout Initialize and modify the sparse-checkout\n\nexamine the history and state (see also: git help revisions)\n bisect Use binary search to find the commit that introduced a bug\n diff Show changes between commits, commit and working tree, etc\n grep Print lines matching a pattern\n log Show commit logs\n show Show various types of objects\n status Show the working tree status\n\ngrow, mark and tweak your common history\n branch List, create, or delete branches\n commit Record changes to the repository\n merge Join two or more development histories together\n rebase Reapply commits on top of another base tip\n reset Reset current HEAD to the specified state\n switch Switch branches\n tag Create, list, delete or verify a tag object signed with GPG\n\ncollaborate (see also: git help workflows)\n fetch Download objects and refs from another repository\n pull Fetch from and integrate with another repository or a local branch\n push Update remote refs along with associated objects\n\n'git help -a' and 'git help -g' list available subcommands and some\nconcept guides. See 'git help <command>' or 'git help <concept>'\nto read about a specific subcommand or concept.\nSee 'git help git' for an overview of the system.\n""
08:43:22.265387 [debug] [MainThread]: STDERR: "b''"
08:43:22.272505 [debug] [MainThread]: Acquiring new databricks connection "debug"
08:43:22.273434 [debug] [MainThread]: Using databricks connection "debug"
08:43:22.273833 [debug] [MainThread]: On debug: select 1 as id
08:43:22.274044 [debug] [MainThread]: Opening a new connection, currently in state init
08:43:22.888586 [debug] [MainThread]: Databricks adapter: Error while running:
select 1 as id
08:43:22.889031 [debug] [MainThread]: Databricks adapter: Database Error
failed to connect
08:43:22.889905 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb751f7eaf0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb752113040>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb7521130a0>]}
08:43:24.130154 [debug] [MainThread]: Connection 'debug' was properly closed.
Check your profiles.yml (usually found here: ~/.dbt/profiles.yml) and make sure there is:
No https:// in the host name and
A leading slash in the http_path
For example:
host: server.name.com # instead of https://server.name.com
http_path: /sql/protocolv1/o/0/0000-000000-text000 # note the leading slash
These are easy mistakes to make if, like me, you copied the http_path straight out of the cluster config page and the host straight out of your browser URL.
Another example of profiles.yml from the dbt-databricks ReadMe: https://github.com/databricks/dbt-databricks
I had not specified this in the original question, but I had used conda to set up a virtual environment. Somehow that doesn't work, so I'd recommend following the tutorial to the letter and use pipenv.

keytar.node causing issues in Buildkite pipeline

I'm trying to create a CI/CD pipeline using buildkite where the build steps runs on a Virtual Machine (Ubuntu). However, an npm package called keytar which is a dependency of tedious library is causing issues in the pipeline.
When running one of the steps from using the buildkite-agent, it tries to clean up an existing repository. And during the command git clean -fxdq it fails to remove keytar.node file due to a Permission denied Error.
Here's a full log of the step:
> Running global environment hook
> Setting up plugins
> Preparing working directory
$ cd /var/lib/buildkite-agent/builds/build-server-1/someorg/some-repo
# Host "bitbucket.org" already in list of known hosts at "/var/lib/buildkite-agent/.ssh/known_hosts"
$ git remote set-url origin git#bitbucket.org:someorg/some-repo.git
$ git clean -fxdq
warning: failed to remove node_modules/keytar/build/Release/keytar.node: Permission denied
# Removing /var/lib/buildkite-agent/builds/build-server-1/someorg/some-repo
⚠️ Warning: Checkout failed! Error running `/usr/bin/git clean -fxdq`: exit status 1 (Attempt 1/3 Retrying in 2s)
# Host "bitbucket.org" already in list of known hosts at "/var/lib/buildkite-agent/.ssh/known_hosts"
$ git clone -v -- git#bitbucket.org:someorg/some-repo.git .
fatal: destination path '.' already exists and is not an empty directory.
# Removing /var/lib/buildkite-agent/builds/build-server-1/someorg/some-repo
⚠️ Warning: Checkout failed! Error running `/usr/bin/git clone -v -- git#bitbucket.org:someorg/some-repo.git .`: exit status 128 (Attempt 2/3 Retrying in 2s)
# Host "bitbucket.org" already in list of known hosts at "/var/lib/buildkite-agent/.ssh/known_hosts"
$ git clone -v -- git#bitbucket.org:someorg/some-repo.git .
fatal: destination path '.' already exists and is not an empty directory.
# Removing /var/lib/buildkite-agent/builds/build-server-1/someorg/some-repo
⚠️ Warning: Checkout failed! Error running `/usr/bin/git clone -v -- git#bitbucket.org:someorg/some-repo.git .`: exit status 128 (Attempt 3/3 Retrying in 2s)
# Skipping artifact upload, no checkout
🚨 Error: Error running `/usr/bin/git clone -v -- git#bitbucket.org:someorg/some-repo.git .`: exit status 128
Upon examining the permissions on the folder /some-repo using the ls -l command the permissions seem to be drwxr-xr-x and the owner is buildkite-agent. I'm stumped as how this file does not get deleted while all other files get deleted without any issue.

Cannot git pull due CONFLICT(MODIFY/DELETE) and symlink

Our Laravel project is using symlinks. Recently when I tried to pull from my colleague's work, I get this message:
CONFLICT (modify/delete): resources/lang/en/validation.php deleted in HEAD and modified in a262067feb430a072c1d3abf2ec500150212ff0f. Version a262067feb430a072c1d3abf2ec500150212ff0f of resources/lang/en/validation.php left in tree.
error: failed to symlink 'resources/lang/en/validation.php': File name too long
Upon trying to git rm the file, I am told it doesn't exist and is deleted in HEAD. Then when I pull I get the same message as above. Upon trying to touch the file and git add the file, and commit and then pull (in order to push my changes to the same branch), I get a similar error message:
CONFLICT (content): Merge conflict in resources/lang/en/validation.php
CONFLICT (modify/delete): resources/lang/en/auth.php deleted in HEAD and modified in a262067feb430a072c1d3abf2ec500150212ff0f. Version a262067feb430a072c1d3abf2ec500150212ff0f of resources/lang/en/auth.php left in tree.
error: failed to symlink 'resources/lang/en/auth.php': File name too long
I have tried to skip-worktree the file, assume-unchanged the file and to change the git config setting via git config --local core.longpaths true to allow long-paths. None have worked. I think it has to do with the symlink, but I haven't run the script yet and so I don't know how this is a barrier to pulling for git.
When I do try to run the symlink, I get this error message:
error: unable to create symlink resources/lang/en/auth.php: File name too long
error: unable to create symlink resources/lang/en/validation.php: File name too long
Long story short, I cannot git pull, and therefore cannot git push. What's the solution? I don't want to git push force it.
Running git pull is just running two Git commands:
First, git pull runs git fetch. This obtains any new commits needed for the second command.
Second, git pull runs ... well, this can be complicated. You are having it run the default, though: git merge.
Usually when git pull fails, one of these two commands that it runs is the one that actually failed. The second command fails more often unless you have a particularly flaky Internet connection. In your case, it's the git merge that failed.
The word failed is usually too strong, really. Most merges do not actually fail. They just stop in the middle of the operation due to a conflict (or two conflicts, in your particular case). But your merge is a little special. It really does have an internal failure, which repeats several times:
error: unable to create symlink resources/lang/en/auth.php: File name too long
error: unable to create symlink resources/lang/en/validation.php: File name too long
This is happening because your OS is placing a hard limit on the length of the target of a symbolic link. As you found:
It seems it was trying to make a symlink out of the content inside the file instead of the file name ...
Git's internal limits are much bigger than your OS's.
A symbolic link is just data, at one level, and that's how Git tends to store it (as a blob object, but one with mode 120000 rather than the normal file mode of 100644 or 100755). At another level, the data will be interpreted as a file name, and that file name tends to have a length limit, such as 1024 or 4096 bytes.
What would git show do?
git show will spill out the contents of the symlink, when pointed to a symbolic-link object.
$ git hash-object -w -t blob /usr/share/misc/termcap
d305cd8e161ecc8a78b0485d1926b9600efc6cb7
$ git update-index --add --cacheinfo 120000,d305cd8e161ecc8a78b0485d1926b9600efc6cb7,crazy
$ git commit -m "add crazy-long symlink"
[master dbb6e35] add crazy-long symlink
1 file changed, 4725 insertions(+)
create mode 120000 crazy
The normal tools will no longer work with this repository (which I made just to hold this crazy-long symlink):
$ git log | sed 's/#/ /'
commit dbb6e35967041fa4b03812866999ea0acd640dce
Author: Chris Torek <chris.torek gmail.com>
Date: Sun Nov 15 19:52:05 2020 -0800
add crazy-long symlink
commit c6e238c122dcd41410e7fdcfaa47ac112e935a35
Author: Chris Torek <chris.torek gmail.com>
Date: Sun Nov 15 19:51:58 2020 -0800
initial commit
$ git checkout HEAD^
This works fine, but trying to check out the second commit fails:
$ git checkout master
error: unable to create symlink crazy: File name too long
D crazy
Previous HEAD position was c6e238c initial commit
Switched to branch 'master'
What happens at this point is that Git simply leaves the symbolic link out of the working tree entirely. That's why it is in state D. You can still do work with the repository, but you cannot use the regular tools in the regular way.
With your merge, what you can do is delete the bad symbolic links entirely (safely), create correct (good) ones, and add them.

How to store downloads folder on our private repo in yocto

After a successful "bitbake core-image-sato" build, i moved the downloads folder to my private repository, and then deleted downloads the folder and fetched it from my private repository.
I added BB_NO_NETWORK = "1" in local.conf, and when I tried to do "bitbake core-image-sato" it fails.
NOTE: Executing RunQueue Tasks
ERROR: gnu-config-native-20150728+gitAUTOINC+b576fa87c1-r0 do_fetch: Network access disabled through BB_NO_NETWORK (or set indirectly due to use of BB_FETCH_PREMIRRORONLY) but access requested with command LANG=C git -c core.fsyncobjectfiles=0 fetch -f --prune --progress git://git.savannah.gnu.org/config.git refs/*:refs/* (for url git://git.savannah.gnu.org/config.git)
ERROR: gnu-config-native-20150728+gitAUTOINC+b576fa87c1-r0 do_fetch: Function failed: base_do_fetch
ERROR: Logfile of failure stored in: /home/jamal/test/new_repot/build/tmp/work/x86_64-linux/gnu-config-native/20150728+gitAUTOINC+b576fa87c1-r0/temp/log.do_fetch.29816
ERROR: Task (virtual:native:/home/jamal/test/new_repot/sources/poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb:do_fetch) failed with exit code '1'
It is trying to fetch the source code again, from network, as network access is disabled it fails.
Can you guys please help me in resolving this problem. Thanks for your time and patience.
The problem is missing BB_GENERATE_MIRROR_TARBALLS = "1" in local.conf. Tarballs from git repositories are automatically not created due to performance reasons, see the manual. Setting that variable enables creating of the tarballs, so they can be used later on and git server don't need to be contacted.
(Please see comments for the question for more information, we discussed the solution there. Thanks to #md.jamal for testing it.)

Resources