惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Proofpoint News Feed
L
Lohrmann on Cybersecurity
S
Secure Thoughts
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
Stack Overflow Blog
Stack Overflow Blog
W
WeLiveSecurity
O
OpenAI News
SecWiki News
SecWiki News
博客园 - Franky
NISL@THU
NISL@THU
Microsoft Azure Blog
Microsoft Azure Blog
T
Tor Project blog
Microsoft Security Blog
Microsoft Security Blog
aimingoo的专栏
aimingoo的专栏
Security Latest
Security Latest
H
Hacker News: Front Page
Google Online Security Blog
Google Online Security Blog
P
Privacy & Cybersecurity Law Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Darknet – Hacking Tools, Hacker News & Cyber Security
月光博客
月光博客
李成银的技术随笔
Spread Privacy
Spread Privacy
F
Full Disclosure
F
Fortinet All Blogs
T
The Exploit Database - CXSecurity.com
Vercel News
Vercel News
AWS News Blog
AWS News Blog
WordPress大学
WordPress大学
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
V
Visual Studio Blog
J
Java Code Geeks
博客园 - 三生石上(FineUI控件)
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
博客园 - 司徒正美
Engineering at Meta
Engineering at Meta
Last Week in AI
Last Week in AI
P
Palo Alto Networks Blog
宝玉的分享
宝玉的分享
T
True Tiger Recordings
N
News and Events Feed by Topic
酷 壳 – CoolShell
酷 壳 – CoolShell
Cisco Talos Blog
Cisco Talos Blog
N
News | PayPal Newsroom
S
SegmentFault 最新的问题
Jina AI
Jina AI

DEV Community

