text:
AddressSanitizer: heap-use-after-free

Much appreciate for such a great crate. I use gc-arena to implement a Lox interpreter base on Crating Interpreter. Unfortunately, i encounter a heap-user-after-free error cause my interpreter segment fault. Here are the logs:
=================================================================
==95150==ERROR: AddressSanitizer: heap-use-after-free on address 0x607000000340 at pc 0x0001079cda87 bp 0x7ff7b84fe210 sp 0x7ff7b84fe208
READ of size 8 at 0x607000000340 thread T0
    #0 0x0001079cda86 in lox_lang::vm::State::call_value::h93af834073e1b15c vm.rs:638
    #1 0x0001079c4500 in lox_lang::vm::State::step::he25c8e197a62616f vm.rs:367
    #2 0x0001079c0caf in lox_lang::vm::Vm::interpret::h58790b4de490608c vm.rs:167
    #3 0x0001079f100e in lox_lang::main::h36c4ad25d78f838d main.rs:22
    #4 0x0001079f2d95 in std::sys::backtrace::__rust_begin_short_backtrace::hb8cef4ab667c029c backtrace.rs:154
    #5 0x0001079f2d84 in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hdfaa0b6eac6e25fd rt.rs:164
    #6 0x000107a155ce in std::rt::lang_start_internal::h1484baa49b5d1bd1+0x2fe (lox-lang:x86_64+0x1000585ce)
    #7 0x0001079f2d11 in std::rt::lang_start::h7fc73b8deb512b64 rt.rs:163
    #8 0x7ff812fb22cc in start+0x70c (dyld:x86_64+0xfffffffffff4f2cc)

0x607000000340 is located 16 bytes inside of 80-byte region [0x607000000330,0x607000000380)
freed by thread T0 here:
    #0 0x000107f78cfb in free+0x8b (librustc-nightly_rt.asan.dylib:x86_64h+0xdecfb)
    #1 0x0001079d0b92 in gc_arena::context::Context::do_collection_inner::h0042340fd5996eb1 context.rs:351
    #2 0x0001079c1140 in lox_lang::vm::Vm::interpret::h58790b4de490608c vm.rs:175
    #3 0x0001079f100e in lox_lang::main::h36c4ad25d78f838d main.rs:22
    #4 0x0001079f2d95 in std::sys::backtrace::__rust_begin_short_backtrace::hb8cef4ab667c029c backtrace.rs:154
    #5 0x0001079f2d84 in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hdfaa0b6eac6e25fd rt.rs:164
    #6 0x000107a155ce in std::rt::lang_start_internal::h1484baa49b5d1bd1+0x2fe (lox-lang:x86_64+0x1000585ce)
    #7 0x0001079f2d11 in std::rt::lang_start::h7fc73b8deb512b64 rt.rs:163
    #8 0x7ff812fb22cc in start+0x70c (dyld:x86_64+0xfffffffffff4f2cc)

previously allocated by thread T0 here:
    #0 0x000107f78c02 in malloc+0x82 (librustc-nightly_rt.asan.dylib:x86_64h+0xdec02)
    #1 0x0001079d1cb7 in gc_arena::context::Context::allocate::h4ca4ac541b8b9fc8 context.rs:414
    #2 0x0001079c5def in lox_lang::vm::State::step::he25c8e197a62616f vm.rs:424
    #3 0x0001079c0caf in lox_lang::vm::Vm::interpret::h58790b4de490608c vm.rs:167
    #4 0x0001079f100e in lox_lang::main::h36c4ad25d78f838d main.rs:22
    #5 0x0001079f2d95 in std::sys::backtrace::__rust_begin_short_backtrace::hb8cef4ab667c029c backtrace.rs:154
    #6 0x0001079f2d84 in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hdfaa0b6eac6e25fd rt.rs:164
    #7 0x000107a155ce in std::rt::lang_start_internal::h1484baa49b5d1bd1+0x2fe (lox-lang:x86_64+0x1000585ce)
    #8 0x0001079f2d11 in std::rt::lang_start::h7fc73b8deb512b64 rt.rs:163
    #9 0x7ff812fb22cc in start+0x70c (dyld:x86_64+0xfffffffffff4f2cc)

SUMMARY: AddressSanitizer: heap-use-after-free vm.rs:638 in lox_lang::vm::State::call_value::h93af834073e1b15c
Shadow bytes around the buggy address:
  0x607000000080: fa fa fd fd fd fd fd fd fd fd fd fd fa fa fa fa
  0x607000000100: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fd fd
  0x607000000180: fd fd fd fd fd fd fd fd fa fa fa fa fd fd fd fd
  0x607000000200: fd fd fd fd fd fa fa fa fa fa 00 00 00 00 00 00
  0x607000000280: 00 00 00 fa fa fa fa fa 00 00 00 00 00 00 00 00
=>0x607000000300: 00 00 fa fa fa fa fd fd[fd]fd fd fd fd fd fd fd
  0x607000000380: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fa fa
  0x607000000400: fa fa fd fd fd fd fd fd fd fd fd fd fa fa fa fa
  0x607000000480: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fd fd
  0x607000000500: fd fd fd fd fd fd fd fd fa fa fa fa fd fd fd fd
  0x607000000580: fd fd fd fd fd fd fa fa fa fa fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==95150==ABORTING
[1]    95150 abort      RUSTFLAGS="-Z sanitizer=address" cargo run --release --target  -- test.lox

My environments:

gc-arena: 0.5.3
macOS Sequoia 15.01
2.6 GHz 6-Core Intel Core i7

Are you able to share your repository, or a self-contained project that reproduces the ASAN report?

Sure, here is my repo: https://github.com/Folyd/lox
You can run this command to try the segfault: RUSTFLAGS="-Z sanitizer=address" cargo run --release --target x86_64-apple-darwin -- test.lox

I guess is my unsafe implement of Collect trait. 😢 I forgot to trace the globals.
#[derive(Clone)]
pub struct State<'gc> {
    pub mc: &'gc Mutation<'gc>,
    pub frames: Vec<CallFrame<'gc>>,
    pub frame_count: usize,
    pub stack: [Value<'gc>; STACK_MAX_SIZE],
    pub stack_top: usize,
    pub globals: HashMap<Gc<'gc, String>, Value<'gc>>,
    pub open_upvalues: Option<GcRefLock<'gc, UpvalueObj<'gc>>>,
}

unsafe impl<'gc> Collect for State<'gc> {
    fn needs_trace() -> bool
    where
        Self: Sized,
    {
        true
    }

    fn trace(&self, cc: &Collection) {
        self.frames.trace(cc);
        self.frame_count.trace(cc);
        self.stack.trace(cc);
        self.stack_top.trace(cc);
        // self.globals.trace(cc);
        self.open_upvalues.trace(cc);
    }
}

Maybe not, even though I uncomment self.globals.trace(cc);, it still trigger segfault. 🤔

I'm not at my desktop at the moment, but it looks like you're not tracing several Gc-containing variants of Value:
https://github.com/Folyd/lox/blob/89a4d903afe94ef82aa6c8601cf2369c79d5c046/src/value.rs#L34-L40
For example, Value::Class also needs to be traced.

My bad, it is easy to forgot trace to those memory correctly in a manual way.

repo: kyren/gc-arena


text:
🛑 Korone is down

In 950854e, Korone (korone.kyun.host) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Korone is back up in b7542b3.

source: gharchive/issue

repo: kyundothost/status

license: MIT

license_type: permissive

license_source: github-api


text:
[Feature] Move GH action into a separate repo

Problem Statement
Move GH action into a separate repo
Solution Description
Move GH action into a separate repo
Alternatives
No response
Additional Context
No response
Slack discussion
No response
Research

[X] I have searched other issues in this repository and mine is not recorded.

Moved to https://github.com/kyverno/action-install-kyverno-json

repo: kyverno/kyverno-json


text:
Update gce note

Signed-off-by: chipzoller chipzoller@gmail.com
Related issue

Proposed Changes
Updates a note on GlobalContextEntry.
Cherry pick to release-1-12-0 is required.
Checklist

[x] I have read the contributing guidelines.
[x] I have inspected the website preview for accuracy.
[x] I have signed off my issue.

/cherry-pick release-1-12-0

source: gharchive/pull-request

repo: kyverno/website


text:
Fix json_ld string format

Issue: keys auto converts to symbols in ruby '3.3.3' and rails 7.2.0

Fix:
Ensure that all keys remain strings when generating the structured data by explicitly using the hash rocket => for all key-value pairs.

@mario-amazing
Thanks for the pullreq :smile:
Wouldn't it be enough to just fix the README?

@kzkn, IMHO this method should return strings as keys, as described in this spec(currently it returns symbols) https://github.com/kzkn/gretel/blob/050c99ff519b6686aaf51d28acc6e1d8e96a5836/spec/lib/gretel/view_helpers_spec.rb#L533
But yes, fix could be just in readme))
At your discretion😉

this method should return strings as keys, as described in this spec(currently it returns symbols)

No, this spec expects symbols to be used for keys. In fact, the spec has been successful.
irb> {'@context': 'https://schema.org'}
=> {:@context=>"https://schema.org"}

I'll close this pullreq, but I'll only cherry-pick the README modification.
thanks!

authors: kzkn mario-amazing

repo: kzkn/gretel


text:
Bot disconnects itself after a while

Hey there, it's been a while.
I'm having issues with the bot disconnecting itself for no reason after some time of inactivity.
I'm currently running it inside a tmux session on a dedicated server on Debian 8 but the same issue occurs with Docker.
These are the only logs I've got for the bot, and as you can see it's supposed to have been running for 12 days.
▶ dart bin/main.dart
[FINE]  {CommandsFramework} - 3.10.2018 15:12:45:734 -- Command [mp] has been registered
[FINE]  {CommandsFramework} - 3.10.2018 15:12:45:745 -- Command [game] has been registered
[FINE]  {CommandsFramework} - 3.10.2018 15:12:45:746 -- Command [player] has been registered
[FINE]  {CommandsFramework} - 3.10.2018 15:12:45:747 -- Command [update] has been registered
[FINE]  {CommandsFramework} - 3.10.2018 15:12:45:748 -- Command [doodle] has been registered
[INFO]  {Client} - 3.10.2018 15:12:47:125 -- Connected and ready!
Ready!

However it's unresponsive to commands and is logged off

Do you have any idea or suggestion?

Bot cannot disconnect itself or something like that. Maybe your server suspends process. I have bot running correctly for 24h and another for 18h. Can you setup some message logging, or/and periodic timer to print check if program is running.
For ex:
Timer.periodic(const Duration(minute: 1), (t) => print(bot.guilds.count));

I'm going to add some periodic logging and will get back to you, thanks.

