When Developers have Issues: Dependency HELL

in #hive-1103693 months ago

Support Proposal 303 on PeakD
Vote for Brianoflondon's Witness KeyChain or HiveSigner

This is a value for value post: see the explanation in the footer.


This is more a little rant about Developing that I just wanted to get off my chest. If you're not a developer, you might enjoy this story. It's kinda like a who-done-it but I'm going to start by telling you the ending (I don't want to stress you).

Typo in December

On 24th December 2023 sometime before 22:07 while working on a Python package I built to support @v4vapp called v4vapp-binance I probably typed the following into my terminal:

poetry install install

I should have typed:

poetry install

And that had no measurable effect on my code at that time or for months.

It just sat there, lurking, like an unexploded bomb in my work.

Sometime in July

A few weeks ago one of the main parts of my system (the API which @v4vapp calls to do almost everything it does) stopped working: I was suddenly unable to "build" the Docker Containers which run my code.

This was insane. I changed something minor in my code, sent the new code to Github where an automatic process is supposed to build the Dockerfile and instead of succeeding it failed. And I get a screen looking like this:

Github Docker build fail

But WHY???

Exactly the same build process had worked a couple of weeks earlier and when I tried to rebuild exactly the same code which had worked before, failure.

I spent days plugging that code into every AI system I have access to, I tried changing everything, I thought it related to bits of Bitcoin Nostr code, nothing worked.

I was pulling my hair out. My code was running fine, the version which was on the servers was not going to break, but I couldn't make even the most minor of changes.

You can't beat having a friend

I actually took a break for a week or two. I just couldn't face sitting at my computer and it was the start of the kid's summer holidays here so I just hoped that I wouldn't need to make any urgent changes and left it alone for a bit.

When eventually something did happen which actually meant I really did need to make a change, I had to get back to it.

And I was still stuck.

In near desperation I sent a message to the friend who had helped with (basically taken over) the creation of the core software which runs @podping, @alecksgates. I didn't really expect him to solve my problem, but I just vented about Python package management using a tool called Poetry (which I learned from him).

I sent him a few dumps of error code hell (kinda like the way I had dumped that stuff on Grok or CoPilot) and that led to him saying this:

image.png

Somewhere in the middle of all this stuff I'd sent him he saw the word "install" more often than it should have been!

Over to Binance

That led me to seeing that the problem was in the project v4vapp-binance which I was using in this other project. It was here that I looked back in time using Git's "Blame" facility... like who do you BLAME for this cock up and eventually I found this fatal line added to my package dependencies. Dependencies are the parts of other people's projects which I use in my work and which I fetch when I build the project in a Docker container.

install = "^1.3.5"

GitKraken blame for v4vapp-binance.png

That line magically appeared in my pyproject.toml file on December 23rd.

Now that would have continued to work but at some point this Python Package changed its name. It's hard to believe that there ever was something called install as a package name but there must have been.

As soon as the package owner changed the name, my code started breaking and because that word is so ubiquitous, it was nearly impossible for me to see what was breaking.

The Fix was EASY

All I had to do was go into the v4vapp-binance project and type poetry remove install, rebuild that and upload it (changing the version number) and suddenly all the other code I had which was depending on it, worked again.

Hope you enjoyed that

It's a crazy ride doing dev work.

Ice Cold in Alex


Value for Value

For the last few months while building @v4vapp I was generously supported by the DHF. Going forward I have a much more modest support which covers direct server costs and a little of my time.

If you appreciate the work I do on and around Hive, you can express this directly: upvoting posts on Hive is great. Also consider a direct donation (there's a Tip button on Hive or a Lightning Address) on all my posts.

hivebuzz-orca-120.png

Support Proposal 303 on PeakD
Support Proposal 303 with Hivesigner
Support Proposal 303 on Ecency
Vote for Brianoflondon's Witness KeyChain or HiveSigner


Send Lightning to Me!

Sort:  

That was well spotted by! Imagine a year long headache from that 😩
!BBH !hiqvote

@brianoflondon! @caspermoeller89 likes your content! so I just sent 1 BBH to your account on behalf of @caspermoeller89. (2/20)

(html comment removed: )

It’s funny how the fix was easy but at first, you never knew the typo was what caused the error
Well done

Coding is very difficult so mistakes are bound to happen, mistakes that are hard to catch. Thank your friend for helping you

Amazing dedication to fix this.

You really dedicate a whole lot of time in making sure that things work

It's hard to believe that there ever was something called install as a package name...

What a bizarre/dangerous choice for a package name! 🤪

I can't even find what it has been renamed to. It must have been hanging around on PyPi forever.

I work with Python, but hadn't heard of poetry. Dependencies can be a pain. Giving a package the same name as a standard command seems crazy.

I work with some systems that are not online, so getting stuff installed is tricky. I will get the odd error that drives me mad, so I know the feeling.

Poetry is excellent but my friend just suggested I look at this which is new.

https://astral.sh/blog/uv

@caspermoeller89, the HiQ Smart Bot has recognized your request (1/3) and will start the voting trail.

In addition, @brianoflondon gets !PIZZA from @hiq.redaktion.

For further questions, check out https://hiq-hive.com or join our Discord. And don't forget to vote HiQs fucking Witness! 😻

Congratulations @brianoflondon! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You distributed more than 240000 upvotes.
Your next target is to reach 250000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

one unrelated but podping related question. LeoShorts is up, they were talking something about frontends and censorship resistance and i randomly remembered that all of those should be on podcasting 2.0 apps. to show them as threads (not posts but comments) they use a "container" accounts (leoshorts1, leoshorts2...) so searching on a podcasting app like podfriend or Curiocaster should show the account (i can find mine or some other accounts) but it shows as no results.
there is an RSS feed for it https://3speak.tv/rss/leoshorts1.xml
is there some data missing for them to be shown in the apps?

Congratulations @brianoflondon! You received a personal badge!

You raised your Hive Power every day of the month! Enjoy better curation reward and more to say in governance.
Participate in the next Power Up month to get another one!

You can view your badges on your board and compare yourself to others in the Ranking

Check out our last posts:

Be ready for the September edition of the Hive Power Up Month!
Hive Power Up Day - September 1st 2024

Congratulations @brianoflondon! You received a personal badge!

You powered-up at least 10 HIVE on Hive Power Up Day!
Wait until the end of Power Up Day to find out the size of your Power-Bee.
May the Hive Power be with you!

You can view your badges on your board and compare yourself to others in the Ranking

Check out our last posts:

Hive Power Up Month Challenge - August 2024 Winners List
Be ready for the September edition of the Hive Power Up Month!
Hive Power Up Day - September 1st 2024

Congratulations @brianoflondon! You received a personal badge!

You powered-up at least 1000 HP on Hive Power Up Day and got the biggest Power-Bee!
See you at the next Power Up day to see if you will repeat this feat.
May the Hive Power be with you!

You can view your badges on your board and compare yourself to others in the Ranking

Check out our last posts:

Hive Power Up Month Challenge - August 2024 Winners List
Be ready for the September edition of the Hive Power Up Month!
Hive Power Up Day - September 1st 2024