A Simple React Hook for localStorage State, Expiry, and Sync I sold you on /scratchpad. Then I migrated to /note. Fixing WSL Errors on Windows 11 Your app is not Netflix. Stop building like it is. I built an email cleaner. CSV parsing took longer than the actual validators. How I Would Learn Full-Stack Development in 2026 If I Started From Zero Partition Evolution: Change Your Partitioning Without Rewriting Data What Google Play's I/O 2026 Updates Look Like From a Solo Indie Puzzle Developer Forgetting the Myth of "Ease of Integration" When Selling Digital Products with Bitcoin My 4-Step Regex Debugging Workflow (That Actually Saves Time) Stop Scraping Betting Sites: How to Build a Real-Time Sports Tracker in Python Civic Identity and Responsibility in Modern Democracy OLTP vs OLAP Are binaries really executable code ? The lie of the 80%: why software progress charts don't work What a Datacenter in Space Actually Buys You: Three Server Racks Is AI Actually Citing Your Site? How to Measure What Google Rankings Can't Accessibility - This looks like a job for a developer advocate! I built a Mac app that turns web pages into live widgets How to Teach Source Evaluation When Your Students Use ChatGPT More Context Does Not Mean More Trust RAG Series (24): Code RAG — Teaching AI to Understand Your Codebase Past the JVM Design decisions behind my “Irregular German Verbs” iOS app WordPress 7.0 "Armstrong" Is Live — Post-Release Deep Dive 🎺 Performance and Apache Iceberg's Metadata I Shipped a Bug to Production That Cost Us 3 Hours of Downtime 程序人生:在代码与时间之间 The Wrong Way to Think About XRPL Event Infrastructure What I Learned About MND, Voice Banking, and Why Assistive Tech Is Personal $1.50/Month Email Infrastructure That Beats Your $20 SendGrid Plan Cloud Unit Economics: The Metrics DevOps and FinOps Teams Actually Need Bypassing Payment Platform Restrictions Was The Best Decision I Ever Made For My Digital Product Business The Hidden Life of a Container: A Complete Lifecycle When a port is already in use, there is no interactive way to find it — so I built `port-peek` Como Sumir com o Barulho do Teclado Mecânico no Ubuntu Usando o NoiseTorch Google I/O 2026 dropped a bomb on Android tooling, and nobody's talking about it (or maybe they are 😅) Mentoring Junior Developers: What Actually Works How I Prevented Claude Code from Breaking My Architecture with 18 Tests That Run in 0.4 Seconds I Controlled an ESP32 Drone Using Only My Voice vite HMR is silently the reason ur laptop fan wont stop AI Agents Security for Developers: Don't Let Your Agents Become a Liability Single List Keyboard Handling 9 SaaS development companies worth knowing (a technical look) Material Nova — The Best VS Code Theme of 2026 Inference Routing Is Becoming an Infrastructure Placement Problem I just build a League MBTI Analytics Why I Built My Own Site with Astro, Not WordPress when I use WordPress for a Living Hello! I'm a balloon artist who started 3D modeling 7 Next.js 16 Caching Bugs That Compile Fine and Break Silently in Production I got tired of writing READMEs so I built a tool that generates them from your GitHub URL FrontGate: a Lightweight Package Proxy for Supply Chain Security Why Your Expense Tracking Architecture Keeps Breaking Stop your AI trading agent from hallucinating technical analysis Breaking the Monorepo Barrier in a Crypto Store for Digital Products Imposter Syndrome Is Something We All Struggle With at Some Point in Our Careers Moving Beyond the Black Box: How I Built a Real-Time Voice Fitness Coach using Next.js 15, Convex, & Vapi.ai How to Recover Kafka DLQ Messages After a Schema Change Broke Your Consumer From Spec-Driven Development to Attractor-Guided Engineering Githubster free tool to track your GitHub followers and unfollowers Why Bitcoin Core RPC is Too Slow for High-Frequency Trading (And How to Fix It) Why Reading Food Labels Shouldn't Feel Like Decoding a Chemistry Exam I built a "brain" for AI coding agents — it never forgets and never stops How to Build a Local LLM Agent to Automate Work List Generation from Monthly Reports (With Jira Integration) Controlling Employee AI Usage on Managed Devices: Browser Controls, Cloudflare AI Gateway, and AWS Bedrock When Global Payment Gateways Fail, Local Solutions Shine LeetCode Solution: 13. Roman to Integer End-to-End Observability for vLLM and TGI: from DCGM to Tokens LeetCode Solution: 12. Integer to Roman 🚀 A Beginner’s First Look at Project IDX: Secure Coding from Day One Team Topologies for DevOps: A Practical Implementation Guide Seven Contradictions Shaped an Architecture. Telemedicine in Venezuela: A Technical Guide for Clinics in 2026 SSO, SAML, OIDC, and SCIM: What Actually Happens When You Click "Sign in with Google" Mastering Next.js 16 Server Actions & Forms: The Future of Full-Stack React | Muhammad Arslan Enterprise Laravel API Development: Best Practices for Performance, Security, and Scale | Muhammad Arslan How I Turned an Image Into a 3D Model in Minutes With AI Why Pure Rust WASM Is Harder Than It Looks Platform Stores Are a Dead End for Crypto Payments The VLA Testing Pipeline in Mano-AFK: When AI Agents QA Their Own Work LeetCode Solution: 10. Regular Expression Matching IPv4 Geolocation and Leasing: A Practical Guide for Network Operators Reconciling the Inefficiencies of Global Crypto Payments Platforms I Exported HT-Demucs FT to ONNX in 2026 (4 Blockers Everyone Else Gave Up On) 🤖 The Hacker in the Machine: Using AI Agents to Build Interactive Security Games Savings Plan Amortized Cost in AWS Cost Explorer: What It Is and How to Use It How to Tailor Your Resume to a Job Description in 5 Minutes (A Method That Actually Works) Flutter vs React Native in 2026: I Built the Same App in Both JWT vs Session Tokens in Spring Boot: A Senior Dev's Decision Guide How to Choose an AI Gateway in 2026 How to Teach Source Evaluation When Your Students Use ChatGPT Why Passwordless B2C Rollouts Stall at 5% (and How to Reach 60%) Rmux Review: Rust Terminal Multiplexer Built for AI Agents I realized I was only using half of what Claude Code has to offer DevOps & Deployment Essentials: Your Practical CI/CD Guide How next-generation captchas work and why it matters for automation Chat is Dead: How JSON Prompting Cut My AI Costs by 73% What if Everybody Were Suddenly... Better? OCI Web Application Firewall (WAF) Deep Dive: Architecture, Traffic Inspection, Threat Protection, and Enterprise Security Design Selling Digital Products in a Country PayPal Refuses to Touch
Resolving inter-service communication issue
RIK · 2026-05-21 · via DEV Community

This week was heck of a roller coaster of emotions, trying to solve an issue. All I faced is the same error again and again. Precisely, error code 307 and 422 that is Temporary Redirect Unprocessable Entity respectively.

Started with a simple notebook for gateway service just like I did for ingestion service at its starting phase. But here is a catch, this time i am dealing gateway service, meaning I need to use uvicorn command here. In case of ingestion service, when I started, all I did is assign a file path to a variable, pass it to PyPDFLoader, split the returned Document into chunks and store them into a storage, called as vector store.