I don't understand, I've had the process opened in a terminal the whole time, it kept printing to the console but the bot still went offline.
▶ dart bin/main.dart
[FINE]  {CommandsFramework} - 15.10.2018 10:29:38:234 -- Command [mp] has been registered
[FINE]  {CommandsFramework} - 15.10.2018 10:29:38:245 -- Command [game] has been registered
[FINE]  {CommandsFramework} - 15.10.2018 10:29:38:247 -- Command [player] has been registered
[FINE]  {CommandsFramework} - 15.10.2018 10:29:38:248 -- Command [update] has been registered
[FINE]  {CommandsFramework} - 15.10.2018 10:29:38:249 -- Command [doodle] has been registered
[INFO]  {Client} - 15.10.2018 10:29:39:781 -- Connected and ready!
Ready!
2018-10-15 10:44:38.310004 still alive?
2018-10-15 10:59:38.309588 still alive?
2018-10-15 11:14:38.309594 still alive?
2018-10-15 11:29:38.309588 still alive?
2018-10-15 11:44:38.309584 still alive?
2018-10-15 11:59:38.309579 still alive?
2018-10-15 12:14:38.309577 still alive?
2018-10-15 12:29:38.309579 still alive?
2018-10-15 12:44:38.309567 still alive?
2018-10-15 12:59:38.309564 still alive?
2018-10-15 13:14:38.309554 still alive?
2018-10-15 13:29:38.309544 still alive?
2018-10-15 13:44:38.309576 still alive?
2018-10-15 13:59:38.309557 still alive?
2018-10-15 14:14:38.309555 still alive?
2018-10-15 14:29:38.309570 still alive?

I found just now problems with sessions invalidating right after READY event.
Can you create listener to onDisconnect event? With close code and shard number.

I will do that later today yes ;-)

Are you setting presence for your bot? Gateway disconnects me due invalid opcode when sending STATUS_UPDATE.

Nope, I'm not setting the bot's presence. I'll have a look on how to set it.

Pushed possibly fix for this problem. Please test against latest commit.

I've update my code for the newest Nyxx version and it seems to be working on my local machine. I'll run it tonight on my server and will let you know ;-)

The bot is still connected and responsive to commands (12h uptime) so I'd say it looks promising!
I don't know if it's relevant to you but I've had the following log several times:
UNKNOWN OPCODE: {"t":"GUILD_INTEGRATIONS_UPDATE","s":2577,"op":0,"d":{"guild_id":"450704289141358607"}}

That's okay - ignore it. I'm just logging these to notice about them.


text:
整合Spring Cloud，以及服务侧基础框架的抽取

微服务是未来的趋势，后续会整合Spring Cloud。
另外当前为偏管理侧的系统，针对服务侧的需求，可能需要一些调整，可抽出独立的分支

网关（Gateway）：代理、认证、鉴权。内部服务与权限相关解耦。
System、Tools 分模块部署。

是基于Eureka（服务注册与发现）、OpenFeign（服务调用、客户端负载均衡）、Hystrix（熔断限流）、Zuul（网关）、Config（配置中心）整一套
^使用Nacos（服务注册与发现、配置中心）、Sentinel（服务熔断与限流）、Gateway（网关）、OpenFeign（服务调用、客户端负载均衡）

是基于Eureka（服务注册与发现）、OpenFeign（服务调用、客户端负载均衡）、Hystrix（熔断限流）、Zuul（网关）、Config（配置中心）整一套
^使用Nacos（服务注册与发现、配置中心）、Sentinel（服务熔断与限流）、Gateway（网关）、OpenFeign（服务调用、客户端负载均衡）

repo: lWoHvYe/eladmin


text:
Allow models to request additional input data from the engine

Many ase claculators use additional information of the ase.Atoms object, such as total charge, magnetic moment and other arbitrary properties from the .info and .arrays dict. There should be a standardized way to define, what additional properties get read from the ase.Atoms object in the atomistic.ase_calculator.MetatensorCalculator, and then converted into a TensorBlock which gets passed wih the systems object.
For simplicity, I would propose that there should be two generic options that either access the properties from the .info and .arrays dict, plus predefined options for: get_initial_magnetic_moments() and get_initial_charges().
In principle this could be optional (so if the field/info does not exist, nothing will get parsed instead of rasining an Exception), should this be handeled on the ase.calculator side, or on the specific model side?
Maybe we could provide an additional parse_properties kwargs in the ase_calculator.MetatensorCalculator
and then handle the extraction logic here:
https://github.com/lab-cosmo/metatensor/blob/b34c0f3757b95cd85e04ce8cf468499e06a5a326/python/metatensor-torch/metatensor/torch/atomistic/ase_calculator.py#L211

I am happy to work on this on my own once we have fixed the API, we need it urgently ^^

So this is something we will want to do, but doing it properly will take time. If you need something urgently, we can do a temporary branch with it just for you =).
We already have a mechanism to add extra data on a system from the engine and retrieve it from the model, through System.add_data and System.get_data. What we are missing is a way for the model to request specific data from the engine (which can be other things than ASE!)
I can see something like this working, with a clear standard definition for what different extra data means (like we are standardizing the model outputs)
# model export

model = ...

capabilities = ModelCapabilities(
     # as usual
     extra_system_data=["charge", "..."] # this would be added
)

# model definintion
def forward(systems, ...):
     charges = system.get_data("charges") # error if the data was not requested

What speaks again having a bespoke ase calculator option implementation, in which the ase calculator writes to sytem data?

I would rather not put some code in the main branch which will be removed and changed once we have a solution for this. But we can do this in a temporary branch so you can go on with the scientific project while we figure the general solution!

I do not need any of the calculators for the scientific part. I would prefer to have it as part of the metatensor releases, because it should be easily pip installable for users. Happy to close the issue if there is no interest for an ase side implementation.

There is interest for a general mechanism that ASE will also use, so let's keep this open.

Some more details on how this could work: we would add an extra field in ModelCapabilities called something like extra_input, that would be a Dict[str, ModelOutput], describing everything the model want as extra input.
The engine would then get this field from the model, and following some specification (like the one we have for the outputs), store the corresponding data in the systems. Here, we could do the same as for outputs, and have "standard" extra input data, and allow users to do whatever as long as they add a namespace somewhere (i.e. my_model::custom_input).
The model can then access the data in the system.
Unresolved questions

should we rename ModelCapabilities to something like ModelSpecification since it will contain more than what the model can do?
should we rename ModelOutput to something like Quantity/Property/Data, since it is not only about outputs?
Dict[str, ModelOutput] is currently used to describe a bunch of TensorMap (the model outputs). Here it would describe a bunch of TensorBlock in the system data. Should we use TensorMap for everything?

Thinking a bit more about it: we would likely want to rename ModelOutput to AtomisticData, and use it to describe both "what the model needs as input" and "what the model can produce as output". From there, we would change ModelCapabilities to include extra_input: Dict[str, AtomisticData].
Simulation engines would then read extra_input, and store the corresponding data inside System using System.add_data().
This would likely use the same mechanism as the "standard outputs" for the names of the extra inputs & the corresponding metadata. Either the model requires something as input with a corresponding standard metadata definition, and the name can be something like charges, spin, ... or the model is using completely custom data and needs to use some kind of namespace, i.e. shiftml::magnetic-moment. Standardized data would also be checked when check_consistency=True.
One other remaining issue is what to do when a given physical quantity can have multiple definitions: energy could be computed at different levels of accuracy, charges can be determined in many ways, … One part of the solution could be to allow all of energy and energy::pbe0 and energy::ccsdt as separate inputs/outputs; and then have some way to determine which one to use when more than one are available.

authors: Luthaf bananenpampe

repo: lab-cosmo/metatensor


text:
编译master分支最新代码，不能正确导入mpython

出现引脚不用错误
Traceback (most recent call last):
File "", line 1, in
File "", line 25, in
ValueError: invalid pin

方便贴上的出现错误的python代码吗?

我猜测是你内部pin重新map后，mpython.py中的pin还是使用的以前的

已经更新,还原原本的Pin定义https://github.com/labplus-cn/mPython/commit/44e6f7c1a48cda1239385eba99a9061a0940b883

authors: lgnativs ouki-wang

repo: labplus-cn/mPython


text:
Feature: brief description of the feature

Which command or component
how to upgrade to sealos4 is a problem, because the production environment is sealos3.
Detailed description of the feature

provides a way to upgrade from sealos3 to sealos4, eg: sealos upgrade --old-cluster-version v1.21.12

Seems you need generate the Clusterfile: https://www.sealos.io/docs/api/sealos_gen

authors: Kabulaka fanux

repo: labring/sealos


text:
feat:account delete payment delay 5 minutes

Signed-off-by: 晓杰 2561589453@qq.com
Fix #1816
account delete payment more than 5 minutes

test finished in my mac，success del payment more than 5 minutes @fanux


text:
error logging

Description
Fixes # (issue)
DON'T PUSH UNTIL SAID OTHERWISE
Type of change
Please delete options that are not relevant.

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update

Change Status

[ ] Complete, tested, ready to review and merge
[ ] Complete, but not tested (may need new tests)
[ ] Incomplete/work-in-progress, PR is for discussion/feedback

How Has This Been Tested?

[ ] Test A
[ ] Test B

Checklist

[ ] My code follows the style guidelines of this project
[ ] I have performed a self-review of my own code
[ ] My code has been reviewed by at least one peer
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
[ ] There are no merge conflicts

Go ahead and merge


text:
Numpy issue on o2

Error executing process > 'unmicst (3)'

Caused by:
  Process `unmicst (3)` terminated with an error exit status (1)

Command executed:

  python /n/groups/lsp/mcmicro/UnMicst/UnMicst.py 4.tif --outputPath .

Command exit status:
  1

Command output:
  (empty)

Command error:
  Traceback (most recent call last):
    File "/n/app/python/3.7.4-ext/lib/python3.7/site-packages/numpy/core/__init__.py", line 40, in <module>
      from . import multiarray
    File "/n/app/python/3.7.4-ext/lib/python3.7/site-packages/numpy/core/multiarray.py", line 13, in <module>

 File "/n/app/python/3.7.4-ext/lib/python3.7/site-packages/numpy/core/overrides.py", line 6, in <module>
      from numpy.core._multiarray_umath import (
  ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/n/groups/lsp/mcmicro/UnMicst/UnMicst.py", line 1, in <module>
      import numpy as np
    File "/n/app/python/3.7.4-ext/lib/python3.7/site-packages/numpy/__init__.py", line 142, in <module>
      from . import core
    File "/n/app/python/3.7.4-ext/lib/python3.7/site-packages/numpy/core/__init__.py", line 71, in <module>
      raise ImportError(msg)
  ImportError:

  IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

  Importing the multiarray numpy extension module failed.  Most
  likely you are trying to import a failed build of numpy.
  Here is how to proceed:
  - If you're working with a numpy git repository, try `git clean -xdf`
    (removes all files not under version control) and rebuild numpy.
  - If you are simply trying to use the numpy version that you have installed:
    your installation is broken - please reinstall numpy.
  - If you have already reinstalled and that did not fix the problem, then:
    1. Check that you are using the Python you expect (you're using /home/ds230/work/conda/unmicst-fd23057379ebdf6804bf723a9b5c3328/bin/python),
       and that you have no directories in your PATH or PYTHONPATH that can
       interfere with the Python and numpy versions you're trying to use.
    2. If (1) looks fine, you can open a new issue at
       https://github.com/numpy/numpy/issues.  Please include details on:
       - how you installed Python
       - how you installed numpy
       - your operating system
       - whether or not you have multiple versions of Python installed
       - if you built from source, your compiler versions and ideally a build log

       Note: this error has many possible causes, so please don't comment on
       an existing issue about this - open a new one instead.

 Original error was: No module named 'numpy.core._multiarray_umath'

Work dir:
  /home/ds230/work/e3/6ac6d6c8315a35e488f44b1f927afa

Tip: view the complete command output by changing to the process work dir and entering the command `cat .command.out`

executor >  slurm (5)
[-        ] process > illumination -
[-        ] process > ashlar	   -
[bb/511c76] process > dearray	   [100%] 1 of 1 ✔
[16/e1333b] process > unmicst	   [400%] 4 of 1, failed: 4 ✘
[-        ] process > s3seg        -
WARN: Killing pending tasks (3)
Error executing process > 'unmicst (3)'

aused by:
  Process `unmicst (3)` terminated with an error exit status (1)

Command executed:

  python /n/groups/lsp/mcmicro/UnMicst/UnMicst.py 4.tif --outputPath .

Command exit status:
  1

Command output:
  (empty)

Command error:
  Traceback (most recent call last):
    File "/n/app/python/3.7.4-ext/lib/python3.7/site-packages/numpy/core/__init__.py", line 40, in <module>
      from . import multiarray
    File "/n/app/python/3.7.4-ext/lib/python3.7/site-packages/numpy/core/multiarray.py", line 13, in <module>
      from . import overrides
    File "/n/app/python/3.7.4-ext/lib/python3.7/site-packages/numpy/core/overrides.py", line 6, in <module>
      from numpy.core._multiarray_umath import (
  ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/n/groups/lsp/mcmicro/UnMicst/UnMicst.py", line 1, in <module>
      import numpy as np
    File "/n/app/python/3.7.4-ext/lib/python3.7/site-packages/numpy/__init__.py", line 142, in <module>
      from . import core
    File "/n/app/python/3.7.4-ext/lib/python3.7/site-packages/numpy/core/__init__.py", line 71, in <module>
      raise ImportError(msg)
  ImportError:

  IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

  Importing the multiarray numpy extension module failed.  Most
  likely you are trying to import a failed build of numpy.
  Here is how to proceed:
  - If you're working with a numpy git repository, try `git clean -xdf`
    (removes all files not under version control) and rebuild numpy.
  - If you are simply trying to use the numpy version that you have installed:
    your installation is broken - please reinstall numpy.
  - If you have already reinstalled and that did not fix the problem, then:
    1. Check that you are using the Python you expect (you're using /home/ds230/work/conda/unmicst-fd23057379ebdf6804bf723a9b5c3328/bin/python),
       and that you have no directories in your PATH or PYTHONPATH that can
       interfere with the Python and numpy versions you're trying to use.
    2. If (1) looks fine, you can open a new issue at
       https://github.com/numpy/numpy/issues.  Please include details on:
       - how you installed Python
       - how you installed numpy
       - your operating system
       - whether or not you have multiple versions of Python installed
       - if you built from source, your compiler versions and ideally a build log

       Note: this error has many possible causes, so please don't comment on
       an existing issue about this - open a new one instead.

  Original error was: No module named 'numpy.core._multiarray_umath'

Work dir:
  /home/ds230/work/e3/6ac6d6c8315a35e488f44b1f927afa

Tip: view the complete command output by changing to the process work dir and entering the command `cat .command.out`

I tried to add numpy to the yml file, but it did not change the error message.
@ArtemSokolov Can you run the full pipeline without issues on o2 currently?

Confirming that I can reproduce the error. Going to compare versions of python packages between Conda and Docker (which runs without issues).

The issue is due to a conflict in the numpy version created by module load ashlar and module load conda2. Jeremy is working on a conda environment file for ASHLAR to be included with the pipeline (thus removing the need for module load ashlar).
As an intermediate solution, ASHLAR and everything post-ASHLAR can be run in two different O2 sessions:

module load gcc ashlar java matlab
Run the pipeline as usual. It will complete stitching (and optionally de-arraying) but fail at unmicst.
Start a fresh O2 session.
module load conda2 java
Run the pipeline again but with --skip_ashlar flag to use the stitched image generated in Step 2.

Can you run the full pipeline until the end now?
I am getting the follow error message and I am not sure if related:

Error executing process > 's3seg (1)'

Caused by:
  Process `s3seg (1)` terminated with an error exit status (1)

Command executed:

  python /n/groups/lsp/mcmicro/S3segmenter/S3segmenter.py --crop noCrop        --imagePath exemplar-002.ome.tif        --maskPath NO_MASK        --nucleiClassProbPath exemplar-002_NucleiPM_1.tif        --contoursClassProbPath exemplar-002_ContoursPM_1.tif        --outputPath .

Command exit status:
  1

Command output:
  (empty)

Command error:
  Traceback (most recent call last):
    File "/n/groups/lsp/mcmicro/S3segmenter/S3segmenter.py", line 249, in <module>
      tissue_gauss1[tissue_gauss>np.percentile(tissue_gauss,99)]=np.nan
  ValueError: cannot convert float NaN to integer

Work dir:
  /home/ds230/work/00/db65a7a15be0c1828274e12e14cbe2

Tip: you can try to figure out what's wrong by changing to the process work dir and showing the script file named `.command.sh`

Correction 4:
module load conda2 java matlab

Issue fixed by #37 and #38.

authors: ArtemSokolov DenisSch

repo: labsyspharm/mcmicro-nf


text:
Pass-through used profile for command recommendations

I'd like to have the currently used profile passed through in command recommendations.  For example, the container vuln scan command output currently looks like this:
lacework vuln container scan index.docker.io alannix/my-awesome-container latest -p my-awesome-profile
A new vulnerability scan has been requested. (request_id: 151e6d4c-3948-4430-80ed-b07f0c8d548e)

To track the progress of the scan, use the command:
  $ lacework vulnerability container scan-status 151e6d4c-3948-4430-80ed-b07f0c8d548e

I think we should add the profile if possible to make it more copy/paste - like this:
lacework vuln container scan index.docker.io alannix/my-awesome-container latest -p my-awesome-profile
A new vulnerability scan has been requested. (request_id: 151e6d4c-3948-4430-80ed-b07f0c8d548e)

To track the progress of the scan, use the command:
  $ lacework vulnerability container scan-status 151e6d4c-3948-4430-80ed-b07f0c8d548e -p my-awesome-profile

JIRA: https://lacework.atlassian.net/browse/ALLY-634

authors: afiune alannix-lw

repo: lacework/go-sdk


text:
Release v1.33.3

Release Notes
Another day, another release. These are the release notes for the version v1.33.3.
Bug Fixes

fix: increase component download timeout to 5m (#1392) (jonathan stewart)(fa31ff24)

Other Changes

ci: version bump to v1.33.3-dev (Lacework)(4c7adc66)

:whale: Docker Image
docker pull lacework/lacework-cli

We require an additional fix - closing this release

authors: jon-stewart lacework-releng


text:
The default for scanning stopped instances should be 'false' as documented

Summary
The documentation states this should default to false.
How did you test this change?
This is a trivial change of a default, so have performed no additional testing.
Issue
N/A

I also double checked and believed the default value being true is correct.

If that's true, should we instead update the documentation? I don't really have an opinion on which way it should go, I'm just noting that the current situation is at odds with the documentation.

@foygl, apologies for the delay in getting back on this. We updated the documentation to say that default should be true. Hence, we're closing this PR.

authors: foygl selvats


text:
feat: add new variable 'lacework_agent_log_stdout'

Summary
Relates to Issue: https://github.com/lacework/terraform-kubernetes-agent/issues/57

How did you test this change?

[x] terraform plan

Issue

https://lacework.atlassian.net/browse/GROW-1119
https://github.com/lacework/terraform-kubernetes-agent/issues/57

Can we add an example?

I don't feel like this is mandatory, the variable is quite self explanatory 😅

Hello @dmurray-lacework, @afiune,
https://registry.terraform.io/modules/lacework/agent/kubernetes/latest
Did we forget to push on the Terraform registry?
Thank you!!

Hey @JPLachance the latest version looks correct to me. Possibly it has synced since your message.

authors: JPLachance dmurray-lacework

repo: lacework/terraform-kubernetes-agent


text:
after confirm the creation of dnft, a metamask should popup to sign for confirmation

It need to be on hyper space network
Need an alert for the switch to hyper space network
it need gas

need https://github.com/lagrangedao/datanft/issues/5 to create metadata

repo: lagrangedao/datanft


text:
The syntax of the command is incorrect.

Why I am getting this error :

The same mistake. Perhaps the project is not working - just look at the code?

you should go to the package.json file and in the script section add this line
"start": "http-server -c-1"
and then run npm start command
i think it shoul work...

authors: AlirezaEbrahimkhani vivek9716 yinfo

repo: lakshyaranganath/pwa

license: mit

license_source: bigquery


text:
staus2 not showing index 8

First of all: I am a complete newbie to nspanel-lui.
I made a little test to see how items are working and do not find a way to show index[8].
0 to 7 are working as expected, 8 not showing up...
And: Items in status2 are only showing up when I first send weather data.
############### Problem found in nspanel-screensaver2.js
const MAX_STATUS2_ITEMS = 8
has to be
const MAX_STATUS2_ITEMS = 9

I am sorry for answering late, for I was quite busy for a while.
Actually 8 is right, since the loop is counting from index 0 to 7, which are 8 data entities.
Did you send the data starting from index 0?
Or did I got you wrong?

There are 9 items, index from 0 to 8. So const MAX_STATUS2_ITEMS = 9 would be right,,,
Anyway thanks for your great work. So happy I can use the panel with node red.


text:
Why Secp256k1 Curve is not re exported in lambdaworks_math crate?

@igaray @mpaulucci

And also why there is implementation of ed25519 curve?

repo: lambdaclass/lambdaworks


text:
created an all emoji file

I created a file with all the emojis offered by Emojipack.

Woah, going for it! I like it. Did you test it with a Slack instance with no errors? If so, I will merge.

Hi Zach,
Yes I tested it and did not get any errors. It takes a half hour to run. Thank you for creating this great project!
Best,
Jennifer Kaplan

On Jun 13, 2017, at 10:30 PM, Zach Feldman notifications@github.com wrote:
Woah, going for it! I like it. Did you test it with a Slack instance with no errors? If so, I will merge.
—
You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lambtron/emojipacks/pull/118#issuecomment-308302091, or mute the thread https://github.com/notifications/unsubscribe-auth/AWBNPUxWCQEWJYiFYy_UawnpMA3sitMCks5sD0XSgaJpZM4N5PvB.

You may thank the mighty @lambtron I am but a humble maintainer. Haha. Consider yourself merged

@jenkaplan sorry but I had to revert your commit because it broke the build :(
https://travis-ci.org/lambtron/emojipacks/builds/242672946?utm_source=email&utm_medium=notification
I still think it's a good idea to do this, however, it might make a little more sense to implement code that joins multiple emoji files so people can make their own multipacks, vs pushing a big multipack with all the emojipacks that exist already, which we'd probably have to update. Maybe something that adds a flag to the emojipacks command to include multiple packs (I don't think you can do this already).
Thanks for your contribution either way!

Hi Zach,
I’m so sorry it broke the build! This was my first attempt at contributing to open source. Thank you for being so kind and making suggestions.
Best,
Jen

On Jun 14, 2017, at 11:32 AM, Zach Feldman notifications@github.com wrote:
@jenkaplan https://github.com/jenkaplan sorry but I had to revert your commit because it broke the build :(
https://travis-ci.org/lambtron/emojipacks/builds/242672946?utm_source=email&utm_medium=notification https://travis-ci.org/lambtron/emojipacks/builds/242672946?utm_source=email&utm_medium=notification
I still think it's a good idea to do this, however, it might make a little more sense to implement code that joins multiple emoji files so people can make their own multipacks, vs pushing a big multipack with all the emojipacks that exist already, which we'd probably have to update. Maybe something that adds a flag to the emojipacks command to include multiple packs (I don't think you can do this already).
Thanks for your contribution either way!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/lambtron/emojipacks/pull/118#issuecomment-308469127, or mute the thread https://github.com/notifications/unsubscribe-auth/AWBNPe0dgCq7IeCz7dCEllRuQTIbtUHAks5sD_0JgaJpZM4N5PvB.

No problem!

This is literally everything.
Thank you @jenkaplan!!

@lambtron No problem! I'm sorry that this broke your npm build!

authors: jenkaplan lambtron zachfeldman

repo: lambtron/emojipacks


text:
No puedo Instalar el Android Studio

JavaFX no es JDK lo que tu tienes que descargar es el JDK. (Adjunto Imagen

)
Verifica de bajar Windows x86 o Windows x64 dependiendo del Sistema Operativo que tengas.

Uh joya! Me salio. Gracias =)

Mentira, no me salio. Me salto esto cuando lo estaba por ejecutar

Probaste reiniciar la pc?

Si profe no anda, me sigue saliendo el mismo problema

Vamos a hacer lo siguiente a que hora pueden hacer un hangout público todos los que tengan problemas para montar el entorno?

Ahi pude :baby_bottle:

Ahi pude =D

authors: JuampaBlaskovich catrielmuller


text:
Update vimeo/psalm to 4.10 and add psalm/plugin-phpunit

Q
A

QA
yes

Description

This bumps psalm to its latest version while adding psalm/plugin-phpunit.
This also changes some Symfony\Component\Console\Question\Question#setValidator callables to static callables for minor speed improvements in newer PHP versions.

ERROR: InvalidDocblock - src/Input/AbstractParamAwareInput.php:329:13 - Templated closures are not supported (see https://psalm.dev/008)
            /**
             * @psalm-template ValueType of mixed
             * @psalm-param callable(ValueType): bool $validator
             * @psalm-param ValueType $value
             */
            static function ($value) use ($originalValidator) {

repo: laminas/laminas-cli


text:
Automatically infer version for passed database

We currently require both database and version to be passed explicitly if the default is not used. The associated version for the passed database is currently being looked up in the _current.yaml.
If only the database is passed we should attempt to fetch the latest version of this ontology and just use it. A warning wouldn't hurt.

Was just about to report this! 😄

authors: Zethson sunnyosun

repo: laminlabs/bionty


text:
Config options have two independent indexes

Config options are both recognized by their name, and by constants defined in an enum. This is error prone because both get easily out of sync. This should be changed to lookup by name only.

Problem has been fixed in https://github.com/lammertb/libhttp/commit/ab54a82c2d6002bcfc88b090bfd9795e51637533 Options are now no longer stored in an ASCII array, but as binary values in a structure. This also allowed for adding functions to do proper value checking when a context is started. Downside is that some functions which allowed deep peeks into the data structure of LibHTTP are no longer available.

repo: lammertb/libhttp


text:
MakeCode simple parrot programme runs out of memory

This simple MakeCode parrot programme from https://github.com/microsoft/pxt-microbit/issues/5312 runs out of memory consistently after a few recordings:

https://makecode.microbit.org/_VziHPeD7a3XJ

input.onButtonPressed(Button.A, function () {
    record.setSampleRate(11000)
    basic.showString("?")
    record.startRecording(record.BlockingState.Blocking)
    basic.showLeds(`
        . # . . .
        . # # . .
        . # # # .
        . # # . .
        . # . . .
        `)
    record.setSampleRate(18000)
    record.playAudio(record.BlockingState.Blocking)
    basic.clearScreen()
})

It might run out of memory with error 020 after a couple of recordings, or a few more. So far I've always managed to trigger it within 5 attempts.
❌ This can be replicated with MakeCode Live v6.0.18 with CODAL v0.2.57:

https://makecode.microbit.org/
https://makecode.microbit.org/v6.0.18

❌ I can also be replicated with MakeCode v6.0.17 with the same CODAL v0.2.57:

https://makecode.microbit.org/v6.0.17

❌ I can also be replicated with MakeCode v6.0.16 with CODAL v0.2.56:

https://makecode.microbit.org/v6.0.16

✅ Going back to version  v6.0.15 with CODAL v0.2.55 and I cannot replicate anymore:

https://makecode.microbit.org/v6.0.15

So it might have been introduced in v0.2.56:
https://github.com/lancaster-university/codal-microbit-v2/compare/v0.2.55...v0.2.56

On Monday we should figure out if we can issue quick hotfix or if we need to ask the MakeCode team to revert back to CODAL v0.2.55.

Just a note here to say I'm currently investigating this.

Tag v0.2.60 has increased the maximum size for stream recordings, as a temporary workaround to this issue while we continue investigating it: https://github.com/lancaster-university/codal-core/commit/a1163541d10c0a0d3dd9b2e8ac1b8906100449ad
It's been merged in pxt-microbit and we are hoping to be able to release to MakeCode Live asap:

https://github.com/microsoft/pxt-microbit/pull/5360

With the updated memory configuration in v0.2.61 Makecode seems much happier, and I'm now unable to reproduce the 020 crash.
There seems to be another issue with the sample rate being forgotten on the second run, but I don't believe this is related to this particular issue, so I'm going to close this one as done for now.

(Makecode versions for reference)

authors: JohnVidler microbit-carlos


text:
🛑 vipgifts.net is down

In 668df5c, vipgifts.net (https://vipgifts.net) was down:

HTTP code: 567
Response time: 486 ms

Resolved: vipgifts.net is back up in 2aa4682 after 15 minutes.

repo: lanen/bs-site


text:
🛑 vipgifts.net is down

In ab91c44, vipgifts.net (https://vipgifts.net) was down:

HTTP code: 567
Response time: 866 ms

Resolved: vipgifts.net is back up in 1985fbb after 26 minutes.


text:
🛑 vipgifts.net is down

In 2a79648, vipgifts.net (https://vipgifts.net) was down:

HTTP code: 567
Response time: 691 ms

Resolved: vipgifts.net is back up in cf9b2dc after 20 minutes.


text:
🛑 trixmall.com is down

In 1e8295d, trixmall.com (https://www.trixmall.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: trixmall.com is back up in f88a96e.


text:
🛑 rexingsports.cn is down

In 4124bf8, rexingsports.cn (https://www.rexingsports.cn) was down:

HTTP code: 567
Response time: 638 ms

Resolved: rexingsports.cn is back up in acde501 after 19 minutes.


text:
🛑 vipgifts.net is down

In e4ea138, vipgifts.net (https://vipgifts.net) was down:

HTTP code: 567
Response time: 604 ms

Resolved: vipgifts.net is back up in 807fe76 after 18 minutes.


text:
🛑 vipgifts.net is down

In 7ca775f, vipgifts.net (https://vipgifts.net) was down:

HTTP code: 0
Response time: 0 ms

Resolved: vipgifts.net is back up in ddf6357.


text:
🛑 vipgifts.net is down

In 30418d6, vipgifts.net (https://vipgifts.net) was down:

HTTP code: 567
Response time: 470 ms

Resolved: vipgifts.net is back up in 45f17ac after 18 minutes.


text:
🛑 vipgifts.net is down

In 3d22bc0, vipgifts.net (https://vipgifts.net) was down:

HTTP code: 567
Response time: 319 ms

Resolved: vipgifts.net is back up in 21ec650 after 18 minutes.


text:
🛑 Grafana is down

In 47ee9c6, Grafana (http://langasg1.ddns.net:8082) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Grafana is back up in 65ff8a2.

repo: langasg/upptime


text:
BREAKING: remove langgraph checkpointer

Breaking change, removing langgraph checkpointer since the langgraph checkpointer interface changed (so was a breaking change anyway).

If the langgraph checkpointer will add back in some days?

+1.  Any ETA on when we can expect to see this added back?  Is someone working on it?  Is help desired/needed?

👀 I'm confused. How do you build a checkpointer then?

+1

Any plan to add it back? The doc recommend to not use SQLite in production but now it seems there is no checkpointer based on PostgreSQL? What are we supposed to do? Will it come back?

The implementation for Postgres checkpointer can be found at : https://langchain-ai.github.io/langgraph/how-tos/persistence_postgres/

authors: 315930399 NTag eyurtsev mindsockets olliewild runirudh ymongo

repo: langchain-ai/langchain-postgres


text:
SQL Agent not working well with Claude v2 model

Issue you'd like to raise.
Im trying to develop an sql agent chatbot that will generate and exceute SQL queries based on the user free-text questions.
so far I have developed a generic and basic agent with ChatGPT-4 and it worked pretty well (generated complex SQL and returned an answer).
When I tried to switch the LLM with Claude v2 (hosted on AWS Bedrock) things started to break.
sometimes the agent get stuck in a loop of the same input (for example):
> Entering new AgentExecutor chain...
 Here is my thought process and actions to answer the question "how many alerts?":

Thought: I need to first see what tables are available in the database.
Action: sql_db_list_tables
Action Input:
Observation: alerts, detectors
Thought: Here is my response to the question "how many alerts?":

Thought: I need to first see what tables are available in the database.
Action: sql_db_list_tables
Action Input:
Observation: alerts, detectors
Thought: Here is my response to the question "how many alerts?":

Thought: I need to first see what tables are available in the database.
Action: sql_db_list_tables
Action Input:
Observation: alerts, detectors
Thought: Here is my response to the question "how many alerts?":

Thought: I need to first see what tables are available in the database.
Action: sql_db_list_tables
Action Input:
Observation: alerts, detectors
Thought: Here is my response to the question "how many alerts?":

sometimes it gets to the point that it actually query the db and get the result but don't stop the run and return the answer.
Here is how I configured the LLM and agent:
def aws_bedrock():
    config = AwsBedrockConfig()
    client = boto3.client(
        'bedrock-runtime',
        region_name=config.region_name,
        aws_access_key_id=config.aws_access_key_id,
        aws_secret_access_key=config.aws_secret_access_key,
    )
    model_kwargs = {
        "prompt": "\n\nHuman: Hello world\n\nAssistant:",
        "max_tokens_to_sample": 100000,
        "temperature": 0,
        "top_k": 10,
        "top_p": 1,
        "stop_sequences": [
            "\n\nHuman:"
        ],
        "anthropic_version": "bedrock-2023-05-31"
    }
    return Bedrock(
        client=client,
        model_id=config.model_id,
        model_kwargs=model_kwargs
    )

(also tried to change the model arguments with no success)
memory = ConversationBufferMemory(memory_key="history", chat_memory=history)
        toolkit = SQLDatabaseToolkit(db=db, llm=self.llm)

        self.agent = create_sql_agent(
            llm=self.llm,
            toolkit=toolkit,
            extra_tools=[TableCommentsTool(db=db)],
            prefix=self.format_sql_prefix(filters),
            suffix=HISTORY_SQL_SUFFIX,
            agent_type=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
            agent_executor_kwargs={"memory": memory},
            verbose=True,
            input_variables=["input", "history", "agent_scratchpad"]
        )

Suggestion:
No response

Thank you bot, I suspect that it something to do with the prompts.
Im getting the following error while the agent is running:
"Observation: Invalid Format: Missing 'Action:' after 'Thought:"
Any idea what could cause it?

🤖
Hello again @dudu-upstream! It's good to see you back here. I hope you're doing well.
Thank you for providing detailed information about your issue. It seems like the agent is stuck in a loop and not progressing to the next step after listing the tables in the database. This could be due to a variety of reasons, including issues with the Claude v2 model, the AWS Bedrock integration, or the SQL execution process.
From the context provided, it's clear that LangChain has a specific way of handling different language models and executing SQL queries. However, without more specific information about how the Claude v2 model and AWS Bedrock are integrated into LangChain, it's difficult to pinpoint the exact cause of the issue.
One thing you could try is to debug the agent execution process. You can do this by adding print statements or logging in the agent's code to see exactly where it's getting stuck. This could help you identify if the issue is with the Claude v2 model, the AWS Bedrock integration, or the SQL execution process.
If the issue is with the Claude v2 model or the AWS Bedrock integration, you might need to adjust the configuration or the way you're using these services. For example, you could try changing the model arguments or the way you're initializing the Bedrock client.
If the issue is with the SQL execution process, you might need to adjust the way you're using the SQLDatabaseChain class. For example, you could try changing the return_sql, use_query_checker, return_direct, or return_intermediate_steps attributes.
Without more specific information, it's difficult to provide a more detailed solution. If you could provide more details about how you're using the Claude v2 model, the AWS Bedrock integration, and the SQL execution process, it would be easier to help you solve this issue.
Sources

libs/langchain/langchain/init.py
libs/langchain/langchain/embeddings/bedrock.py
libs/experimental/langchain_experimental/sql/base.py

Thank you bot, I suspect that it something to do with the prompts.
Im getting the following error while the agent is running:
"Observation: Invalid Format: Missing 'Action:' after 'Thought:"
Any idea what could cause it?

I have the same issue with Anthropic. There seems to be several problems:

Model struggles with the action formatting. The error message: Invalid Format: Missing 'Action Input:' after 'Action:' This is the MRKL prompt used in create_sql_agent: https://github.com/langchain-ai/langchain/blob/master/libs/langchain/langchain/agents/mrkl/prompt.py. Could it be because Anthropic prefers <></> XML tags instead of plain text?

Even after successfully formatting the action input after several attempts and getting the correct answer, agent continues firing requests until 429 rate limit error from Anthropic.

authors: dudu-upstream iharsuvorau

repo: langchain-ai/langchain


text:
LangChain AzureOpenAIEmbeddings is not working due to model trying to access microsoft

Checked other resources

[X] I added a very descriptive title to this issue.
[X] I searched the LangChain documentation with the integrated search.
[X] I used the GitHub search to find a similar question and didn't find it.
[X] I am sure that this is a bug in LangChain rather than my code.
[X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code
from langchain_openai import AzureOpenAIEmbeddings
os.environ["AZURE_OPENAI_API_KEY"] = get_auth_token()
os.environ["OPENAI_API_KEY"] = get_auth_token()
os.environ["AZURE_OPENAI_ENDPOINT"] = 'https://workspace.openai.azure.com/'
os.environ["OPENAI_ENDPOINT"] = 'https://workspace.openai.azure.com/'
os.environ['OPENAI_API_TYPE'] = "azure"
os.environ['OPENAI_API_VERSION']='2023-07-01-preview'

embeddings = AzureOpenAIEmbeddings(
    model='text-embedding-3-small',
    chunk_size=1
)

embeddings.embed_documents(['text'])

Error Message and Stack Trace (if applicable)
---------------------------------------------------------------------------
SSLEOFError                               Traceback (most recent call last)
File /anaconda/envs/nlp_min/lib/python3.10/site-packages/urllib3/connectionpool.py:670, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    [669](https://vscode-remote+amlext-002b2f737562736372697074696f6e732f32316164386262372d633338382d343161352d613931612d6362336539323161356439612f7265736f7572636547726f7570732f676932756f6b79757439356e6c6c392d636f6d6d6f6e2f70726f7669646572732f4d6963726f736f66742e4d616368696e654c6561726e696e6753657276696365732f776f726b7370616365732f676932756f6b79757439356e6c6c392d616d6c2f636f6d70757465732f6465762d41313030.vscode-resource.vscode-cdn.net/anaconda/envs/nlp_min/lib/python3.10/site-packages/urllib3/connectionpool.py:669) # Make the request on the httplib connection object.

......

    [706](https://vscode-remote+amlext-002b2f737562736372697074696f6e732f32316164386262372d633338382d343161352d613931612d6362336539323161356439612f7265736f7572636547726f7570732f676932756f6b79757439356e6c6c392d636f6d6d6f6e2f70726f7669646572732f4d6963726f736f66742e4d616368696e654c6561726e696e6753657276696365732f776f726b7370616365732f676932756f6b79757439356e6c6c392d616d6c2f636f6d70757465732f6465762d41313030.vscode-resource.vscode-cdn.net/anaconda/envs/nlp_min/lib/python3.10/site-packages/requests/sessions.py:706) elapsed = preferred_clock() - start

File /anaconda/envs/nlp_min/lib/python3.10/site-packages/requests/adapters.py:517, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
    [513](https://vscode-remote+amlext-002b2f737562736372697074696f6e732f32316164386262372d633338382d343161352d613931612d6362336539323161356439612f7265736f7572636547726f7570732f676932756f6b79757439356e6c6c392d636f6d6d6f6e2f70726f7669646572732f4d6963726f736f66742e4d616368696e654c6561726e696e6753657276696365732f776f726b7370616365732f676932756f6b79757439356e6c6c392d616d6c2f636f6d70757465732f6465762d41313030.vscode-resource.vscode-cdn.net/anaconda/envs/nlp_min/lib/python3.10/site-packages/requests/adapters.py:513)         raise ProxyError(e, request=request)
    [515](https://vscode-remote+amlext-002b2f737562736372697074696f6e732f32316164386262372d633338382d343161352d613931612d6362336539323161356439612f7265736f7572636547726f7570732f676932756f6b79757439356e6c6c392d636f6d6d6f6e2f70726f7669646572732f4d6963726f736f66742e4d616368696e654c6561726e696e6753657276696365732f776f726b7370616365732f676932756f6b79757439356e6c6c392d616d6c2f636f6d70757465732f6465762d41313030.vscode-resource.vscode-cdn.net/anaconda/envs/nlp_min/lib/python3.10/site-packages/requests/adapters.py:515)     if isinstance(e.reason, _SSLError):
    [516](https://vscode-remote+amlext-002b2f737562736372697074696f6e732f32316164386262372d633338382d343161352d613931612d6362336539323161356439612f7265736f7572636547726f7570732f676932756f6b79757439356e6c6c392d636f6d6d6f6e2f70726f7669646572732f4d6963726f736f66742e4d616368696e654c6561726e696e6753657276696365732f776f726b7370616365732f676932756f6b79757439356e6c6c392d616d6c2f636f6d70757465732f6465762d41313030.vscode-resource.vscode-cdn.net/anaconda/envs/nlp_min/lib/python3.10/site-packages/requests/adapters.py:516)         # This branch is for urllib3 v1.22 and later.
--> [517](https://vscode-remote+amlext-002b2f737562736372697074696f6e732f32316164386262372d633338382d343161352d613931612d6362336539323161356439612f7265736f7572636547726f7570732f676932756f6b79757439356e6c6c392d636f6d6d6f6e2f70726f7669646572732f4d6963726f736f66742e4d616368696e654c6561726e696e6753657276696365732f776f726b7370616365732f676932756f6b79757439356e6c6c392d616d6c2f636f6d70757465732f6465762d41313030.vscode-resource.vscode-cdn.net/anaconda/envs/nlp_min/lib/python3.10/site-packages/requests/adapters.py:517)         raise SSLError(e, request=request)
    [519](https://vscode-remote+amlext-002b2f737562736372697074696f6e732f32316164386262372d633338382d343161352d613931612d6362336539323161356439612f7265736f7572636547726f7570732f676932756f6b79757439356e6c6c392d636f6d6d6f6e2f70726f7669646572732f4d6963726f736f66742e4d616368696e654c6561726e696e6753657276696365732f776f726b7370616365732f676932756f6b79757439356e6c6c392d616d6c2f636f6d70757465732f6465762d41313030.vscode-resource.vscode-cdn.net/anaconda/envs/nlp_min/lib/python3.10/site-packages/requests/adapters.py:519)     raise ConnectionError(e, request=request)
    [521](https://vscode-remote+amlext-002b2f737562736372697074696f6e732f32316164386262372d633338382d343161352d613931612d6362336539323161356439612f7265736f7572636547726f7570732f676932756f6b79757439356e6c6c392d636f6d6d6f6e2f70726f7669646572732f4d6963726f736f66742e4d616368696e654c6561726e696e6753657276696365732f776f726b7370616365732f676932756f6b79757439356e6c6c392d616d6c2f636f6d70757465732f6465762d41313030.vscode-resource.vscode-cdn.net/anaconda/envs/nlp_min/lib/python3.10/site-packages/requests/adapters.py:521) except ClosedPoolError as e:

SSLError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007)')))

Description
I tried this code snippets along with many variations, none worked, the issue is that under the hood the function tries to access openaipublic.blob.core.windows.net which is not allowed. Why is this trying to access an external link when all it needs to do is to connect to our azure openai endpoint?
System Info
langchain==0.2.7
langchain-chroma==0.1.2
langchain-community==0.0.8
langchain-core==0.2.18
langchain-openai==0.1.16
langchain-text-splitters==0.2.2

Hi @hassanzadeh ,
Could you try passing the azure_deployment name for the embedding model like so:
from langchain_openai import AzureOpenAIEmbeddings

embeddings = AzureOpenAIEmbeddings(
    azure_deployment="<your-embeddings-deployment-name>",
    openai_api_version="2023-05-15",
)

Reference Doc: https://python.langchain.com/v0.2/docs/integrations/text_embedding/azureopenai/

authors: abprime hassanzadeh


text:
Persist additional details in BaseListChatMessageHistory

I'm using the ConversationalQAChain like this
  const chain = ConversationalRetrievalQAChain.fromLLM(llm, vectorStore.asRetriever(), {
    memory: new BufferMemory({
      chatHistory: new InternalChatMessageHistory({
        sessionId: session.id,
      }),
      memoryKey: 'chat_history', // Must be set to "chat_history"
      inputKey: 'question',
      outputKey: 'text',
    }),
    verbose: false,
    returnSourceDocuments: true,
  });

I have a simple ChatMessageHistory implementation which stores all messages within the chat. Now, I would l like to store the source documents together with the AI message. Unfortunately, none of the additional information like in this case the source documents are part of the input to the BaseListChatMessageHistory interface.
My proposal is to include these information in the call to the Memory implementation so they can be persisted with the message.
Alternatively, it would be great if the addMessagefunction could optionally return values so that I can get the internal id created in my implementation to attach the results from the LLM call.
Any thoughts on this? Am I missing some existing functionality to achieve this?

No thoughts on this?

repo: langchain-ai/langchainjs


text:
Errors when loading @langchain/core/messages in a typescript ES module

Checked other resources

[X] I added a very descriptive title to this issue.
[X] I searched the LangChain.js documentation with the integrated search.
[X] I used the GitHub search to find a similar question and didn't find it.
[X] I am sure that this is a bug in LangChain.js rather than my code.
[X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code
import { BaseMessage, ChatMessage } from '@langchain/core/messages';

tsconfig:
{
	"compilerOptions": {
		"module": "Node16",
		"target": "ES2022",
		"outDir": "out",
		"lib": [
			"ES2022",
			"dom"
		],
		"sourceMap": true,
		"rootDir": "src",
		"strict": true
	}
}

Error Message and Stack Trace (if applicable)
@langchain/core/messages.d.cts:
The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./dist/messages/index.js")' call instead.
Description
Trying to make a VSCode extension, but can't with the required settings and langchain's cjs dependencies.
System Info
langchain@0.1.25 | MIT | deps: 18 | versions: 255
Typescript bindings for langchain
https://github.com/langchain-ai/langchainjs/tree/main/langchain/
keywords: llm, ai, gpt3, chain, prompt, prompt engineering, chatgpt, machine learning, ml, openai, embeddings, vectorstores
dist
.tarball: https://registry.npmjs.org/langchain/-/langchain-0.1.25.tgz
.shasum: afd0faf2eadfb5e6e1d57bb3bbc5731918e62135
.integrity: sha512-sfEChvr4H2CklHdSByNBbytwBrFhgtA5kPOnwcBrxuXGg1iOaTzhVxQA0QcNcQucI3hZrsNbZjxGp+Can1ooZQ==
.unpackedSize: 4.0 MB
dependencies:
@anthropic-ai/sdk: ^0.9.1     js-tiktoken: ^1.0.7           openapi-types: ^12.1.3
@langchain/community: ~0.0.33 js-yaml: ^4.1.0               p-retry: 4
@langchain/core: ~0.1.36      jsonpointer: ^5.0.1           uuid: ^9.0.0
@langchain/openai: ~0.0.14    langchainhub: ~0.0.8          yaml: ^2.2.1
binary-extensions: ^2.2.0     langsmith: ~0.1.7             zod-to-json-schema: ^3.22.3
expr-eval: ^2.0.2             ml-distance: ^4.0.0           zod: ^3.22.4
maintainers:

nfcampos nuno@boringbits.io
jacoblee93 jacoblee93@gmail.com
davidduong david@duong.cz
hwchase17 hw.chase.17@gmail.com
basproul braceasproul@gmail.com

dist-tags:
latest: 0.1.25     next: 0.1.19-rc.2
published 5 days ago by basproul braceasproul@gmail.com
Windows 10 Pro
npm v10.2.4
NodeJS v20.11.1

Hey @marc-weber1, can you share your package.json file too?

https://github.com/marc-weber1/langchain-vscode/blob/master/package.json
entire source code is on github, master branch as is should reproduce the error, may need vscode installed

Sat"type": "module" in package JSON or use require
https://blog.logrocket.com/commonjs-vs-es-modules-node-js/

BaseMessage and ChatMessage are types, and I can't convert a VSCode extension to an ES6 module; How am I supposed to import types with a require statement?

https://github.com/microsoft/vscode/issues/201935 - looks like they will fix this soon, but maybe include some documentation about either CommonJS not being supported or how to use it

Oh hmm interesting. How do people usually require types in CJS? Haven't worked with it in a long time.
Would something like this work?
const { ChatPromptTemplate, LengthBasedExampleSelectorInput } = await import("langchain/prompts");


text:
how do I set the password for Redis

If I use Redis cloud as a vector database, how do I set the password for Redis when the application starts? Because it started with an error message, prompt: redis. exceptions. AuthenticationError: Authentication required

How are you presently trying to connect?

got this  too how to set redis?

Try using this snippet when using RedisChatMessageHistory
message_history = RedisChatMessageHistory(
    url="redis://:<PASSWORD>@<PUBLIC-ENDPOINT>:<PORT>", ttl=600, session_id="my-session"
)

memory = ConversationBufferWindowMemory(
    k=5, memory_key="chat_history", chat_memory=message_history, input_key="question"
)

memory.load_memory_variables({"question": "about langchain"})

# output
# -----
# {'chat_history': ''}

authors: LiamHoo chasemcdo dominicdev rafka-imandaputra

repo: langchain-ai/opengpts


text:
Validering på tidsdifferanser kjøreplan

Bør også sjekke start-tider og minimum hviletid. Legge inn "minimum tid mellom to starter".

Tid mellom siste kvartfinale og første semifinale.
Tid mellom siste semfinale C og første finale C
Tid mellom siste semfinale A og første finale B (eller A hvis B ikke finnes)

Lages som en egen valideringstjeneste

Commit did not solve the time-differences. Need to reopen.

authors: heming-langrenn stigbd

repo: langrenn-sprint/race-service


text:
Views on top of inputs don't fire on_clicks

When I have a view that is positioned absolute over an input field the on_clicks on that view won't fire.
Consider this code:
use floem::{
    reactive::create_rw_signal,
    style::Position,
    view::View,
    views::{container, label, stack, Decorators},
    widgets::text_input,
};

fn app_view() -> impl View {
    let value = create_rw_signal(String::from(""));
    stack((
        container(text_input(value)),
        label(move || "Label on top")
            .style(|s| {
                s.position(Position::Absolute)
                    .inset_top(8.5)
                    .inset_left(7)
                    .background(floem::peniko::Color::rgba8(255, 0, 0, 150))
            })
            .on_click_cont(|_| {
                println!("Click continue");
            })
            .on_click_stop(|_| {
                println!("Click stop");
            }),
    ))
    .style(|s| {
        s.position(Position::Relative)
            .margin(10)
            .height(30)
            .items_center()
            .justify_center()
    })
}

fn main() {
    floem::launch(app_view);
}

This will render something like this:

A label with a red background is positioned on top of an input field.
this is what happens when you try to click on the label:

Note there is no print output in stdout in the terminal below. Neither for on_click_cont nor for on_click_stop.

Found what is happening
This is something specific to the click listener. Click is registered and marked as handled after both pointer down and pointer up. But before the pointer up is handled the input gets the pointer down event and requests to be active which means that it will receive prioritized events so the label never gets the pointer up.
If you use on_event_stop pointer down with the on_click then both fire because the label marks the event as handled after the pointer down and the input doesn't see the event.
I'm not sure this is really a bug so much as a specific weird case.

Run into the same issue using a dropdown widget:

Can't select "Two" from the list.
When selecting "Four" from the list, the button underneath the list registers a click.

@habics the issue with the dropdown is fixed in #376

@jrmoulton
Still the same issue unfortunately, here is the example that shows it:
use floem::reactive::{create_rw_signal, create_signal};
use strum::IntoEnumIterator;

use floem::view::View;
use floem::views::{h_stack, label, v_stack, Decorators};
use floem::widgets::dropdown::dropdown;
use floem::widgets::{button, checkbox};

fn main() {
    floem::launch(app_view);
}

fn app_view() -> impl View {
    let (counter, set_counter) = create_signal(0);
    let input_name = create_rw_signal("input".to_string());

    v_stack((
        dropdown_view(),
        checkbox_view(),
        input_text(input_name),
        label(move || format!("Value: {}", counter.get())),
        h_stack((
            button(|| "Increment").on_click_stop(move |_| {
                set_counter.update(|value| *value += 1);
            }),
            button(|| "Decrement").on_click_stop(move |_| {
                set_counter.update(|value| *value -= 1);
            }),
        )),
    ))
    .style(|s| s.padding(20.0))
    .style(|s| s.items_center())
    .style(|s| s.width_full())
    .style(|s| s.height_full())
}

pub fn input_text(buffer: floem::reactive::RwSignal<String>) -> impl View {
    floem::widgets::text_input(buffer)
}

#[derive(strum::EnumIter, Debug, PartialEq, Clone, Copy)]
enum Values {
    One,
    Two,
    Three,
    Four,
    Five,
}
impl std::fmt::Display for Values {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_fmt(format_args!("{:?}", self))
    }
}

pub fn dropdown_view() -> impl View {
    let show_dropdown = create_rw_signal(false);

    dropdown(
        move || Values::One,
        move |item| label(move || item).any(),
        Values::iter(),
        |item| label(move || item).any(),
    )
    .show_list(move || show_dropdown.get())
    .on_accept(move |_val| show_dropdown.set(false))
}

pub fn checkbox_view() -> impl View {
    let (is_checked, set_is_checked) = create_signal(true);
    checkbox(move || is_checked.get())
        .on_update(move |checked| {
            set_is_checked.set(checked);
        })
        .style(|s| s.margin(5.0))
}

@jrmoulton Now looking at this issue again, I feel like #379 might not be the right solution for it. on_click intercepts the PointerDown event bubbling by default actually caused an issue with dragging.
For @dominikwilkowski, it can be fixed by adding .on_event_stop(EventListener::PointerDown, |_| {}) on the label. The reason is that without stopping PointerDown bubbling from the label to the text_input, the text_input will make itself active and the next pointer events will only be sent to the text_input.
For @habics It's the same issue and it can be fixed by adding on_event_stop to the list in the dropdown widget.

Ok I checked this out and indeed this code works and fires the events:
use floem::{
    event::EventListener,
    reactive::create_rw_signal,
    style::Position,
    view::View,
    views::{container, label, stack, Decorators},
    widgets::text_input,
};

fn app_view() -> impl View {
    let value = create_rw_signal(String::from(""));
    stack((
        container(text_input(value)),
        label(move || "Label on top")
            .style(|s| {
                s.position(Position::Absolute)
                    .inset_top(8.5)
                    .inset_left(7)
                    .background(floem::peniko::Color::rgba8(255, 0, 0, 150))
            })
            .on_click_cont(|_| {
                println!("Click continue");
            })
            .on_click_stop(|_| {
                println!("Click stop");
            })
            .on_event_stop(EventListener::PointerDown, |_| {}),
    ))
    .style(|s| {
        s.position(Position::Relative)
            .margin(10)
            .height(30)
            .items_center()
            .justify_center()
    })
}

fn main() {
    floem::launch(app_view);
}

I don't see how that makes sense though. Why am I adding an on_event_stop event onto the label to make the other events work? That's neither obvious nor intuitive and I can't see any docs about this. Still feels like a bug or something we should fix @dzhou121

I also feel that simply reverting isn't a sufficient fix.

Maybe the simplest fix would be to have on-click require eventpropagation specifically for the pointer down.

If you put on_click on top of another on_click, it works as intended that only the top on_click will fire.
The actual issue here is the text_input makes itself active when receiving PointerDown. So a fix would be only making it active after it starts to drag.

authors: dominikwilkowski dzhou121 habics jrmoulton

repo: lapce/floem


text:
使用圖片插入 要怎麼修改上傳路徑?

使用圖片插入 要怎麼修改上傳路徑?

I have made a PR to make upload image easier. #15

repo: laravel-admin-extensions/summernote


text:
Added Spanish Language

Added first part of Spanish language translations.

Hi,
I will merge this once you will complete the process of adding the new language.
For more info about this read this section of the docs.
Thank you for this!

@1988114 ?

Hello @aocneanu, I Will complete the process today so you can check the pull request.

@1988114 please read my comment from above

Got it mate, will re-submit the full pull request next month, I’ll close this one for now.

repo: laravel-enso/Localisation


text:
FileSessionHandler tries to read non-existing session file

Laravel Version: 5.4.15
PHP Version: 7.0.16
Database Driver & Version: MySQL PDO

Description:
As described earlier here: https://github.com/laravel/framework/issues/18258
I have updated Laravel and PHP but the issue persists.
[2017-03-09 15:44:55] local.ERROR: exception 'ErrorException' with message 'fopen(/myapp/storage/framework/sessions/DsYiDF6umqNGGxAVyXIxWCHy9KqaT1H1nIFNlgfH): failed to open stream: No such file or directory' in /myapp/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:54
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'fopen(/myapp...', '/myapp...', 54, Array)
#1 /myapp/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(54): fopen('/myapp...', 'rb')
#2 /myapp/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(38): Illuminate\Filesystem\Filesystem->sharedGet('/myapp...')
#3 /myapp/vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php(71): Illuminate\Filesystem\Filesystem->get('/myapp...', true)
#4 /myapp/vendor/laravel/framework/src/Illuminate/Session/Store.php(96): Illuminate\Session\FileSessionHandler->read('DsYiDF6umqNGGxA...')
#5 /myapp/vendor/laravel/framework/src/Illuminate/Session/Store.php(86): Illuminate\Session\Store->readFromHandler()
#6 /myapp/vendor/laravel/framework/src/Illuminate/Session/Store.php(70): Illuminate\Session\Store->loadSession()
#7 /myapp/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(103): Illuminate\Session\Store->start()
#8 /myapp/vendor/laravel/framework/src/Illuminate/Support/helpers.php(878): Illuminate\Session\Middleware\StartSession->Illuminate\Session\Middleware\{closure}(Object(Illuminate\Session\Store))
#9 /myapp/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(104): tap(Object(Illuminate\Session\Store), Object(Closure))
#10 /myapp/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(58): Illuminate\Session\Middleware\StartSession->startSession(Object(Illuminate\Http\Request))
#11 /myapp/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#12 /myapp/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#13 /myapp/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#14 /myapp/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#15 /myapp/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#16 /myapp/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#17 /myapp/vendor/laravel/framework/src/Illuminate/Routing/Router.php(561): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#18 /myapp/vendor/laravel/framework/src/Illuminate/Routing/Router.php(520): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#19 /myapp/vendor/laravel/framework/src/Illuminate/Routing/Router.php(498): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#20 /myapp/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(174): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#21 /myapp/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#22 /myapp/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#23 /myapp/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#24 /myapp/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#25 /myapp/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#26 /myapp/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(149): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#27 /myapp/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#28 /myapp/public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#29 {main}

Steps To Reproduce:
Seems to happen at random for all requests in the application.

Again, Please ask on the forums :) You'll need to include more details about your setup so people can help, using load balancers? What's the OS? etc...

I'm sorry but really these type of issues that happen "randomly" aren't considered as bugs in the framework, there could be several reasons for why they happen and it's nearly impossible for the contributors to find out what's wrong in your environment.

authors: Yorannn themsaid

repo: laravel/framework


text:
UploadedFile not working with store method from the request's uploaded file

Laravel Version: 5.4.17
PHP Version: 7.1.12

Description:
Storage fake doesn't work when uploading files from the request.
$request->file('avatar')->store('avatars');
Steps To Reproduce:
my controller:
    ....
    $request->file('avatar')->store('avatars');
    ....

My test
Storage::fake('avatars');
$user = factory(\App\User::class)->create();

$response = $this->actingAs($user)
                            ->post('/api/users', [
                                'name' => 'John Doe',
                                'avatar' => UploadedFile::fake()->image('john-doe.jpg'),
                             ]);

$response->assertStatus(201);
Storage::disk('avatars')->assertExists('john-doe.jpg');

I have the same issue.
Basically, the controller will store the file in your default disk ('local'). However, your test is testing against the fake disk ('avatars').
If you check your default disk, you should see the image presents.
There should be a way to set the default desk for the testing environment to the fake storage.

try this:
https://laracasts.com/discuss/channels/testing/changing-default-disk-for-testing/replies/331158

Thanks @alhoqbani. I think it's a good idea to open a PR to laravel/laravel with this solution, but I don't know if @taylorotwell or other core member have another solution.

You can use Storage::disk('local')->assertExists('john-doe.jpg') if you store the image in the local disk in the controller, also store() saves the file using a generated hashname not the actual name of the uploaded file, that will cause your tests to fail too.

That's a possible soultion, but it will leave the fake file on the local disk. Unless, you delete them after each test the disk will be full of fake files.

Next time the tests are run the directory will be cleaned and all files will be removed.

I'm using the storeAs method

Then all what you need to do is to fake the local driver since you store the avatars on it.
Closing since it's not a bug, since you store the file on local driver you need to look for it on your local driver :)

So there is no use case for Storage::fake('fake-local');, right?

The only use case for Storage::fake('test-disk-name') that I can see is cleaning up the test disk directory when the test is run next time. It doesn't change the filesystem driver on-the-fly. So this env tag needs to be added in phpunit.xml: <env name="FILESYSTEM_DRIVER" value="test-disk-name"/>

i think it's no mistake. the files are being stored (at least at v6 and 7) outside in the /storage/xyz directory which is identical to the one you specified! you have to make a link between a folder in public/storage or /public/upload or however you call it and it's counterpart under /storage/xyz

I got the same issue, with Storage::fake the file keeps in the directory, I'd like to know if there's a way to clean up the directory after each test

authors: Iguet alhoqbani caiquecastro mtanmay oliiix themsaid


text:
i have problem like you although i had rename const but it dont work for me, i can not understand why

Laravel Version: #.#.#
PHP Version:
Database Driver & Version:

Description:
Steps To Reproduce:

Hi there,
Welcome to Laravel and we are glad to have you as part of the community.
Unfortunately this GitHub area is not a support area for general application issues. This is only for issues/bugs with the framework code itself.
Can I suggest closing your issue ticket here? Instead try asking your question on one of the many great community support areas that will likely give you a better answer more quickly:

Laravel Slack (https://larachat.co/)
Laravel.io Forum (https://laravel.io/forum)
Laracasts Forum (https://laracasts.com/discuss)
StackOverflow (http://stackoverflow.com/questions/tagged/laravel)

Thanks in advance.


text:
Schema name not working  in MSSQL

Laravel Version: 5.4.36
PHP Version: 7.2.6
Database Driver & Version:72

hi , my laravel project connect to SQL server database
i have a big problem in my SQL server i have a different schema like  Base.Auth.personType Base.Auth is the name of my schema and personType name of my table
in migration file i write this codes
 Schema::create("Base.Automation.personType", function (Blueprint $table) {
            $table->increments('id');
            $table->char('Title',500);
            $table->boolean('IsDelete');

        });

but laravel give me error   SQLSTATE[42000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Database 'Base' does not exist.

As described on this microsoft forum about the SQL server in the first answer:
Embedded spaces or special characters are not allowed.
Supplementary characters are not allowed.
Table names like T@ble or _#1@_cu$tomer$ are allowed but my.table is not.


text:
Laravel 5.7.9 needs php 7.3 ? - Php AST Parse error

Laravel Version: 5.7.9
PHP Version:  7.1.22-1

Description:
IT seems that the new release needs PHP 7.3
This syntax : [$ability, $arguments] = $this->parseAbilityAndArguments($ability, $arguments);
From : Illuminate\Foundation\Auth\Access\AuthorizesRequests
generate an AST Parse Error on my side.

Generating autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
@php artisan package:discover
In ParseToAstFailure.php line 25:
AST failed to parse in located source (in /var/www/jobmaker/vendor/laravel/
framework/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php)
In ParserAbstract.php line 280:
Syntax error, unexpected '=' on line 22`

Steps To Reproduce:
Update your composer.json file with Laravel 5.7.9
and update your dependencies : composer update / install

Thus is a php 7.1 feature which is required for Laravel 5.7.
See http://php.net/manual/en/migration71.new-features.php

What result do you get when run php -v on the command line?

@moderndevelopment Yes, you right, I've just see it, but have you an idea why it doesn' work for me. I use php 7.1.22-1

PHP 7.1.22-1+0 20181001133718.6+stretch 1.gbp113f3b (cli) (built: Oct  1 2018 13:37:19) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.22-1+0~20181001133718.6+stretch~1.gbp113f3b, Copyright (c) 1999-2018, by Zend Technologies

After a little test made directly with a little file and cli, as expected this syntax works perfectly with my php version (7.1.22). I have to study why it doesn't work with / inside my apache.
Thanks all, I will close this issue and reopen it or create a new one if necessary after investigation.

For information : my bad. An old dependency....


text:
Request methods saying return string.

https://github.com/laravel/framework/blob/5.0/src/Illuminate/Http/Request.php#L503
The method above
/**
 * Retrieve a parameter item from a given source.
 *
 * @param  string  $source
 * @param  string  $key
 * @param  mixed   $default
 * @return string
*/

Supposed to return a string, but it could return an array.
Subsequently anything using that method also has it wrong as well i.e.
https://github.com/laravel/framework/blob/5.0/src/Illuminate/Http/Request.php#L340
/**
 * Retrieve a query string item from the request.
 *
 * @param  string  $key
 * @param  mixed   $default
 * @return string
*/

We're open to pull requests. :)

authors: GrahamCampbell Sladewill


text:
[5.1] Fix improper use of mb_substr()

Follow-up to #10894.
Because strpos($path, '?') is single-byte, the subsequent substr() have to be single-byte as well.

url('ééé/ààà?ùùù', 'extra');

http://example.org/ééé/ààà/extra?ùùù – expected

http://example.org/ééé/ààà?ùùù/extra – result

url('ééé?ààà?ùùù', 'extra');

http://example.org/ééé/extra?ààà?ùùù – expected

http://example.org/ééé?àà/extraà?ùùù – result

ping @rkgrep :)

In case you would be interested, the following implementation is about 60% faster (10000 iterations: from 148 ms to 61 ms), and imho clearer:
$parts = explode('?', $path, 2);
if (isset($parts[1])) {
    $path = $parts[0];
    $query = '?'.$parts[1];
} else {
    $query = '';
}


text:
[6.x] Allow Broadcast Authorization Callbacks To Accept "Guests"

This PR allows Broadcast channels authorization callbacks to define "guest users", based on how Gates do, since #24576.
This implements Idea #1227, with the checking methods pretty much copied from the ones currently used by Gate.
At the moment, both the PusherBroadcaster and RedisBroadcaster throw AccessDeniedHttpException when retrieveUser() returns null, during private channels authorizations, before executing the user-defined authorization callback:
if ($this->isGuardedChannel($request->channel_name) &&
    ! $this->retrieveUser($request, $channelName)) {
    throw new AccessDeniedHttpException;
}

Therefore, it is impossible to use private channels with authentication methods that are not tied to a User, like Passport's Client Credentials Grant, that is used for machine-to-machine communication, as pointed out in Passport issue #1166.
Also, I imagine that the current check is in place to prevent the $user variable from being null in the authorization callback. However, if this code was executed when subscribing to a public channel, the isGuardedChannel() method would return false, and the $user variable could be passed with a null value to the authorization callback. I believe this doesn't happen because no HTTP request is made when subscribing to a public channel.
But with the methods from the Gate guest user authorization, this depends on how the callback is defined, and a null $user will only be allowed when an optional type-hint or a null default value is defined:
protected function parameterAllowsGuests($parameter)
{
    return ($parameter->getClass() && $parameter->allowsNull()) ||
           ($parameter->isDefaultValueAvailable() && is_null($parameter->getDefaultValue()));
}

Heya, 6.x is now closed for new features. Please send this to 7.x, thanks!

Sorry, I misunderstood the contribution docs. Opened new PR #31767

The contribution docs say to only send bug fixes to 6.x, new features to 7.x, and breaking stuff to master. ;)

authors: GrahamCampbell driesvints matheusb-comp


text:
[9.x] Validates the route domain (host) that contains port

Right now, if we have port in the domain, Laravel not correctly handle it.
Route::get('/foo/bar')
    ->name('foo')
    ->domain('localhost:8000')
    ->uses(function () {
        return 'hi';
    });

If we try to access that route http://localhost:8000/foo/bar, it would fail.

If we try to generate named route from it, it will give you weird result http://localhost:8000:8000/foo/bar.

Proposed solution:

HostValidator must validate the domain against $request->getHttpHost(), not just $request->getHost().

Add action route named wildcard_port (used only when we need to strict the port). If wildcard_port is true (default), it just same as before, if false the RouteUrlGenerator will not append port to the domain.

For me, I've found this use case when building multi tenant application, that using artisan serve in local.
Somehow, I need to separate the tenant route to the different domain (that uses port).

I think this will break some part of the framework. For example this code:
https://github.com/laravel/framework/blob/master/src/Illuminate/Routing/RouteUrlGenerator.php#L161
Since the tests is passed, so I guessed that this will be fine at first. But, I think I'm wrong. Still searching the effect from this PR.

After searching for functionality that may be broken because of this, I've come with a conclusion that there is nothing broken.
We can safely remove the addPortToDomain, since it's may be not necessary. We can just give a note that route domain with non standard port must be passed with the port.

Thanks for your pull request to Laravel!
Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.
If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions!
If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response.

Hi @nmfzone , I have the same issue as you described in this PR. I need to use Route::domain('1.2.3.4') and Route::domain('1.2.3.4:8080') to identify different entrances and assign the requests to different route files. However, it seems Route::domain() is not support partterns like domain:port in Laravel 6.x. Is there any way to patch it and make it works like what you did in this PR?
Thanks in advance.

@Billtec Right now I only can give you a clue.

Extend the Illuminate\Routing\UrlGenerator and Illuminate\Routing\RouteUrlGenerator, then look at this PR.
Re-register the shared binding for url to the IoC

$this->app->singleton('url', function ($app) {
    $routes = $app['router']->getRoutes();

    $app->instance('routes', $routes);

    return new UrlGenerator(
        $routes,
        $app->rebinding(
            'request',
            function ($app, $request) {
                $app['url']->setRequest($request);
            }
        ),
        $app['config']['app.asset_url']
    );
});

Extend Illuminate\Routing\Matching\HostValidator like this PR
Register your Host validator to the route validators

Route::$validators = [
    new \Illuminate\Routing\Matching\UriValidator,
    new \Illuminate\Routing\Matching\MethodValidator,
    new \Illuminate\Routing\Matching\SchemeValidator,
    new \App\Routing\Matching\HostValidator
];

authors: Billtec nmfzone taylorotwell


text:
[8.x] Avoid using FQCN in tests.

This PR ensure that FQCN are avoided in /tests.

is this just for consistency, or are there other benefits?

is this just for consistency, or are there other benefits?

Consistency of course - but also readability! You already have an idea of some things happening in the class, just by looking at the imports 😀


text:
[8.x] Include Custom Notification Stubs

Notification stubs were not included as part of stub:publish command.

See other closed PRs about needing to update the stubs themselves.

ah of course!

authors: bogdankharchenko taylorotwell


text:
Add route whereIn regex registration method

This PR adds a whereIn regex registration method to check if the route parameters are contained within a given array.
Usage example:
Route::get('statuses/{type}')->whereIn('type', ['one', 'two', 'three']);

This will make sure type is equal to one of the values in the array.

Implemented in https://github.com/laravel/framework/pull/41794

authors: emargareten lazer-hybiz


text:
[8.x] Add explicit return null in non-void methods

https://github.com/laravel/framework/issues/39211

return; already returns null.

@driesvints technically true, but in reality the IDE and static analysis tools complain about it. I would expect Laravel to improve the developer experience if able.

Okay, I'll re-open this for Taylor to review.

This would mean a lot of methods changing in Laravel and I'm not sure I want to take that on at the moment. Will consider it though in the future.

authors: driesvints kilya11 spawnia taylorotwell


text:
[9.x] Use model route key when route parameter does not specifiy custom binding field but a different parameter does

Note: I'm unsure to which branch I should send this bugfix since the implementation of RouteUri has changed between 8.x and 9.x. 9.x uses str_contains instead of strpos. I might have to send two separate PRs to each respective branch? Help? 😅
Summary
This PR fixes a special circumstance where the wrong model route key would get used when substituting route parameters. For a tl;dr of what the bug is, check out the test I added to RoutingUrlGeneratorTest.php that reproduces the error. For the longer explanation, keep reading.
Reproducing the bug
Let's say I have two models, User and Post. The User model overrides the getRouteKeyName method so the user's username field gets used during route generation instead of the id. The Post model is kept vanilla.
class User extends Model
{
    public function getRouteKeyName()
    {
        return 'username';
    }
}

class Post extends Model
{
}

Now, let's define a route like this.
Route::get('/{user}/posts/{post:id}', UserPostsController::class)
    ->name('users.posts.show');

We specify an explicit binding field for the post so it gets scoped on the user. For the user, we don't specify an explicit binding key, so we expect it to use the username like we've configured. This works as expected if we generate the route url and pass the parameters as an associative array.
$user = new User(['username' => 'kai']);
$post = new Post(['id' => 5]);

route('users.posts.show', ['user' => $user, 'post' => $post], false);
// => /kai/posts/5

However, if we pass the parameters without explicit keys it breaks.
$user = new User(['username' => 'kai']);
$post = new Post(['id' => 5]);

route('users.posts.show', [$user, $post], false);
// => /1/posts/5

If we explicitly define the binding field for the user parameter as well, it works again as expected.
Route::get('/{user:username}/posts/{post:id}', UserPostsController::class)
    ->name('users.posts.show');

route('users.posts.show', [$user, $post], false);
// => /kai/posts/5

I have added a test to the RoutingUrlGeneratorTest file that reproduces this error.
Why the bug happens
When the RouteUri class parses the URI, it extracts all binding fields from the URI. This array then gets saved on the Route object's $bindingFields property. So our URI of
/{user}/posts/{post:id}

gets turned into
['post' => 'id']

So far so good, but note that the user parameter is missing since it doesn't define a an explicit binding field (no spoilers, but this is important).
When the UrlGenerator tries to resolve the route parameters, it loops of the parameters and calls the bindingFieldFor method of the Route object for each of them (https://github.com/laravel/framework/blob/9.x/src/Illuminate/Routing/UrlGenerator.php#L483).
This method is passed the key of the current parameter we're looping over. It then checks if that key is an integer, and if so, extracts the binding field from the route's bindingFields array by index.
// Routing/Route.php#536

public function bindingFieldFor($parameter)
{
    $fields = is_int($parameter) ? array_values($this->bindingFields) : $this->bindingFields;

    return $fields[$parameter] ?? null;
}

Going back to our route above, the bindingFields array currently looks like this.
['post' => 'id']

But since it's trying to look up the binding field by index, it ends doing this instead.
array_values(['post' => 'id'])
// => [0 => 'id']

Since user is the first parameter we passed to the route call, it tries to look up the binding field with index 0 in this array. Which is why the id field gets mistakenly used for the user parameter.
Also, at this point "binding fields" has stopped sounding like a word.
Changes
To fix this bug, I changed the parse method of the RouteUri class to keep track of all parameters, instead of only parameters with an explicit binding field. So when we first parse our URI, we get back this instead:
"/{user}/posts/{post:id}"

// turns into
['user' => null, 'post' => 'id']

Before returning, I check if this array contains any values that are not null, meaning we have at least one explicit binDinG fIeLd. In that case, we keep the whole array—including null values—so the index positions line up as expected when calling array_values on it. In any other case, we simply return an empty array (like before).
Other changes
I've refactored the tests for the RouteUri class to use a data provider instead of having all assertions in a single test. That made figuring out which test case actually broke quite a bit easier.

Thanks!

FYI: https://github.com/laravel/framework/pull/43255

Looks good. Sorry about all the issues this PR has caused 😞

@ksassnowski don't worry about it! :)

authors: driesvints ksassnowski taylorotwell