I used uvicorn when I was ready with all the class definitions and folder structures, just to wrap the core script around fastapi and deal with api testing using postman. The functionality that I assigned for gateway is different. As the name suggests, it shall act as a mediator between the client and the backend. For that I need to connect gateway service to ingestion service.

I installed all the necessary libraries in a virtual environment, namely fastapi, uvicorn and httpx, activated the virtual environment. I had an impression that i need use schema validation for the incoming data, convert it to dictionary using .model_dump() and then pass it to httpx.AsyncClient().post(), since i am using post operation.

The post operation has been used because the file shall be uploaded using postman, shall help to store the embeddings in a database. That uploaded file shall be of type UploadFile imported from fastapi library. At the end i stated uvicorn.run() statement to activate my gateway service..

This is where the story begins...

I encountered my first issue in jupiter notebook running a uvicorn statement from where gateway service shall begin to run. I forgot that even jupiter notebook run on a server and since i am running it locally, of course it shall run on localhost.

What I discovered is that while stating on jupyter it is incorrect to use uvicorn statement as:

The reason the first method did helped because a jupyter notebook is not just a text document, it is an active web application. It requires its own constantly running event loop in the background to handle cell executions, process outputs, and communicate with your browser. When I called uvicorn.run(), uvicorn attempts to start a brand new event loop to listen for incoming web requests. Python's standard asyncio library strictly forbids starting a new event loop while one is already running in the same thread. It throws the RuntimeError to prevent the two managers from fighting over control.

By thread I mean a worker which executes a set of instructions available as a recipe.

instead the following code fragment needs to be used:

A simple screenshot captured from my github repo. The output was previously showcased after running that cell and then commented it out.

Another alternative can by stating the following in a notebook cell :

%%writefile main.py
from fastapi import FastAPI
app = FastAPI()

@app.get("/")
def read_root():
    return {"Hello": "World"}

Enter fullscreen mode Exit fullscreen mode

this shall automatically create a main.py file sibling to the notebook file and the following uvicorn command can be used:

!uvicorn main:app --port 8001 --reload

Enter fullscreen mode Exit fullscreen mode

However my issue has not finished yet. This was just the first part.
The second part is while uploading a pdf in postman, and clicking on Send button, I faced a series on errors one after another.

now even after making some amendments in jupyter notebook, i encountered the error which is shown previously in my codebase. I had to restart the session again and again, may be because of the fact that the previously compiled python script persisted even after making changes. So i shifted to simple .py file which was a better option.

After I was fed up of facing the same error for 2 days, I browsed in google "do i need schema validation using pydantic when a function param of type fastapi.UploadFile, wrapped around the given pydantic model and apply .model_dump() just to be passed in httpx.AsyncClient() ?"

The answer was, only when multiple parameters are passed in the function, in this the function name is forward_to_ingestion, but this time i have only 1 param.

Plus I was mixing things up unncessarily putting .model_dump() after wrapping Around IngestionSchema pydantic class not reallizing that I already put UploadFile at the function header to begin with. I removed the schema defintion then.

At that time i used .model_dump, hoping this would return a json data, but where is the key, i completely forgot that it is simply a variable incoming before which the content within the uploaded file needs to read. At least i did the right thing to use await and .read() for that.

The result is still the same..made me check what mistake did i commit in ingestion service, in an isolated fashion, no inter service communication in this case. Was running fine..

i passed the same snippet to AI, told me to use

tempfile.NamedTemporaryFile

Enter fullscreen mode Exit fullscreen mode

helps to keep memory leakage in check and for security reasons.

meanwhile i also faced 307 error code..specifying /ingest/

I removed the trailing slash in postman, after I crashed into another error

The terminal showed this

One thing i was sure there is something still missing in my gateway service. I passed this snippet:

it simply added follow_redirects=True because of the fact that

httpx does not follow HTTP redirects by default, which is crucial for forwarding files and post data.

I then encountered another problem this time it timeout error, not shown in postman but in terminal.

In postman the same internal server error is shown.

I then specified timeout argument as well.

And I did not believe, it really worked...after seeing this in postman

Yes it is my fault that i should have specified status code as 201 since 200 is the default status code under gateway service, which helps in debugging.

whereas the terminal where ingestion was active shown this as output

But this taught me one thing is to NEVER GIVE UP!!