Problems with t_has_many

When I follow this pattern:
wheel_1 = Wheel.create
wheel_2 = Wheel.create
wheel_3 = Wheel.create
wheels = [wheel_1, wheel_2, wheel_3]
car.wheels = wheels
car.save

Tenacity doesn't update the car_id in wheels. And if I try to access car.wheels I just get an empty array.
Seems to work flawless with t_has_one.
I tried to use the auto_save option, but i reckon it's not for this purpose?
I also tried to manually specify the foreign_key, but that didn't help either.
This was tested with a single model and these gems:
mongo (1.4.0)
mongoid (2.2.4)

bson (1.4.0)
bson_ext (1.4.0)

mysql2 (0.3.10)
activerecord (3.1.1)

If I create car_id and add the association manually it does work. However it's not persisted.
I use devise for authentication and if I log out the car_id will be wiped from the wheel object. This might be a problem with devise or mongoid though?

It's strange though cause it's only the car_id that's wiped. Indicating that it is indeed a problem with Tenacity.

Hi.  I'm sorry, but I'm unable to reproduce this error.
My Gemfile
source 'http://rubygems.org'

gem 'rails', '3.1.1'

gem 'tenacity', '0.5.3'

gem 'mysql2', '0.3.10'

gem 'couchrest'
gem 'couchrest_extended_document'

gem 'mongo', '1.4.0'
gem 'mongoid', '2.2.4'
gem 'bson', '1.4.0'
gem 'bson_ext', '1.4.0'

With those dependencies, I am able to do the following in rails console:
[~/dev/personal/tenacity_rails3] $ rails console
Loading development environment (Rails 3.1.1)
ruby-1.8.7-p352 :001 > car = Car.create
  Wheel Load (0.3ms)  SELECT `wheels`.* FROM `wheels` WHERE (car_id = '4ecb9ffc904f562ced000001')
 => #<Car _id: 4ecb9ffc904f562ced000001, _type: nil>
ruby-1.8.7-p352 :002 > wheel_1 = Wheel.create
   (0.1ms)  BEGIN
  SQL (0.2ms)  INSERT INTO `wheels` (`car_id`, `created_at`, `updated_at`) VALUES (NULL, '2011-11-22 13:13:33', '2011-11-22 13:13:33')
   (0.5ms)  COMMIT
 => #<Wheel id: 4, car_id: nil, created_at: "2011-11-22 13:13:33", updated_at: "2011-11-22 13:13:33">
ruby-1.8.7-p352 :003 > wheel_2 = Wheel.create
   (0.1ms)  BEGIN
  SQL (0.1ms)  INSERT INTO `wheels` (`car_id`, `created_at`, `updated_at`) VALUES (NULL, '2011-11-22 13:13:33', '2011-11-22 13:13:33')
   (0.1ms)  COMMIT
 => #<Wheel id: 5, car_id: nil, created_at: "2011-11-22 13:13:33", updated_at: "2011-11-22 13:13:33">
ruby-1.8.7-p352 :004 > wheel_3 = Wheel.create
   (0.1ms)  BEGIN
  SQL (0.1ms)  INSERT INTO `wheels` (`car_id`, `created_at`, `updated_at`) VALUES (NULL, '2011-11-22 13:13:33', '2011-11-22 13:13:33')
   (0.2ms)  COMMIT
 => #<Wheel id: 6, car_id: nil, created_at: "2011-11-22 13:13:33", updated_at: "2011-11-22 13:13:33">
ruby-1.8.7-p352 :005 > wheels = [wheel_1, wheel_2, wheel_3]
 => [#<Wheel id: 4, car_id: nil, created_at: "2011-11-22 13:13:33", updated_at: "2011-11-22 13:13:33">, #<Wheel id: 5, car_id: nil, created_at: "2011-11-22 13:13:33", updated_at: "2011-11-22 13:13:33">, #<Wheel id: 6, car_id: nil, created_at: "2011-11-22 13:13:33", updated_at: "2011-11-22 13:13:33">]
ruby-1.8.7-p352 :006 > car.wheels = wheels
 => [#<Wheel id: 4, car_id: nil, created_at: "2011-11-22 13:13:33", updated_at: "2011-11-22 13:13:33">, #<Wheel id: 5, car_id: nil, created_at: "2011-11-22 13:13:33", updated_at: "2011-11-22 13:13:33">, #<Wheel id: 6, car_id: nil, created_at: "2011-11-22 13:13:33", updated_at: "2011-11-22 13:13:33">]
ruby-1.8.7-p352 :007 > car.save
  Wheel Load (0.2ms)  SELECT `wheels`.* FROM `wheels` WHERE (car_id = '4ecb9ffc904f562ced000001')
  Wheel Load (0.2ms)  SELECT `wheels`.* FROM `wheels` WHERE `wheels`.`id` = 4 LIMIT 1
   (0.1ms)  BEGIN
   (0.2ms)  UPDATE `wheels` SET `updated_at` = '2011-11-22 13:13:33', `car_id` = '4ecb9ffc904f562ced000001' WHERE `wheels`.`id` = 4
   (0.2ms)  COMMIT
  Wheel Load (0.2ms)  SELECT `wheels`.* FROM `wheels` WHERE `wheels`.`id` = 5 LIMIT 1
   (0.0ms)  BEGIN
   (0.1ms)  UPDATE `wheels` SET `updated_at` = '2011-11-22 13:13:33', `car_id` = '4ecb9ffc904f562ced000001' WHERE `wheels`.`id` = 5
   (0.2ms)  COMMIT
  Wheel Load (0.2ms)  SELECT `wheels`.* FROM `wheels` WHERE `wheels`.`id` = 6 LIMIT 1
   (0.0ms)  BEGIN
   (0.2ms)  UPDATE `wheels` SET `updated_at` = '2011-11-22 13:13:33', `car_id` = '4ecb9ffc904f562ced000001' WHERE `wheels`.`id` = 6
   (0.2ms)  COMMIT
 => true
ruby-1.8.7-p352 :008 > car
 => #<Car _id: 4ecb9ffc904f562ced000001, _type: nil>
ruby-1.8.7-p352 :009 > exit
[~/dev/personal/tenacity_rails3] $
[~/dev/personal/tenacity_rails3] $ rails console
Loading development environment (Rails 3.1.1)
ruby-1.8.7-p352 :001 >
ruby-1.8.7-p352 :002 >   car = Car.find "4ecb9ffc904f562ced000001"
 => #<Car _id: 4ecb9ffc904f562ced000001, _type: nil>
ruby-1.8.7-p352 :003 > car.wheels
   (0.3ms)  SELECT id FROM wheels WHERE car_id = '4ecb9ffc904f562ced000001'
  Wheel Load (0.2ms)  SELECT `wheels`.* FROM `wheels` WHERE (id in (4,5,6))
 => [#<Wheel id: 4, car_id: "4ecb9ffc904f562ced000001", created_at: "2011-11-22 13:13:33", updated_at: "2011-11-22 13:13:33">, #<Wheel id: 5, car_id: "4ecb9ffc904f562ced000001", created_at: "2011-11-22 13:13:33", updated_at: "2011-11-22 13:13:33">, #<Wheel id: 6, car_id: "4ecb9ffc904f562ced000001", created_at: "2011-11-22 13:13:33", updated_at: "2011-11-22 13:13:33">]
ruby-1.8.7-p352 :004 >

Can you explain what you mean by "this was tested with a single model"?
John

And, here are my classes:
class Car
  include Mongoid::Document
  include Tenacity

  t_has_many :wheels
  t_has_one :dashboard
end

class Wheel < ActiveRecord::Base
  include Tenacity

  t_belongs_to :car
end

What I mean with "this was tested with a single model" is that I didn't use STI or Polymorphic associations.
You are right, it does work that way.
I have the t_belongs_to call in the Mongoid model.
class Wheel
  include Mongoid::Document
  include Tenacity

  t_belongs_to :car
end

class Car < ActiveRecord::Base
  include Tenacity

  t_has_many :wheels
end

This works:
irb(main):022:0> car = Car.first
  Car Load (0.8ms)  SELECT `cars`.* FROM `cars` LIMIT 1
=> #<Car id: 1, name: "Ferrari">
irb(main):023:0> wheel_1 = Wheel.last
=> #<Wheel _id: 4ebe6a8d66eaa7e4aa000002, _type: nil, name: "Wheel1", car_id: nil>
irb(main):024:0> wheel_2 = Wheel.first
=> #<Wheel _id: 4ebba80866eaa75c7a000003, _type: nil, name: "Wheel2", car_id: nil>
irb(main):025:0> wheels = [wheel_1, wheel_2]
=> [#<Wheel _id: 4ebe6a8d66eaa7e4aa000002, _type: nil, name: "Wheel1", car_id: nil>, #<Wheel _id: 4ebba80866eaa75c7a000003, _type: nil, name: "Wheel2", car_id: nil>]
irb(main):026:0> car.wheels = wheels
=> [#<Wheel _id: 4ebe6a8d66eaa7e4aa000002, _type: nil, name: "Wheel1", car_id: nil>, #<Wheel _id: 4ebba80866eaa75c7a000003, _type: nil, name: "Wheel2", car_id: nil, slug: "haket">]
irb(main):027:0> car.save
   (0.2ms)  BEGIN
  Car Load (0.6ms)  SELECT `cars`.* FROM `cars` WHERE `cars`.`id` = 1 LIMIT 1
  Car Load (0.4ms)  SELECT `cars`.* FROM `cars` WHERE `cars`.`id` = 1 LIMIT 1
   (0.2ms)  COMMIT
=> true
irb(main):028:0>
irb(main):029:0> car.wheels
  User Load (0.5ms)  SELECT `cars`.* FROM `cars` LIMIT 1
=> [#<Wheel _id: 4ebba80866eaa75c7a000003, _type: nil, name: "Wheel1", car_id: 1>, #<Wheel _id: 4ebe6a8d66eaa7e4aa000002, _type: nil, name: "Wheel2", car_id: 1>]

This doesn't set the car_id:
irb(main):015:0> wheel = Wheel.create
=> #<Wheel _id: 4ecba73166eaa75371000002, _type: nil, name: nil, car_id: nil>
irb(main):016:0> car.wheels << wheel
=> [#<Wheel _id: 4ebe6a8d66eaa7e4aa000002, _type: nil, name: "Wheel1", car_id: 1>, #<Wheel _id: 4ebba80866eaa75c7a000003, _type: nil, name: "Wheel2", car_id: 1>, #<Wheel _id: 4ecba73166eaa75371000002, _type: nil, name: nil, car_id: nil>]
irb(main):017:0>

irb(main):017:0> car.save
   (0.2ms)  BEGIN
  User Load (0.6ms)  SELECT `cars`.* FROM `cars` WHERE `cars`.`id` = 1 LIMIT 1
  User Load (0.4ms)  SELECT `cars`.* FROM `cars` WHERE `cars`.`id` = 1 LIMIT 1
   (0.2ms)  ROLLBACK
Mongoid::Errors::DocumentNotFound: translation missing: sv_SE.mongoid.errors.messages.document_not_found
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/mongoid-2.2.4/lib/mongoid/document.rb:149:in `reload'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/tenacity-0.5.3/lib/tenacity/orm_ext/mongoid.rb:112:in `_t_reload'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/tenacity-0.5.3/lib/tenacity/associate_proxy.rb:52:in `method_missing'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/tenacity-0.5.3/lib/tenacity/associations/has_many.rb:142:in `block in establish_relationship_in_target_objects'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/tenacity-0.5.3/lib/tenacity/associates_proxy.rb:61:in `block in method_missing'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/tenacity-0.5.3/lib/tenacity/associates_proxy.rb:61:in `each'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/tenacity-0.5.3/lib/tenacity/associates_proxy.rb:61:in `method_missing'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/tenacity-0.5.3/lib/tenacity/associations/has_many.rb:141:in `establish_relationship_in_target_objects'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/tenacity-0.5.3/lib/tenacity/associations/has_many.rb:109:in `_t_save_associates'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/tenacity-0.5.3/lib/tenacity/orm_ext/activerecord.rb:90:in `block in _t_initialize_has_many_association'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:422:in `_run_save_callbacks'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/callbacks.rb:264:in `create_or_update'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/persistence.rb:37:in `save'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/validations.rb:50:in `save'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/attribute_methods/dirty.rb:22:in `save'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:241:in `block (2 levels) in save'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:208:in `transaction'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:241:in `block in save'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:252:in `rollback_active_record_state!'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:240:in `save'
	from (irb):17
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/commands/console.rb:45:in `start'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/commands/console.rb:8:in `start'
	from /Users/yeggeps/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/commands.rb:40:in `<top (required)>'
	from script/rails:6:in `require'
	from script/rails:6:in `<main>'irb(main):018:0>

In the proccess I discovered that associations to Devise models dissapear when I destroy a session and create a new one. Maybe I shall start a new ticket about that.
Thanks.

Sorry, I still cannot reproduce the error.
I changed my Wheel and Car models to look like what you have listed above.  I then tried to reproduce the error using the steps described.  In each case, car.wheels << wheel successfully added a wheel association to the car, and the car_id was set successfully.
Is there any way you can create a failing test case on a branch that I can take a look at?
John

I created a fresh project where << works without problems.
The problems I have is probably related to some other gem in combination with Tenacity. I would think it's Devise since all associations are destroyed on session destroy / session create.

If you can identify which gem is causing the issue, I could look at that gem's source and try to identify the conflict.

Closing for now.  Feel free to re-open if you identify the gem that is causing the conflict.


Better handling for GitVersion failure cases

GitVersion was failing for our builds this week, but the reason was a mystery until we were able to dig into the GitVersion log file on a failed build. What made this really difficult is the actual error was masked by the GitVersionRunner.
The error according to Cake was Expecting state 'Element'.. Encountered 'Text'  with name '', namespace ''. This is accurate because the DataContactJsonSerializer is failing to deserialise what is actually an error message from gitversion.exe. However, it is ultimately misleading since the actual error message is masked by this exception.
We changed our process to call GitVersion twice:

Run GitVersion with OutputType = GitVersionOutput.BuildServer so it logs to stdout, including any error messages
Run GitVersion with OutputType = GitVersionOutput.Json to get the deserialised version information

This PR proposes a similar approach, but within the GitVersionRunner itself so others fall into the pit of success. It appears the intent of the code was to run GitVersion twice, but the deserialization exception prevents the intended behaviour.
Hope this helps!

@michaelnoonan this should improve slightly now that PR https://github.com/GitTools/GitVersion/pull/2161 has merged and released in GitVersion 5.2.1.
I certainly wouldn't want to call GitVersion twice, especially with noisy build server log output.
I was going to submit a followup PR to Cake that scrapes the ERROR line from the GitVersion when the process exits with non-zero exit code. This would show the relevant error without needing to increase Cake build verbosity or use any other tricks.

Cool. I'm happy to leave this with you since it's a concrete example of where we ran into trouble. Calling gitversion twice is not terribly appealing, even though it will likely hit the gitversion caches and be reasonably fast.

@michaelnoonan apologies for not getting back to you sooner about this PR.  Was there an issue opened for the work in this PR?  Our contributing guidelines mention that an issue should be created first.

@michaelnoonan thanks for your contribution 👍
I'm going a head and going to close this PR as it should be fixed by #2741, which should be released in Cake 0.38.0.


ng-add schematic

The user should be able to add @jscutlery/semver in a workspace using a schematic.

install the package
ask options (remote, branch, push and syncVersions)
update the workspace.json or angular.json accordingly

Depending on the answer to syncVersions, we should apply the version builder to all projects (one by one) or the whole workspace.

    "workspace": {
      "root": "",
      "architect": {
        "version": {
          ...
        }
      }
    },

⚠ We should also add the workspace project to nx.json if it does not exist.


Add documentation and changelog links on PyPI

Problem
Fast access to docs and changelog.
Solution
These appear on the sidebar and provide neat, somewhat standard shortcuts to useful places. cf. scout-apm , as defined in https://github.com/scoutapp/scout_apm_python/blob/631f2432f643d256ad5ab7ff6b8f7b95b14231f5/setup.py#L44
Acceptance Criteria
Ran python setup.py check.

Coverage decreased (-0.05%) to 96.682% when pulling d544648c977aefec8fd7ce5c44eba12ab8975f5c on adamchainz:project_urls into 6adeee3fed7b901c116629c99a6eae9649b4b498 on django-import-export:master.


remove openssl from Qt5

Issues

#46

Summary
I just removed the flag -openssl from the configure flags for Qt5.

I'm not sure why this would be an issue now - we are getting openssl from externpro - on the windows build we had to do some extra stuff to make sure it found it (as seen here: https://github.com/distributePro/ovsrpro/blob/master/projects/qt5.cmake#L143-L149 )  but on linux, if I remember right, it was always covered by the include in the cmake use file for qt (here: https://github.com/distributePro/ovsrpro/blob/master/projects/use/useop-qt5-config.cmake#L2).  Does your build of extenrpro have the ssl libraries or did it possibly not build correctly or something? Maybe we need to update the use file or add some additional library paths, like we did for the windows build of Qt?
If we don't think we'll need the openssl stuff then that's fine, but there's some additional cleanup that could be done.

Remove the openssl stuff from the useop-qt5 file here: https://github.com/distributePro/ovsrpro/blob/master/projects/use/useop-qt5-config.cmake#L1-L3.
Also should remove the openssl mentions from the qt5.cmake file here: https://github.com/distributePro/ovsrpro/blob/master/projects/qt5.cmake#L7 and here: https://github.com/distributePro/ovsrpro/blob/master/projects/qt5.cmake#L143-L149

Now that I think about it some more - could this be a problem related to changes we made to move to the latest externpro? Maybe we missed making the appropriate mods in the qt5.cmake and useop-qt5 files to appropriately pull out/expose the openssl libraries?

Maybe we should add a warning here: https://github.com/distributePro/ovsrpro/blob/master/projects/use/useop-qt5-config.cmake#L1-L3 and make sure the openssl libraries are still being found?


Seattle, WA

Please add us! We’ve and a lot of police brutality during these times.

Unfortunately this request does not meet our base criteria so we will have to close it. Please submit a new request with the following information and we will process it:

A subject message for the email
A list of emails (at least one) for the government officials you’d like to receive the message
A detailed message concerning the budgeting decisions that are at stake in your community
See our current links for examples at https://defund12.org.

Thank you!!


use fan_mode_map instead of mode_map for thermostat_fan_mode command class

With the current behavior for thermostat/climate devices values received from HASS for fan modes are translated using the mode_map. However, the mode_map only maps modes for the hvac mode, not the fan mode.
This change makes it so the fan mode command class will map its values against the fan_mode_map instead of the mode_map.

LGTM


variant: Implement Value traits manually

This is not a boxed type and we have to use specific functions for
storing/retrieving from a Value

CC @jsparber

👍

@sdroege Thanks for noticing this, 👍


Wrong schematics

https://raw.githubusercontent.com/luni64/EncPlex/master/extras/Boards/MPX_4067/Schematic_part.jpg
In this pic, "EN" is connected to VCC and GND.
(i'm sorry, i don't know how to use Github :/ )

That's true indeed, I checked the breadboard setup which I happen to have in front of me, which connects /EN to VCC as it should be.

(i'm sorry, i don't know how to use Github :/ )

Nothing you can do from your side here. I'll update the schematic.

Fixed

I'm currently waiting for some  boards from china. As soon as I have them I'll continue work on the library. At the moment it is working but not yet complete...

I'll wait for news I guess! I'd wish to use your library to mux 6 encoders with switches on a Teensy 4.0. Did I miss your email address somewhere to continue this chat in private? Also I didn't find anything about your library in the pjrc forum, but I guess because it's a new project.

Also, in the same pic the encoder pin C, it's connected like B should be connected. This could be a labeling mismatch between me and you, but I've seen the "A" and "B" contact as side contacts and "C" as central.


custom chain names

Allows the ability add a custom source chain name (so it can say Ethereum instead of Axelar)

What about something like "Ethereum via Gravity Bridge" for non-canonical bridged tokens? or is that just too long?

I tried "Ethereum via Axelar" but it was too long and looked awkward.  But maybe its okay for the non-canonical ones on Frontier

My rationale is that Tony is probably going to introduce some standard type-enforced keys for what bridge and what chain an IBC asset originates.

What does this mean?  We should be preparing to support more deposit/withdrawal methods for different assets instead of locking them in?  (Like the UIs @victortokaito has been working on for choosing which chain to withdraw to).  Also, this seems somewhat orthogonal to just having a specific display name for a chain?

I'm going to merge this sooner.  And then we can revert it once the larger native bridge integration is ready, and there's an alternative way we want to do this.  But for now, showing everything as Axelar, is not great UX, when really the UX flow is coming from Ethereum and the like


Tile not found - pmtiles file, I know the tiles exist

I've been digging through the code trying to figure out what's going on with this, but I've hit the limits of my Rust skills, which are approximately none.
I have a PMTiles file (~200mb) that I converted from a MBTiles file using go-pmtiles. If I look at it with the pmtiles preview tool, works fine. I server it with go-pmtiles, works fine. I consume it with the PMTiles client-side JS library in MapLibre GL, works fine. I try serving it with martin, and with every request I get tile not found, ex:
Tile 7/35/50 not found in tiles-pmtiles

I tried turning debuggin on, and it doesn't say much more (at least to my stupid eyes):
[2023-05-24T21:45:17Z ERROR martin::srv::server] Tile 7/35/50 not found in tiles-pmtiles
[2023-05-24T21:45:17Z DEBUG actix_web::middleware::logger] Error in response: "Tile 7/35/50 not found in tiles-pmtiles"
[2023-05-24T21:45:17Z INFO  actix_web::middleware::logger] <IP_ADDRESS> "GET /tiles-pmtiles/7/35/50 HTTP/1.1" 500 39 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/<IP_ADDRESS> Safari/537.36" 0.000065
[2023-05-24T21:45:18Z DEBUG actix_web::middleware::logger] Error in response: "Source service-worker.js does not exist"
[2023-05-24T21:45:18Z INFO  actix_web::middleware::logger] <IP_ADDRESS> "GET /service-worker.js HTTP/1.1" 404 62 "http://localhost:3000/service-worker.js" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/<IP_ADDRESS> Safari/537.36" 0.000314

This happens on both Linux and Windows binary releases and on martin built from the latest source on Linux, so it doesn't appear to be a platform/build issue.
My guess is the ZXY isn't getting translated correctly via thePMTiles header info, which means this might be a bug in the pmtiles crate and not in martin itself. But my rust skills don't extend much past the swearing stage, so I could be totally wrong.

@tobinbradley i guess it will be mega-hard for me to debug it without the original data file. Do you think you somehow can make it much much smaller while still having the bug manifest itself?  This way we can add that tiny pmtiles file to the CI, and ensure that it passes all the tests.  BTW, this would be part of the https://crates.io/crates/pmtiles crate.

oh, silly me, you did post the pmtiles file!  I will try to play with it to see if i can reproduce the issue locally!

(but still - see if you can generate a tiny subset of it, ideally with just one tile)

Thank you so much! I set Cargo.toml to pmtiles = { version = "0.2.2"..., built martin and it finds the tiles perfectly!
I really appreciate you tracking this down in the pmtiles dependency. That's going above and beyond. To paraphrase Jon "maddog" Hall, you will never pay for a beer in my presence.
Tnanks again!


how create two synced picker side by side

I want to creat country picker with postal code and name of country. what can i do?
how can i use two picker side by side??

Hi!
Do you have an image to explain me what do you want exactly? Thanks!

I want to create like this, two row with different style for selected item:

Hi!
No, it is not possible to do that exactly with the library. But with the new version I have uploaded yesterday  - compile 'com.github.davidpizarro:pickerui:1.0.1' - you can use an alternative.
Now you can know when is showing PickerUI panel. See [#Changelog] (https://github.com/DavidPizarro/PickerUI/blob/master/CHANGELOG.md)
In addition PickerUI object can be assigned to multiple components simultaneously, each with a different ID. Example:

private static final int CITY_ID = 0;
private static final int POSTAL_ID = 1;

private PickerUI mPickerUI;

llCity.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
             mPickerUI.setItems(MainActivity.this, cities, CITY_ID, 0);
             if (!mPickerUI.isPanelShown())
                 mPickerUI.slide();
         }
      });

llPostal.setOnClickListener(new View.OnClickListener() {
         @Override
         public void onClick(View v) {
             mPickerUI.setItems(MainActivity.this, postals, POSTAL_ID, 0);
             if (!mPickerUI.isPanelShown())
                 mPickerUI.slide();
         }
     });

mPickerUI.setOnClickItemPickerUIListener(new PickerUI.PickerUIItemClickListener() {
            @Override
            public void onItemClickPickerUI(int ID, int position, String valueResult) {
                switch (which){
                    case CITY_ID:
                        tvCity.setText(valueResult);
                        break;

                    case POSTAL_ID:
                        tvPostal.setText(valueResult);
                        break;
                }
            }
        });

So you can get the next results:
![Example gif] (https://raw.githubusercontent.com/DavidPizarro/PickerUI/master/art/issue_2_3.gif)
You can download an example with this functionality [here] (http://www.davidpizarro.es/github/SomePickersUI.zip).
I hope that will be helpful!


Invoker not working correctly with rbenv

Here's the command given in the documentation that doesn't seem to be working:
command = RBENV_VERSION=2.0.0-p0 zsh -c "bundle exec rails s"

Here's my invoker ini file:
[rails4example]
directory = /Users/tchapin/Documents/dev/rails4example
port = 3001
command = RBENV_VERSION=2.0.0-p0 zsh -c "bundle exec rails s"

Here's what happens when I try to run invoker:
rails4example : Gemfile syntax error:
rails4example : /Users/tchapin/Documents/dev/rails4example/Gemfile:48: syntax error, unexpected ':', expecting kEND
rails4example :   gem 'sdoc', require: false
rails4example :

When I alter my invoker ini to run this command instead:
command = RBENV_VERSION=2.0.0-p0 zsh -c "ruby --version"

I get this result:
rails4example : ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]

It appears that invoker is launching the zsh instance in some sort of manner that is skipping all of the initialization and path settings in my ~/.zshrc file, and as a result, everything is being executed as if I don't even have rbenv installed and it's just trying to use the default ruby that's installed on OSX by default.
Any idea how to make this work correctly?

The suggestion by @gnuified doesn't work anymore. I have tried it and I'm still getting
login : Your Ruby version is 2.1.3, but your Gemfile specified 2.1.5
zsh 5.0.5 (x86_64-apple-darwin14.0)
rbenv 0.4.0-98-g13a474c

This worked:
command = RBENV_VERSION=2.1.5 bash -c 'rbenv exec bundle exec rails s'


build: update encodable dependency

🏠 Internal

Bump encodable to latest version which no longer has nested dependency to @superset-ui/color, @superset-ui/number-format and @superset-ui/time-format.
By default encodable ships with its own color and formatter registries. This PR add shims to point to the same registries that @superset-ui is using, so the specified formats and colorScheme from control panel can be correctly used.
(I may refactor @superset-ui later to share the underlying registries.)

scatter plot working

word cloud working

map working

There seems to be some issue with box plot. Investigating....

The issue is fixed and good to go.


Scroll canvas during connecting / moving

When dragging to the diagram borders, the canvas should scroll, allowing users to reach out of view areas of the canvas.
Gets fixed via #481.

Fixed via bpmn-js#481.


Documenation - add list of fastlane terminology

I think so far fastlane makes an excellent job of using good terminology for their APIs and documentations. But fastlane also uses several terms that could be understood or are understood differently in other projects. Maybe a list of words, on an extra page, could help a little to define how some terms are understood (differently) in the fastlane universe. Nothing long. But one sentence about what a term means for fastlane. No links, simple definitions.
Proposal for fastlane terminology list

action
extensions
deliver
produce
snapshot
codes
lanes
frames
...

Please feel free to extend/discuss this list to see if this request makes sense.

I agree. I'm currently not happy with the README, I think I'll move all available actions into its own .md file (as it's already the case at the deliver project)
When doing this refactoring, we should also add a documentation about those words.

I'll close this issue for now, I don't have plans to add this to the README right now, thanks for your feedback.


[Required] on non-nullable reference types has some weird differences from the actual Required attribute.

This is an opinion.
I feel like once you know you will get a [Required] attribute on your non-nullable reference types, unless disabled by services.AddControllers(options => options.SuppressImplicitRequiredAttributeForNonNullableReferenceTypes = true);, you expect as a developer to get the full package of what [Required] has to offer.
Currently, [Required] not only checks if a field is null, but it also checks if the type is string - to not be an empty string, or string filled with only white spaces. But, it seems [Required] is only applied in the following situations for non-nullable reference types (Accentuations are mine):

If the app was built with enable, a missing value for Name in a JSON or form post results in a validation error. Use a nullable reference type to allow null or missing values to be specified for the Name property: (source)

But then when you explicitly define a null value to a non-nullable field in a JSON payload, you still get an error, unless "missing value" here refers to strictly missing "any value other than null", and not what [Required] is supposed to do.
These ambiguities are really confusing:

Is [Required] applied to any non-nullable reference type? If yes: Why is the behavior entirely different from the actual [Required] attribute? For example, If you define an empty string to a non-nullable string, no error occurs, and yet if you really had the [Required] attribute on a string, you would get an error.

Is [Required] applied only to fields not explicitly given a value? If yes: Why then do we get an error when we explicitly define a null value to them?

I hope this made sense.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 0156ffc3-47ac-d5da-fbc2-9ff5018b071b
Version Independent ID: 615db388-a244-41f7-21b5-a4085d9ed479
Content: Model validation in ASP.NET Core MVC
Content Source: aspnetcore/mvc/models/validation.md
Product: aspnet-core
Technology: aspnetcore-mvc
GitHub Login: @Rick-Anderson
Microsoft Alias: riande

to not be an empty string, or string filled with only white spaces
Where does it say that?

to not be an empty string, or string filled with only white spaces
Where does it say that?

That is what [Required] does.

@serpent5  please review

The source shows that the AllowEmptyStrings property is set to true for the inferred [Required], as @SpiritBob suggests:
// Since this behavior specifically relates to non-null-ness, we will use the non-default
// option to tolerate empty/whitespace strings. empty/whitespace INPUT will still result in
// a validation error by default because we convert empty/whitespace strings to null
// unless you say otherwise.
requiredAttribute = new RequiredAttribute()
{
    AllowEmptyStrings = true,
};

attributes.Add(requiredAttribute);

I'm not sure what the comment means by "empty/whitespace INPUT", but I'll try and find some time over the next few days to dig into it a bit more.

The source shows that the AllowEmptyStrings property is set to true for the inferred [Required], as @SpiritBob suggests:
// Since this behavior specifically relates to non-null-ness, we will use the non-default
// option to tolerate empty/whitespace strings. empty/whitespace INPUT will still result in
// a validation error by default because we convert empty/whitespace strings to null
// unless you say otherwise.
requiredAttribute = new RequiredAttribute()
{
    AllowEmptyStrings = true,
};

attributes.Add(requiredAttribute);

I'm not sure what the comment means by "empty/whitespace INPUT", but I'll try and find some time over the next few days to dig into it a bit more.
I think it's talking about this logic (source):
// Already have a string. No further conversion required but handle ConvertEmptyStringToNull.
if (bindingContext.ModelMetadata.ConvertEmptyStringToNull && string.IsNullOrWhiteSpace(value))
{
    model = null;
}

From what I can see there, the standard non-JSON model-binding will convert such strings to null, but I don't see that the JSON input-formatter will do the same thing.

Perhaps it's referring to the following DataAnnotation attribute, or is this an entirely separate logic?
Personally, I've never had this encounter of ASP.NET Core automatically converting empty strings/strings filled with white-spaces to null.

@serpent5 I've gone ahead and created a PR that could somehow clear the ambiguity present in the documentation. If you've got any better ideas on how we can tackle this, please feel free to scream at me!


License Issue on Temporary Tables

I am trying to publish an extension with a table that I am not going to use in SQL Server, I am only using it as a temporary table.
In NAV those tables don't have to be in the customer license.
When I try to publish an App like that I get an error
It should be possible to publish that app. The NAV license will check at runtime if I use if in a legit way.
Publish-NAVApp : Your program license does not allow you to publish 'Rest Arguments'.
At line:1 char:1

Publish-NAVApp -ServerInstance 2018TST -Path "C:\Users\mark\ ...

  + CategoryInfo          : InvalidArgument: (Microsoft.Dynam...s.PublishNavApp:PublishNavApp) [Publish-NAVApp], InvalidOperationException
  + FullyQualifiedErrorId : Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.PublishNavApp

Any updates on this? It is very anoying that I need to switch licenses (from customer license to partner license) each time I publish my extension.

Allowing you to publish without license check would allow anyone to publish into your license range and run it with a customer license.
In C/SIDE you would also need the partner license to create those tables.

As a customer you can always import a FOB file you get from a partner, also if that FOB file contains tables outside your license. The situation now is that as a customer you can no longer import an extension with tables outside the license.
This is a bug, and a huge one, that needs to be resolved before this hits mainstream usage.
Extensions need to work the same way with the license as C/Side or better, not worse.

We have introduced the concept of runtime packages to allow a partner to send an .app file to a customer. The runtime package .app file can be imported using the customer license similar to the FOB.
There is a description of runtime packages in the blog
The runtime package is created running the Get-NavAppRuntimePackage cmdlet against the development server.

Esben, this is totally unacceptable. We need to be able to see our own code in the debugger. How can I escalate this? Or do I just need to wait until someone else hits this brick wall.  This is exactly why the debugger in the windows client is so amazing.
Why is Microsoft making licensing such a pain for customers who want to do some inhouse development. In C# I can make as many classes and pages as I want, in SQL server I can create as many tables as I want. But as soon as you wrap C# and SQL into NAV everything is limited.
I can work around this for now. Go ahead and close the case. I don't want to burn anymore energy into this topic.


fix: typo in supabase db dump description

What kind of change does this PR introduce?
A small typo fix in the command description.
What is the current behavior?
There is a typo.
What is the new behavior?
One less typo!

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
5 unchanged lines in 1 file lost coverage.
Overall coverage decreased (-0.04%) to 57.281%

Files with Coverage Reduction
New Missed Lines
%

internal/gen/keys/keys.go
5
12.31%

Totals

Change from base Build<PHONE_NUMBER>:
-0.04%

Covered Lines:
4740

Relevant Lines:
8275

💛  - Coveralls


Contributing doc: Remove obsolete instruction for toll banners

PR #334 introduced toll styling for all road classes, so this
instruction to add banners is no longer appropriate.

Are there any toll banners that need removal?

Nope, I removed them in #334.


Change modal border radius to 16px

Motivation / Description
The border radius of modals was not consistent with the designs (8px instead of 16px); this changes that
Changes introduced
Linear ticket (if any)
https://revenuecat.slack.com/archives/C05TUASTSG4/p1721591753803999
Additional comments

          1 Error

:no_entry_sign:
Label the PR using one of the change type labels

Label
Description

breaking
Changes that are breaking

build
Changes that affect the build system

ci
Changes to our CI configuration files and scripts

docs
Documentation only changes

feat
A new feature

fix
A bug fix

perf
A code change that improves performance

RevenueCatUI
A change to the RevenueCatUI library

refactor
A code change that neither fixes a bug nor adds a feature

style
Changes that don't affect the meaning of the code (white-space, formatting, missing semi-colons, etc

test
Adding missing tests or correcting existing tests

next_release
Preparing a new release

dependencies
Updating a dependency

phc_dependencies
Updating purchases-hybrid-common dependency

  Generated by :no_entry_sign: Danger


Pluralsight 403 forbidden

receiving a 403 forbidden, youtube-dl updated.
[debug] Command-line args: ['--verbose', '--username', 'PRIVATE', '--password', 'PRIVATE', 'https://app.pluralsight.com/library/courses/windows-server-administration-concepts-active-directory/', '-o', 'C:/Users/PRIVATE/Videos/Pluralsight/%(playlist)s/%(chapter_number)02d - %(chapter)s/%(playlist_index)02d - %(title)s.%(ext)s', '--sleep-interval', '35', '--max-sleep-interval', '120', '--sub-lang', 'en', '--sub-format', 'srt', '--write-sub'] [debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252 [debug] youtube-dl version 2021.12.17 [debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041 [debug] exe versions: none [debug] Proxy map: {} [pluralsight:course] windows-server-administration-concepts-active-directory: Downloading JSON metadata [download] Downloading playlist: Windows Server Administration Concepts: Active Directory [pluralsight:course] playlist Windows Server Administration Concepts: Active Directory: Collected 20 video ids (downloading 20 of them) [download] Downloading video 1 of 20 [pluralsight] Downloading login page ERROR: Unable to download webpage: HTTP Error 403: Forbidden (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.   File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\common.py", line 634, in _request_webpage   File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 2288, in urlopen   File "C:\Python\Python34\lib\urllib\request.py", line 470, in open   File "C:\Python\Python34\lib\urllib\request.py", line 580, in http_response   File "C:\Python\Python34\lib\urllib\request.py", line 508, in error   File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain   File "C:\Python\Python34\lib\urllib\request.py", line 588, in http_error_default

Duplicate of #29776.


[odin] create an sd card

The first try of just nixos-installing the configuration on a preped sd-card did not work. Since I don't have a screen to "debug" the issue, I'll have to resort to use a nix takeover technique. Basically, I'm thinking, use good old RaspiOS for the initial boot, install nix package manager / nixos scripts, create the configuration on the device and see what happens.

nix build .#nixosConfigurations.odin.config.system.build.sdImage


isolate XUL app installation

Travis builds are failing because https://github.com/nodejs/nodejs.org/issues/1191. I'll kick them once that upstream bug gets resolved.


Publish the package to the conda-forge channel

Could you publish the package to the conda-forge channel so that users can install the package via conda install blackdoc? Thanks.

see conda-forge/staged-recipes#12705

the staged recipe has been merged so we only have to wait until the feedstock was created and the packages are built, which hopefully is a automatic process.

the package is available now


Proposal: add LINK command to Dockerfile

It'll allow to keep connected containers in Dockerfile and run command will be clean

closing as duplicate of https://github.com/docker/docker/issues/5332


🛑 Your GraphQL Schema is using "@key" directive from an older version of the GraphQL Transformer. Visit https://docs.amplify.aws/cli/migration/transformer-migration/ to learn how to migrate your GraphQL schema.

Amplify CLI Version
12.10.0
Question
🛑 Your GraphQL Schema is using "@key" directive from an older version of the GraphQL Transformer. Visit https://docs.amplify.aws/cli/migration/transformer-migration/ to learn how to migrate your GraphQL schema.
i facing this error  when i updated schema
My schema is attached below
type User
@model
@auth(rules: [{ allow: owner, operations: [create, read, update, delete] }])
{
id: ID! @primaryKey
username: String!
email: String!
orders: [Order] @hasMany(indexName: "byUser")
car: Car @hasOne
}
type Car
@model
@auth(rules: [{ allow: owner, operations: [create, read, update, delete] }])
@key(name: "byUser", fields: ["userId"])
{
id: ID! @primaryKey
type: String!
latitude: Float
longitude: Float
heading: Float
isActive: Boolean
orders: [Order] @hasMany(indexName: "byCar")
userId: ID!
user: User @belongsTo(fields: ["userId"])
}
type Order
@model
@key(name: "byUser", fields: ["userId"])
@key(name: "byCar", fields: ["carId", "createdAt"])
@auth(rules: [{ allow: owner, operations: [create, read, update, delete] }])
{
id: ID! @primaryKey
createdAt: String!
type: String!
status: String
originLatitude: Float!
originLongitude: Float!
destLatitude: Float!
destLongitude: Float!
userId: ID!
user: User @belongsTo(fields: ["userId"])
carId: ID!
car: Car @belongsTo(fields: ["carId"])
}

Hey @20uon0073 👋, Thanks for raising this issue.we are working on reproducing the issue. Could you please run below command and send us the project identifier
amplify diagnose --send-report.
please refer here

using this command it generate folowing  Zip Files
report-1704181475409.zip

and this is My schema  @AnilMaktala
and i send You Report file above
`type User @model {
id: ID!
username: String!
email: String!
orders: [Order] @connection(keyName: "byUser", fields: ["id"])
car: Car @connection(fields: ["id"])
}
type Car @model
@key(name: "byUser", fields: ["userId"]) {
id: ID!
type: String!
latitude: Float,
longitude: Float,
heading: Float,
isActive: Boolean
orders: [Order] @connection(keyName: "byCar", fields: ["id"])
userId: ID!
user: User @connection(fields: ["userId"])
}
type Order @model
@key(name: "byUser", fields: ["userId"])
@key(name: "byCar", fields: ["carId", "createdAt"]) {
id: ID!
createdAt: String!
type: String!
status: String,
originLatitude: Float!
oreiginLongitude: Float!
destLatitude: Float!
destLongitude: Float!
userId: ID!
user: User @connection(fields: ["userId"])
carId: ID!
car: Car @connection(fields: ["carId"])
}
type Subscription {
onOrderUpdated(id: ID!): Order @aws_subscribe(mutations: ["updateOrder"])
onCarUpdated(id: ID!): Car @aws_subscribe(mutations: ["updateCar"])
}`

Hi @20uon0073, can you check your feature flags in amplify/cli.json file and ensure the following ones have these defaults if you want to compile a project using V1 GraphQL transformers:
"useexperimentalpipelinedtransformer": false,
"transformerversion": 1,


Bump Ray TPU webhook image to v1.2.1

The v1.2.1 image contains a fix for inconsistent PodInformer updates resulting in incorrect TPU_WORKER_IDs for large TPU slice sizes.

cc: @andrewsykim


lfs.dir crashing after first iteration on x64 bit windows 10

.\luajit.exe -"e for path in require('lfs_ffi').dir('.') do print(path) end print('?')"

Maybe x64 bit Windows 10 uses a different version of findnext?
https://github.com/spacewander/luafilesystem/blob/master/lfs_ffi.lua#L288
As a backend programmer, I don't have the Windows environment to test it.

@CapsAdmin
Does it only happens in Windows10?

@CapsAdmin
Does it only happens in Windows10?

I only have access to windows xp in a virtual machine, but that fails with something else.
luajit: .\lfs_ffi.lua:255: cannot resolve symbol '_findfirst32': The specified procedure could not be found.

stack traceback:
        [C]: in function '__index'
        .\lfs_ffi.lua:255: in main chunk
        [C]: in function 'require'
        (command line):1: in main chunk
        [C]: at 0x004020f0

Could you try with https://github.com/sonoro1234/luafilesystem (unicode branch which is my default branch)

you can switch unicode on/off with
lfs = require"lfs_ffi"
lfs.unicode = true|false
default is on

@sonoro1234
Maybe I should mention that people should use your fork in Windows.
For example, throw an error with your repo's URL when Windows is detected.
Since I don't a Windows environment to test/maintain the features.

It is ok for me.
I can test also linux now.

@sonoro1234
Done via https://github.com/spacewander/luafilesystem/commit/8ea5dda5460bd82d284fdbb0664a016cc7cde68b

Don't support Windows anymore.

Althought, ideal situation would be having only one lua file for all systems.
I am using lfs_ffi.lua in linux also but as yours and mine are getting different structure it is difficult to incorporate your changes into my repo!!!


Can we extend from an .env file

I have 2 environments, named alphaDev a bugsnagkey, and betaDev with another bugsnag api. But two of them use the same api endpoint configuration.
Can we create a parent env file than extends from it?

I closes due to duplicate with #89


Shouldn’t versions/latest match versions/1.10.0?

Currently, in 90cd4cb494ff36a76dbf97d2d0deab4f970b17c5, we have versions/1.10.0, but versions/latest corresponds to versions/1.9.0. Is that an oversight? Am I missing anything?

THANK YOU for the report... it is not yet fully automated, let me try to cook up a quick CI workflow for this...

Thanks for investigating!

actually I originally misunderstood the concern here, now fixed properly in code in

0c4ec20522919bbf4e474e9d37dbd1b53dd2d102
and then 6214096f04e657649f0c1a57088a1c862fe7a02d to actually get that copy... testing automated cron job now to get master updated automagically etc...


open_basedir restriction in effect

Hello, I use latest version dev in production hosting and in the last update this error show first time and with refreshing the page every thing is OK.
This work without error in local, Error just occur in hosting.
This line generate error:
file_exists('/dev/urandom')
when because open_basedir is not allowed this error shows. I think because file_exists() we should to check open_basedir is enable or not to prevent from warning message.
09:36:34 [<IP_ADDRESS>][1][-][error][yii\base\ErrorException:2] exception 'yii\base\ErrorException' with message 'file_exists(): open_basedir restriction in effect. File(/dev/urandom) is not within the allowed path(s): (/home/jafaripu:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp)' in /home/vendor/yiisoft/yii2/base/Security.php:453
Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleError(2, 'file_exists(): ...', '/home/jafaripu/...', 453, Array)
#1 /home/vendor/yiisoft/yii2/base/Security.php(453): file_exists('/dev/urandom')
#2 /home/vendor/yiisoft/yii2/base/Security.php(503): yii\base\Security->generateRandomKey(32)
#3 /home/vendor/yiisoft/yii2/web/Request.php(1292): yii\base\Security->generateRandomString()
#4 /home/vendor/yiisoft/yii2/web/Request.php(1260): yii\web\Request->generateCsrfToken()
#5 /home/vendor/yiisoft/yii2/helpers/BaseHtml.php(275): yii\web\Request->getCsrfToken()
#6 /home/frontend/views/layouts/main.php(25): yii\helpers\BaseHtml::csrfMetaTags()
#7 /home/vendor/yiisoft/yii2/base/View.php(325): require('/home/jafaripu/...')
#8 /home/vendor/yiisoft/yii2/base/View.php(247): yii\base\View->renderPhpFile('/home/jafaripu/...', Array)
#9 /home/vendor/yiisoft/yii2/base/Controller.php(382): yii\base\View->renderFile('/home/jafaripu/...', Array, Object(frontend\controllers\AdverController))
#10 /home/vendor/yiisoft/yii2/base/Controller.php(368): yii\base\Controller->renderContent('<div class="row...')
#11 /home/frontend/controllers/adver/Index.php(23): yii\base\Controller->render('index', Array)
#12 [internal function]: frontend\controllers\adver\Index->run()
#13 /home/vendor/yiisoft/yii2/base/Action.php(92): call_user_func_array(Array, Array)
#14 /home/vendor/yiisoft/yii2/base/Controller.php(151): yii\base\Action->runWithParams(Array)
#15 /home/vendor/yiisoft/yii2/base/Module.php(455): yii\base\Controller->runAction('index', Array)
#16 /home/vendor/yiisoft/yii2/web/Application.php(83): yii\base\Module->runAction('adver/index', Array)
#17 /home/vendor/yiisoft/yii2/base/Application.php(375): yii\web\Application->handleRequest(Object(yii\web\Request))
#18 /home/frontend/web/index.php(20): yii\base\Application->run()
#19 {main}

@tom-- any ideas on a good fallback in this case?

@jafaripur it's freebsd?

@jafaripur what is distr?

@lynicidn The latest Yii2, Updated with composer and "minimum-stability": "dev" option.

@jafaripur
cat /etc/release_[debian|other]

also run:
ls -la /dev/urandom

Done it this way on a CentOS. In virtual host of Apache:
php_admin_value open_basedir "/var/www/my_project:/dev/urandom"

@a-komarev  Maybe sharing hosting don't allow to use this for security reason. I think fallback should be consider in code.

is it possible to test is_readable with openbasedir?

We should to check open_basedir is enable or not:
if (strlen( ini_get( 'open_basedir' ) ) > 0 && file_exists('/dev/urandom')) {
...
}
if (strlen( ini_get( 'open_basedir' ) ) > 0 && php_uname('s') !== 'Linux' && file_exists('/dev/random')) {
..
}

http://stackoverflow.com/questions/3690273/did-i-understand-dev-urandom

How about @ ?
:/

@lynicidn yes, i think i understand urandom.
http://www.2uo.de/myths-about-urandom/
http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/
https://marc.info/?t=142475987200001&r=1&w=2

With this issue, Yii2 can't run in shared hosting! A fallback should be define for this purpose to use open_ssl instead /dev/random

@tom-- any issues if we'll use is_readable to check for /dev/urandom and /dev/random instead of file_exists? This way it will gracefully fall back to openssl_random_pseudo_bytes.

The only way to fix it is to silence file_exists checks with @.

@tom-- any objections?

At list put open_basedir check in requirenments

And IMO as this change may break BC in some circumstances - framework at least till 2.1.0 could be distributed with SecurityLegacy component to allow just easily switch them in config.
Otherwise some users may have situation when they will be stuck to old versions not having the benefits of other updates.

@samdark The algorithm expects failure to read from those devices under certain conditions. What I hadn't taken into account is all the conditions in which trying to read them triggers an error. So whatever technique works best to silence those is good.

@SDKiller That's correct. The conditions under which someone will experience BC failure, I imagine, are very rare. But it's possible.
There is no great pressure to replace Mcrypt in 2.0.3. We should get to it soon but it's not actually urgent.
There has been some discussion on php-internals that's got me thinking and I'm curious about perhaps adding support for the Fernet protocol. I'm thinking the design currently exposes too much of OpenSSL when we could completely hide it and thus make changes such as this one, or adding new ciphers, easier in future.
So I'm inclined to push this into 2.1 and take some time to think about these things and look at possible designs.

https://github.com/yiisoft/yii2/commit/4fffd8fcef4c4b38393ed27cba6772c9c1de1dcd

I like what we have as is. For 2.1 we may adjust it.

@samdark php_uname() is disabled in some of shared hosting for security reason, also this need to add @  for prevent from warning!

Previous implementation with mcrypt does not contains read from '/dev/urandom' or phpuname(). Last one used wrong since php manual clean about what to do if you just need OS name. Also previous implementation was much more cleaner. I think we need revert it back to mcrypt (whole php world live with that and nobody complain).

how u solve problem don't know distribution? i think he have freebsd or other not linux dist (it's not classic way for home path - /home/vendor/yiisoft/yii2/base/Security.php:453) - read about alternative http://en.wikipedia.org/?title=/dev/random#EGD_as_an_alternative. I am repeat question:
what show command?
ls -la /dev/urandom

@lynicidn Simple example from people who care about multi-platforms: https://github.com/laravel/framework/blob/5.0/src/Illuminate/Encryption/Encrypter.php#L248

@creocoder https://github.com/yiisoft/yii2/commit/d7346cbfafbb0de0e66d37485d4be1f8b55545c2

@creocoder mcrypt isn't supported for too long. And people complained strong enough.

If you want to get rid of the second attempt, reading /dev/random on non-Linux, thus avoiding the uname test, it should be fine. Most other Unix-like systems (I don't know about all) have /dev/urandom for Linux compat. So there can't be many systems that will fail the first attempt but will succeed the second. Furthermore, the consequences of needing to use the third attempt, OpenSSL, is by no means disastrous. It's just that there are reasons to prefer the system.
Since I pushed this version, a proposed patch for PHP 7 has been published corresponding to a new RFC Easy User-land CSPRNG. They have started using /dev/arandom which is not widely implemented yet. It comes from OpenBSD but it seems other systems are going to adopt the same. At this stage I'm not sure it's worth following this logic but maybe in a year or so.

does it will still add up the error in error_log file if we silence it using @ ? If yes, i think yii should add option to tell if the web app are in shared hosting or not via config, should add in the security Manager component add a property like isSharedHost to true if in shared host false if in VPS

@samdark in php 5.5.0 you may already know there are password_hash() so there is no need to read urandom which will be inacessible by shared hosting, i hope yii next major ver / 2.1 will use it
(http://php.net/manual/en/function.password-hash.php)

@johnss 2.0 uses it. And we need random data for various things besides password salts.

@tom--
what are example of thoose various things ?
there many ways of generating secure random values but the most popular ses to be urandom, there are alternatives such as openssl, there are no reason that urandom is a must
http://serverfault.com/questions/6440/is-there-an-alternative-to-dev-urandom

Encryption keys, pads, initialization vectors, nonces, auth keys, generating random passwords and shared secrets, lots of stuff...
There are actually very few ways to obtain random numbers in a reasonably safe way. And history shows how easy it is to screw up even if you know what you're doing. For PHP scripts that need to be portable the problem is more severe. Until PHP 7.0 it has actually been impossible to obtain them in all runtime configurations. This is why Yii will sometimes fail to return a random number when asked.

@samdark and to all yii dev team maybe already know that in php 7 there are random_bytes() future yii version must use this func
http://php.net/manual/en/function.random-bytes.php

@johnss I mentioned random_bytes() here in February. When available, it's clearly the right thing to use.
I'm preparing a PR but with PHP 7.0's release scheduled for mid November it's not super urgent.

i think openssl pseudo random are sufficient as laravel use it, there are no other alternative via native func, WordPress generate secret key by using api via https://api.wordpress.org/secret-key/1.1/salt/ maybe this can be used in yii or use other online key generator

@johnss online key generator isn't an option. Yii is widely used for high-security projects where internet connection isn't an option at all.

@johnss i wish you would check your facts. once again you're asking for Yii to do something it already does.
but yii uses openssl's rng as a last resort. i'm really comfortable with using it at all and i think we should remove it in 2.1. read what Thomas Ptacek has to say about user space rngs in general and openssl's in particular.
wordpress is certainly no guide to security techniques. neither is laravel for that matter, although it has improved recently. pointing at what other projects do is an argument that doesn't work.

@tom-- I know yii already use openssl, i only want to know if there are issues with openssl, but if you are not satisfied with openssl you should cite an credible source instead of amateur blog post

@johnss Thomas Ptacek is no amateur.

More than 15 years in security of which almost 10 he was running his own security-oriented company. Definitely not amateur :)


JAMES-3261 Fix dead links I generated during JIBification of our container fleet

After merge I devote myself to do a website release.
I removed event.xml as the file no longer exists.

TODO : documentation website release

Done ;-)


Run always on 8.1

Hi,
When I launch project on ios simulator like that:
openfl run ios -simulator
the simulator is always on 8.1 sdk
Launch app on "com.apple.CoreSimulator.SimDeviceType.iPhone-6, 8.1"
I've got 7.3.1 Xcode
I don't see what I can do to fix it
Thanks

Let's discuss this in the lime issue.

Ok thanks


Add new SymbolRole.MainProgram to indicate an executable entrypoint

It would be nice if there was a way for indexers to indicate locations with main entrypoints. This would make it possible to build a UI where users can easily discover main entrypoints in a given codebase.

Similar use case: highlighting unsafe code in a Rust codebase.


docs: how to deploy with external aws account

I am creating a new page because I believe it doesn't fit well within the current pages and their sections.
Please let me know if it would be more suitable to place it on another page.
ref: #3527

📚 Documentation preview 📚: https://2i2c-pilot-hubs--3594.org.readthedocs.build/en/3594/

Thanks for the suggestions @GeorgianaElena!


Adds option to ignore signature enforcement in @when.

This is useful when customizing/adding hooks to the @when decorator.

I don't want to accept this because it makes the API more complex for beginners in support of something advanced and obscure. What problem are you trying to solve? Please open a bug to discuss and I can try to find you a better solution.


Unsend & Read receipt status

Is your feature request related to a problem? Please describe.
I'm playing around try to add chat to our app. But I haven't found a way to unsend the message and add Read Receipt status for each/ group of messages.
Unsend a message.
I want to be able to unsend a specific message, and replace with another UI like Facebook.
Currently the controller doesn't have unsend/delete function and the Message don't have any property to indicate which message was deleted/ unsent.
This is the UI that I want to archive.

Read Receipt status
On the folder preview -> reciepts_test.gif I saw that you guys have that feature. But when I try the example with latest version. I don't have option/ configuration to enable that. So how can I archive this ?
Thanks.

@dongnqda  What version you are using?
For deleting a message, when you long press a bubble, SnackBar appears with the reply,unsend, and more buttons you can implement your deletion logic there.  like this
ChatView(
  ...
  replyPopupConfig: ReplyPopupConfiguration(
    backgroundColor: Colors.white,
    onUnsendTap:(message){                   // message is 'Message' class instance
       //  Remove the message from [initalMessageList] in [ChatController]
    },
    onReplyTap:(message){                    // message is 'Message' class instance
       // Your code goes here
    },
    onReportTap:(){
       // Your code goes here
    },
    onMoreTap:(){
       // Your code goes here
    },
  ),
  ...
)

In order to achieve the UI you mentioned you can use CustomMessageBuilder with MessageType.custom, which is defined MessageConfiguration.
For, achieving this kind of receipts,  use receiptsBuilder defined inside ChatBubbleConfiguration like this
ChatView(
   ...
      featureActiveConfig: const FeatureActiveConfig(
            /// Controls the visibility of message seen ago receipts default is true
            lastSeenAgoBuilderVisibility: false,
            /// Controls the visibility of the message [receiptsBuilder]
            receiptsBuilderVisibility: false),
       ChatBubbleConfiguration(
          inComingChatBubbleConfig: ChatBubble(
            onMessageRead: (message) {
              /// send your message reciepts to the other client
              debugPrint('Message Read');
            },

          ),
          outgoingChatBubbleConfig: ChatBubble(
              receiptsWidgetConfig: ReceiptsWidgetConfig(
                      /// custom receipts builder
                      receiptsBuilder: _customReceiptsBuilder,
                      /// whether to display receipts in all
                      /// message or just at the last one just like instagram
                      showReceiptsIn: ShowReceiptsIn.lastMessage
              ),
            ),
        ),

  ...

)

A Tip for implementation
When deleting a message, in your case don't remove it completely from the initialMessageList  which is defined inside ChatController,  just create a new instance of that message that you are deleting change the MessageType  to MessageType.custom , insert it at the same index. By default when you insert the message will have a default state of MessageStatus.pending  after successfully sending the message deletion receipts to another client just update the status to MessageStatus.delivered or MessageStatus.read whatever you want.
Note
The message seen feature has been added recently, so we have not released a new version at pub.dev
Thanks and regards,
Stay Tuned

@Yogesh-Dubey-Ayesavi Hi Yogesh-Dubey-Ayesavi, thanks for quick response.
I'm using chatview: ^1.2.1 version.
In the example code, it worked fine, but when I use it for my project.
Class FeatureActiveConfig  doesn't have these params : lastSeenAgoBuilderVisibility | receiptsBuilderVisibility

Also with receiptsWidgetConfig of class ChatBubble.
But as you mentioned, it was because the version on pub.dev wasn't latest. So I think I'm looking forward to it. It such a great package for chat application. Thanks.

You can fork right now if you want, although since we testing some blazing new functionalities so  it may can take upto a week Stay Tuned

@dongnqda  Kindly close the issue, if you resolved it.

@Yogesh-Dubey-Ayesavi Thank you.

@Yogesh-Dubey-Ayesavi Hi Yogesh-Dubey-Ayesavi, I'm wonder when will you guys publish new version ? It has been almost 1 month now, Otherwise I will be forced to find another package. Thanks

Right now we're testing, some new APIS and models, that'll take sometime @dhvanit-v-simformsolutions  @DhavalRKansara  will release a new version sooner, it's hard to commit the date now.
Sorry for the inconvenience
Thanks and regards.


buildPythonPackage: fix typos

Hmm, this will rebuild a lot of python packages. Best if we merge it together with some other work.

Thank btw! :)

@FRidh could we also take these changes to python-wip?

Fixed in 9acba92687520d715d994509f6192704b3cc48fb, will land shortly in master


🐞 [Bug]: I get This twin id doesn't exist when trying to transfer funds

Is there an existing issue for this?

[X] I have searched the existing issues

which package/s did you face the problem with?
Dashboard
What happened?
When I'm trying to transfer funds by twin id I get  This twin id doesn't exist Even though when I try to transfer funds by address and use its address it passes validation.
Steps To Reproduce

Connect your wallet
Navigate to TFChain section then to TF token transfer
choose transfer by twin id
Input a valid twin id, I used 89

which network/s did you face the problem on?
QA
version
2.3.5
Twin ID/s
No response
Node ID/s
No response
Farm ID/s
No response
Contract ID/s
No response
Relevant screenshots/screen records

Relevant log output
N/A

Twin exists in the mentioned network.

@maayarosama  can you please provide the mentioned account address?

the mentioned account address 5GNU4aqL9JPj79hUDyPrPPTCpaMcd3LRAmyXvvWUZYtNcLZb on QA has twin id  32,

and the twin id 89 doesn't exist on Qa

will move the issue to verification

Verified, QA.
The twin 89 was deleted from Qanet.

So the validation is working fine.


[bug]: segmentation fault on AMD GPU

Is there an existing issue for this?

[X] I have searched the existing issues

OS
Linux
GPU
amd
VRAM
8GB
What happened?
Program installs and starts just fine, but when I hit the "Invoke" button, I immediately get a segmentation fault.
$ invokeai --web 2>&1
* Initializing, be patient...
>> Initialization file /home/user/invokeai/invokeai.init found. Loading...
>> Internet connectivity is False
>> InvokeAI, version 2.3.1.post2
>> InvokeAI runtime directory is "/home/user/invokeai"                                                                >> GFPGAN Initialized                                                                                >> CodeFormer Initialized                                                                                >> ESRGAN Initialized
>> Using device_type cuda
>> xformers not installed
>> NSFW checker is disabled
>> Current VRAM usage:  0.00G
>> Loading diffusers model from stabilityai/stable-diffusion-2-1
  | Using faster float16 precision
** An unexpected error occurred while downloading the model: stabilityai/stable-diffusion-2-1 does not appear to have a
file named model_index.json.)
  | Default image dimensions = 768 x 768
>> Model loaded in 0.77s
>> Max VRAM used to load the model: 0.00G
>> Current VRAM usage:0.00G
>> Loading embeddings from /home/user/invokeai/embeddings
>> Textual inversion triggers:
>> Setting Sampler to k_lms (LMSDiscreteScheduler)
* --web was specified, starting web server...
* Initializing, be patient...
>> Initialization file /home/user/invokeai/invokeai.init found. Loading...
>> Started Invoke AI Web Server!
>> Default host address now <IP_ADDRESS> (localhost). Use --host <IP_ADDRESS> to bind any address.
>> Point your browser at http://<IP_ADDRESS>:9090
>> System config requested
>> patchmatch.patch_match: INFO - Compiling and loading c extensions from "/home/user/invokeai/.venv/lib/python3.10/site-packages/patchmatch".
>> patchmatch.patch_match: ERROR - patchmatch failed to load or compile (Command 'make clean && make' returned non-zero exit status 2.).
>> patchmatch.patch_match: INFO - Refer to https://invoke-ai.github.io/InvokeAI/installation/060_INSTALL_PATCHMATCH/ for installation instructions.
>> Patchmatch not loaded (nonfatal)

>> Image Generation Parameters:

{'prompt': 'banana sushi', 'iterations': 1, 'steps': 50, 'cfg_scale': 7.5, 'threshold': 0, 'perlin': 0, 'height': 512, 'width': 512, 'sampler_name': 'k_lms', 'seed':<PHONE_NUMBER>, 'progress_images': False, 'progress_latents': True, 'save_intermediates': 5, 'generation_mode': 'txt2img', 'init_mask': '...', 'hires_fix': False, 'seamless': False, 'variation_amount': 0}

>> ESRGAN Parameters: False
>> Facetool Parameters: False
[1]    1147376 segmentation fault (core dumped)  invokeai --web 2>&1

I'm using v2.3.1-post-2
I've tried other models and get the same result. I do not have this issue with  invokeai v1.3
I've been playing around with other AI libraries lately and been encountering segfaults, too. Still haven't figured out why in most cases.
Here's the output from rocminfo:
ROCk module is loaded
=====================
HSA System Attributes
=====================
Runtime Version:         1.1
System Timestamp Freq.:  1000.000000MHz
Sig. Max Wait Duration:<PHONE_NUMBER>3709551615 (0xFFFFFFFFFFFFFFFF) (timestamp count)
Machine Model:           LARGE
System Endianness:       LITTLE

==========
HSA Agents
==========
*******
Agent 1
*******
  Name:                    Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
  Uuid:                    CPU-XX
  Marketing Name:          Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
  Vendor Name:             CPU
  Feature:                 None specified
  Profile:                 FULL_PROFILE
  Float Round Mode:        NEAR
  Max Queue Number:        0(0x0)
  Queue Min Size:          0(0x0)
  Queue Max Size:          0(0x0)
  Queue Type:              MULTI
  Node:                    0
  Device Type:             CPU
  Cache Info:
    L1:                      32768(0x8000) KB
  Chip ID:                 0(0x0)
  ASIC Revision:           0(0x0)
  Cacheline Size:          64(0x40)
  Max Clock Freq. (MHz):   4500
  BDFID:                   0
  Internal Node ID:        0
  Compute Unit:            8
  SIMDs per CU:            0
  Shader Engines:          0
  Shader Arrs. per Eng.:   0
  WatchPts on Addr. Ranges:1
  Features:                None
  Pool Info:
    Pool 1
      Segment:                 GLOBAL; FLAGS: FINE GRAINED
      Size:                    31790420(0x1e51554) KB
      Allocatable:             TRUE
      Alloc Granule:           4KB
      Alloc Alignment:         4KB
      Accessible by all:       TRUE
    Pool 2
      Segment:                 GLOBAL; FLAGS: KERNARG, FINE GRAINED
      Size:                    31790420(0x1e51554) KB
      Allocatable:             TRUE
      Alloc Granule:           4KB
      Alloc Alignment:         4KB
      Accessible by all:       TRUE
    Pool 3
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED
      Size:                    31790420(0x1e51554) KB
      Allocatable:             TRUE
      Alloc Granule:           4KB
      Alloc Alignment:         4KB
      Accessible by all:       TRUE
  ISA Info:
*******
Agent 2
*******
  Name:                    gfx1030
  Uuid:                    GPU-XX
  Marketing Name:          Radeon RX 580 Series
  Vendor Name:             AMD
  Feature:                 KERNEL_DISPATCH
  Profile:                 BASE_PROFILE
  Float Round Mode:        NEAR
  Max Queue Number:        128(0x80)
  Queue Min Size:          64(0x40)
  Queue Max Size:          131072(0x20000)
  Queue Type:              MULTI
  Node:                    1
  Device Type:             GPU
  Cache Info:
    L1:                      16(0x10) KB
  Chip ID:                 26591(0x67df)
  ASIC Revision:           1(0x1)
  Cacheline Size:          64(0x40)
  Max Clock Freq. (MHz):   1366
  BDFID:                   256
  Internal Node ID:        1
  Compute Unit:            36
  SIMDs per CU:            4
  Shader Engines:          4
  Shader Arrs. per Eng.:   1
  WatchPts on Addr. Ranges:4
  Features:                KERNEL_DISPATCH
  Fast F16 Operation:      TRUE
  Wavefront Size:          64(0x40)
  Workgroup Max Size:      1024(0x400)
  Workgroup Max Size per Dimension:
    x                        1024(0x400)
    y                        1024(0x400)
    z                        1024(0x400)
  Max Waves Per CU:        40(0x28)
  Max Work-item Per CU:    2560(0xa00)
  Grid Max Size:<PHONE_NUMBER>(0xffffffff)
  Grid Max Size per Dimension:
    x<PHONE_NUMBER>(0xffffffff)
    y<PHONE_NUMBER>(0xffffffff)
    z<PHONE_NUMBER>(0xffffffff)
  Max fbarriers/Workgrp:   32
  Pool Info:
    Pool 1
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED
      Size:                    8388608(0x800000) KB
      Allocatable:             TRUE
      Alloc Granule:           4KB
      Alloc Alignment:         4KB
      Accessible by all:       FALSE
    Pool 2
      Segment:                 GROUP
      Size:                    64(0x40) KB
      Allocatable:             FALSE
      Alloc Granule:           0KB
      Alloc Alignment:         0KB
      Accessible by all:       FALSE
  ISA Info:
    ISA 1
      Name:                    amdgcn-amd-amdhsa--gfx1030
      Machine Models:          HSA_MACHINE_MODEL_LARGE
      Profiles:                HSA_PROFILE_BASE
      Default Rounding Mode:   NEAR
      Default Rounding Mode:   NEAR
      Fast f16:                TRUE
      Workgroup Max Size:      1024(0x400)
      Workgroup Max Size per Dimension:
        x                        1024(0x400)
        y                        1024(0x400)
        z                        1024(0x400)
      Grid Max Size:<PHONE_NUMBER>(0xffffffff)
      Grid Max Size per Dimension:
        x<PHONE_NUMBER>(0xffffffff)
        y<PHONE_NUMBER>(0xffffffff)
        z<PHONE_NUMBER>(0xffffffff)
      FBarrier Max Size:       32
*** Done ***

I also have HSA_OVERRIDE_GFX_VERSION=10.0.3. If I unset HSA_OVERRIDE_GFX_VERSION and start the invokeai web I get the error "hipErrorNoBinaryForGpu: Unable to find code object for all current devices!"
How would I determine where this segfault is coming from?
Screenshots
No response
Additional context
No response
Contact Details
No response

I had the same issue with nvidia actually. Segmentation errors left and right. Manjaro arch Linux. Installing using the auto installer. Found out I had to delete whole installation and reinstall using python. Sucks but actually worked. Not sure how or why.
Working now but now I have a different issue with blank black images.

@Lolagatorade I believe I got to the bottom of the black images problem earlier today and have posted a fix which will appear in 2.3.2 (coming soon).
@src-r-r I feel your pain. ROCm support is very spotty and I've had numerous difficulties with AMD GPUs. Generally the problem is with the torch library and I have had to recompile pytorch from source code in order to get a stable system. You can try to load different versions of torch and see if one is more stable than other. To do so, enter the "developer's console" and try loading the "nightly preview" version following the "pip install" instructions at https://pytorch.org/get-started/locally/

#3227

Your GPU does not support ROCM.
https://en.wikipedia.org/wiki/ROCm#Consumer-grade_GPUs

I have the same issue I also noticed this error message in dmesg:
[  264.032168] invokeai[1521]: segfault at 20 ip 00007f9c9a6b40a7 sp 00007ffd2bb33f00 error 4 in libamdhip64.so[7f9c9a600000+3f3000]
[  264.032178] Code: 8d 15 5d 6d 25 00 48 8d 3d f6 6c 25 00 be 32 00 00 00 e8 dc ed 1f 00 e8 c7 ed 1f 00 48 8b 45 b8 48 8b 50 28 4c 8b 24 da 31 c0 <41> 80 7c 24 20 00 74 11 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d

I managed to make it work by making sure i install nightly build of torch first with
pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm5.4.2

The i install invokeai from the repo with pip install -e but i make sure i remove the torch dependency from the pyproject.toml first so it doesn't override the already installed version.

It is also segfaulting for me using my AMD Radeon 55500XT.
Running on the CPU is fine (AMD Ryzen 7 3700X).
I tried using the auto installer as well as installing it manually with python, but no difference. Unfortunately @muhamadazmy suggestion above also did not work for me.
Each try, this was the log output from the time starting invokeai --web until it crashed:
amdgpu.ids: No such file or directory
amdgpu.ids: No such file or directory
* Initializing, be patient...
>> Initialization file /home/puresick/invokeai/invokeai.init found. Loading...
>> Internet connectivity is True
>> InvokeAI, version 2.3.5.post2
>> InvokeAI runtime directory is "/home/puresick/invokeai"
>> GFPGAN Initialized
>> CodeFormer Initialized
>> ESRGAN Initialized
>> Using device_type cuda
>> CUDA device 'AMD Radeon Graphics' (GPU 0)
>> xformers not installed
>> NSFW checker is disabled
>> Current VRAM usage:  0.00G
>> Loading diffusers model from stabilityai/stable-diffusion-2-1
   | Using faster float16 precision
   | Default image dimensions = 768 x 768
>> Model loaded in 2.19s
>> Max VRAM used to load the model: 2.60G
>> Current VRAM usage:2.60G
>> Loading embeddings from /home/puresick/invokeai/embeddings
>> Textual inversion triggers:
>> Setting Sampler to k_lms (LMSDiscreteScheduler)

* --web was specified, starting web server...
* Initializing, be patient...
>> Initialization file /home/puresick/invokeai/invokeai.init found. Loading...
>> Started Invoke AI Web Server!
>> Default host address now <IP_ADDRESS> (localhost). Use --host <IP_ADDRESS> to bind any address.
>> Point your browser at http://<IP_ADDRESS>:9090
>> System config requested
>> patchmatch.patch_match: ERROR - patchmatch failed to load or compile (libvtkFiltersTexture.so.1: cannot open shared object file: No such file or directory).
>> patchmatch.patch_match: INFO - Refer to https://invoke-ai.github.io/InvokeAI/installation/060_INSTALL_PATCHMATCH/ for installation instructions.
>> Patchmatch not loaded (nonfatal)
>> System config requested

>> Image Generation Parameters:

{'prompt': 'banana sushi', 'iterations': 1, 'steps': 50, 'cfg_scale': 7.5, 'threshold': 0, 'perlin': 0, 'height': 512, 'width': 512, 'sampler_name': 'k_lms', 'seed': 479169790, 'progress_images': False, 'progress_latents': True, 'save_intermediates': 5, 'generation_mode': 'txt2img', 'init_mask': '...', 'hires_fix': False, 'seamless': False, 'variation_amount': 0}

>> ESRGAN Parameters: False
>> Facetool Parameters: False
Segmentation fault (core dumped)

What is the reason this issue has been closed @hipsterusername?

We’ve released the 3.0 alpha and it’s a general reset on any issues experienced with the app. If you experience the same segfaulting, I’d advise creating a new issue

Someone has updates on this? Still have the problem with 3.1.1
I saw this issue that shows some workaround but there is no way for to solve this staying with the installation script?

@TheKarls As far as I know this is still somewhat unsolved.
Personally I prevented InvokeAI from segfaulting by setting the environment variable HSA_OVERRIDE_GFX_VERSION=10.3.0, but this leads to the following issue: https://github.com/invoke-ai/InvokeAI/issues/4364.
Also, what hardware configuration are you using? That will be helpful for the InvokeAI team to work on this.

I'm on Arch Linux, with a 6700XT GPU
I also tried to run it with rocm 5.2, It works but only with CPU, the gpu is not recognised.

After some puzzling I got it to work on my 7900XTX on Arch with kernel 6.5.6, using a heavily modified Docker setup:
Dockerfile
# syntax=docker/dockerfile:1.4

# Build the Web UI
FROM node:18 AS web-builder
WORKDIR /build
COPY invokeai/frontend/web/ ./

RUN --mount=type=cache,target=/root/.cache/pip pip install .[onnx-cuda]
COPY --link --from=web-builder /build/dist ${INVOKEAI_SRC}/invokeai/frontend/web/dist

# build patchmatch
RUN cd /usr/lib/$(uname -p)-linux-gnu/pkgconfig/ && ln -sf opencv4.pc opencv.pc
RUN python3 -c "from patchmatch import patch_match"

# Create unprivileged user and make the local dir
RUN userdel $(getent passwd 1000 | cut -d: -f1) && useradd --create-home --shell /bin/bash -u 1000 -G video --comment "container local user" invoke
RUN mkdir -p ${INVOKEAI_ROOT} && chown -R invoke:invoke ${INVOKEAI_ROOT}

COPY docker/docker-entrypoint.sh ./
ENTRYPOINT ["/opt/invokeai/docker-entrypoint.sh"]
CMD ["invokeai-web", "--host", "<IP_ADDRESS>"]

docker-compose.yml
version: '3.8'

services:
  invokeai:
    build:
      context: ..
      dockerfile: docker/Dockerfile
    environment:
      HSA_OVERRIDE_GFX_VERSION: 11.0.0
    devices:
      - /dev/dri:/dev/dri
      - /dev/kfd:/dev/kfd
    ports:
      - 9090:9090/tcp
    volumes:
      - ./data:/invokeai
    command: ["invokeai-web", "--host", "<IP_ADDRESS>"]

Biggest difference is installing in the global env (not a venv) in the AMD ROCm Docker image. I suppose those have some extra customizations that fixed most of my issues.
Anyway, sharing here in the hope it'll prove useful for someone else.

After some puzzling I got it to work on my 7900XTX on Arch with kernel 6.5.6 and 7837746 (latest main when I checked out, though tag 3.2.0 will probably work too), using a heavily modified Docker setup:
Dockerfile
# syntax=docker/dockerfile:1.4

# Build the Web UI
FROM node:18 AS web-builder
WORKDIR /build
COPY invokeai/frontend/web/ ./

RUN --mount=type=cache,target=/root/.cache/pip pip install .[onnx-cuda]
COPY --link --from=web-builder /build/dist ${INVOKEAI_SRC}/invokeai/frontend/web/dist

# build patchmatch
RUN cd /usr/lib/$(uname -p)-linux-gnu/pkgconfig/ && ln -sf opencv4.pc opencv.pc
RUN python3 -c "from patchmatch import patch_match"

# Create unprivileged user and make the local dir
RUN userdel $(getent passwd 1000 | cut -d: -f1) && useradd --create-home --shell /bin/bash -u 1000 -G video --comment "container local user" invoke
RUN mkdir -p ${INVOKEAI_ROOT} && chown -R invoke:invoke ${INVOKEAI_ROOT}

COPY docker/docker-entrypoint.sh ./
ENTRYPOINT ["/opt/invokeai/docker-entrypoint.sh"]
CMD ["invokeai-web", "--host", "<IP_ADDRESS>"]

docker-compose.yml
version: '3.8'

services:
  invokeai:
    build:
      context: ..
      dockerfile: docker/Dockerfile
    environment:
      HSA_OVERRIDE_GFX_VERSION: 11.0.0
    devices:
      - /dev/dri:/dev/dri
      - /dev/kfd:/dev/kfd
    ports:
      - 9090:9090/tcp
    volumes:
      - ./data:/invokeai
    command: ["invokeai-web", "--host", "<IP_ADDRESS>"]

Biggest difference is installing in the global env (not a venv) in the AMD ROCm Docker image. I suppose those have some extra customizations that fixed most of my issues.
Anyway, sharing here in the hope it'll prove useful for someone else.

It works! Thank you so much! I really can't thank you enough

./invoke.sh: line 37: 26519 Segmentation fault      (core dumped) invokeai-web $PARAMS
Still seg fault on 4.2.4

Still seg fault on 4.2.4

Possibly it is ROCm + unsupported GPU. I also has segfaults on a couple of ROCm 5.6 + gfx803 (RTX 570). Also people say such models anyway give no real advantages over CPU generation.
For some models nevertheless there are custom kits users can try.

I figured out there is no ROCm support for the 5700xt unfortunatly.

5.0.0 was working and after that the error returned on ubuntu : https://github.com/invoke-ai/InvokeAI/issues/7091


Add support for proxy as prometheus remote storage

I need to migrate this project to govendor before this will work... stand by for a prequel to this pr

I have actually tested this branch with some sample prometheus metrics and it seems to work fine at small workloads at least.
A  thing to note:
Default URL to write metrics is set to be /receive which differs from the default of /write in prometheus docs at https://github.com/prometheus/prometheus/blob/master/documentation/examples/remote_storage/remote_storage_adapter/README.md. It probably makes sense to change that to match.

I have actually tested this branch with some sample prometheus metrics and it seems to work fine at small workloads at least.
A  thing to note:
Default URL to write metrics is set to be /receive which differs from the default of /write in prometheus docs at https://github.com/prometheus/prometheus/blob/master/documentation/examples/remote_storage/remote_storage_adapter/README.md. It probably makes sense to change that to match.

I have actually tested this branch with some sample prometheus metrics and it seems to work fine at small workloads at least.
A  thing to note:
Default URL to write metrics is set to be /receive which differs from the default of /write in prometheus docs at https://github.com/prometheus/prometheus/blob/master/documentation/examples/remote_storage/remote_storage_adapter/README.md. It probably makes sense to change that to match.

I have actually tested this branch with some sample prometheus metrics and it seems to work fine at small workloads at least.
A  thing to note:
Default URL to write metrics is set to be /receive which differs from the default of /write in prometheus docs at https://github.com/prometheus/prometheus/blob/master/documentation/examples/remote_storage/remote_storage_adapter/README.md. It probably makes sense to change that to match.

I have actually tested this branch with some sample prometheus metrics and it seems to work fine at small workloads at least.
A  thing to note:
Default URL to write metrics is set to be /receive which differs from the default of /write in prometheus docs at https://github.com/prometheus/prometheus/blob/master/documentation/examples/remote_storage/remote_storage_adapter/README.md. It probably makes sense to change that to match.

@salekseev i was following the example you posted in your issue that pointed it at /receive https://github.com/prometheus/prometheus/tree/master/documentation/examples/remote_storage/example_write_adapter is /write the more widely used? i'm not super familiar with prometheus.

Yes, Prometheus examples for remote storage adapters all use /write for remote write (https://github.com/prometheus/prometheus/blob/master/documentation/examples/remote_storage/remote_storage_adapter/main.go#L205) and /read for remote read optionally.

@salekseev cool, i've made that the default but you can configure it with ListenPath in the config file. Please take a look and let me know what you think.


MatMul Broadcasting / tensordot

It would really help if matmul() and element-wise mul() were broadcastable, like in Numpy.
For example, suppose I have a T x n x k and want to multiply it by a k x k2, and then to a max pool over T and then a mean pool over n.  To do this now, I think you need to reshape, do the matmul() and then undo the reshape and then do the pooling.

element-wise mul should do broadcasting already, but feature requested noted for matmul.  Thanks!

I was going to open my own issue on this, but it seems that this one is being used for everything related to batch matrix-vector ops, numpy.dot, etc. For those looking for a workaround, I have two implementations of batch vector x matrix multiplication:
def batch_vm(v, m):
  shape = tf.shape(v)
  rank = shape.get_shape()[0].value
  v = tf.expand_dims(v, rank)

  vm = tf.mul(v, m)

  return tf.reduce_sum(vm, rank-1)

def batch_vm2(x, m):
  [input_size, output_size] = m.get_shape().as_list()

  input_shape = tf.shape(x)
  batch_rank = input_shape.get_shape()[0].value - 1
  batch_shape = input_shape[:batch_rank]
  output_shape = tf.concat(0, [batch_shape, [output_size]])

  x = tf.reshape(x, [-1, input_size])
  y = tf.matmul(x, m)

  y = tf.reshape(y, output_shape)

  return y

The first is based on the broadcasting behavior of tf.mul, while the second relies on reshaping all but the last dimension of the input to reduce the operation down to matrix-matrix multiplication. I suspect the second method is more efficient, but it might rely on the tensors being in the right memory order (although I think tf, unlike numpy, only uses C order).

This issue appears to be covered by the more specific #1062.  @vladfi1: Does #1062 do what you want, or does tf.batch_matmul work now?  We can reopen if not, but we should try to make the issue more specific if so.

Hi, I have a similar problem with which I've been struggling.
I need to encode my input data as a 4D tensor:
X = tf.placeholder(tf.float32, shape=(None, None, None, 100))
The first dimension is the size of a batch, the second the number of entries in the batch.
You can imagine each entry as a composition of a number of objects (third dimension). Finally, each object is described by a vector of 100 float values.
Note that I used None for the second and third dimensions because the actual sizes may change in each batch. However, for simplicity, let's shape the tensor with actual numbers:
X = tf.placeholder(tf.float32, shape=(5, 10, 4, 100))
These are the steps of my computation:

compute a function of each vector of 100 float values (e.g., linear function)
W = tf.Variable(tf.truncated_normal([100, 50], stddev=0.1))
Y = tf.matmul(X, W)
problem: no broadcasting for tf.matmul() and no success using tf.batch_matmul()
expected shape of Y: (5, 10, 4, 50)

applying average pooling for each entry of the batch (over the objects of each entry):
Y_avg = tf.reduce_mean(Y, 2)
expected shape of Y_avg: (5, 10, 50)

I expected that tf.matmul() would have supported broadcasting. Then I found tf.batch_matmul(), but still it looks like doesn't apply to my case (e.g., W needs to have 3 dimensions at least, not clear why).
BTW, above I used a simple linear function (the weights of which are stored in W). But in my model I have a deep network instead. So, the more general problem I have is automatically computing a function for each slice of a tensor. This is why I expected that tf.matmul() would have had a broadcasting behavior (if so, maybe tf.batch_matmul() wouldn't even be necessary).
Look forward to learning from you!
Alessio

I don't think this should be closed -- the matmul does not broadcast in tensorflow 1.3.0. Here is a minimal example:
import numpy as np
import tensorflow as tf
import numpy.random as rnd

A = rnd.randint(10, size = (5, 2, 2)).astype(np.float)
B = rnd.randint(10, size = (1, 2, 2)).astype(np.float)

print("Numpy broadcasts the first index as expected:")
print( np.matmul(A, B))

print("Tensorflow throws an exception:")
print( tf.matmul(A, B))

I am surprised that the example above fails. I would like to contribute a fix to support this. Would a PR for supporting this be considered? Or is there some ambiguity/complexity I'm not seeing?

I am surprised that so few people have this problem. I suppose it doesn't crop up often if you only do neural networks.
As a temporary workaround, I'm using this:
def broadcast_matmul(A, B):
    "Compute A @ B, broadcasting over the first `N-2` ranks"
    with tf.variable_scope("broadcast_matmul"):
        return tf.reduce_sum(A[..., tf.newaxis] * B[..., tf.newaxis, :, :],
                             axis=-2)

which is probably not very efficient but it works. Are you implementing it in the proper matmul operation, @PeterMitrano ?

I found tensordot() useful when broadcasting is needed.
`
a : tensor of shape [2, 3, 3]
a = tf.constant([[[1, 2, 3], [2, 3, 4], [1, 4, 5]], [[5, 6, 7], [6, 3, 4], [9, 0, 1]]])
b : tensor of shape [3, 4]
b = tf.constant([[2, 3, 4, 5], [8, 9, 1, 5], [0, 9, 0, 2]])
c : tensor of shape [2, 3, 4] where c[i, ...] = dot(a[i, ...], b)
c = tf.tensordot(a, b, axes=1)
`

tensordot only does batch matrix multiplication when one of the two is a rank-2 tensor, though.

I am also quite bothered by this. The same problem arises in the tf.matrix_triangular_solve as well. Currently, I am using tf.einsum as a workaround.

I would also like tf.matmul to broadcast properly. It becomes a problem when trying to add a fully connected or softmax layer in an RNN:
`outputs = tf.stack(outputs, axis=1, name='Outputs')  # Shape is [batch, sequence, embedding]
with tf.name_scope('Softmax'):
w = tf.get_variable(
name='Weight',
initializer=tf.truncated_normal([rnn_cell.output_size, embedding_size], stddev=0.01))
b = tf.get_variable(name='Bias', initializer=tf.zeros(embedding_size))
    scores = tf.matmul(outputs, w) + b  # Fails with ValueError: Shape must be rank 2 but is rank 3 for 'Softmax/MatMul' (op: 'MatMul') with input shapes: [?,50,256], [256,2569].

    softmax = tf.nn.softmax(scores, name='Softmax')`

I think proper broadcasting support for tf.matmul() would pretty clearly be a welcome addition to TensorFlow. There is certainly plenty of interest in it, and it is backwards compatible with how tf.matmul() currently works.
I suspect full support for the semantics of @ as described in https://github.com/tensorflow/tensorflow/issues/1062#issuecomment-225882004 would also be welcome, but supporting matrix-vector, vector-matrix and vector-vector multiplication with tf.matmul() would warrant more discussion given the potential for confusion.

I would also welcome broadcasting for matmul, because without broadcasting it is necessary to use tiling instead. Profiling shows this tiling is what I (and probably anyone else in need of broadcasting) lose the largest part of my (/our) processing power on. It seems plausible that a clever matmul broadcasting implementation can prevent any actual copying and thus speed up all our code by potentially eliminating the rate limiting step.
Note that capsule and matrix capsule networks (two new networks released by Hinton) could potentially benefit a lot from a broadcasting matmul; see https://github.com/ageron/handson-ml/blob/master/extra_capsnets.ipynb (specifically section Compute the Predicted Output Vectors)

I am using this until an official implementation comes around (inspired by @talhasaruhan):
import numpy as np
import tensorflow as tf

def batch_matmul(A, B):
    '''Batch support for matrix matrix product.

    Args:
        A: General matrix of size (A_Batch, M, X).
        B: General matrix of size (B_Batch, X, N).

    Returns:
        The result of multiplying A with B (A_Batch, B_Batch, M, N).
    '''
    if A.ndim == B.ndim:
        return tf.matmul(A, B)  # faster than tensordot
    with tf.name_scope('matmul'):
        AB = tf.tensordot(A, B, axes=[A.ndim - 1, B.ndim - 2])
        if B.ndim > 2:  # only if B is batched, rearrange the axes
            A_Batch = np.arange(A.ndim - 2)
            M = len(A_Batch)
            B_Batch = (M + 1) + np.arange(B.ndim - 2)
            N = (M + 1) + len(B_Batch)
            perm = np.concatenate((A_Batch, B_Batch, [M, N]))
            AB = tf.transpose(AB, perm)
    return AB

This code would still work even if both A_batch and B_batch had multiple axes or none at all. The only caveat here is when B_Batch is not empty; the shape of the output tensor would be (A_Batch, M, B_Batch, N), which requires calling tf.transpose() that copies the full tensor instead of creating an efficient view (on TensorFlow version 1.9 and older). I believe an efficient impelmentation of reshaping the inner-most axes of a tensor as a view would solve this issue but I am not aware of such function.

I understand that any fully connected NN layer requires matmul. Also, if you want performance then you need batching. So does this not mean that pretty much any neural network implementation has a need for batched matmul? What's the recommended way to do this? Many solutions are proposed here or on the web but they all seem to rely on copying lots of data causing loss of performance.

Hi @GSPP ,

I understand that any fully connected NN layer requires matmul

Yep!

So does this not mean that pretty much any neural network implementation has a need for batched matmul?

Actually, no. If you had a single example, x which is a vector, and you wanted to apply the weights and compute Wx, you need a matrix-vector multiplication. If you have a minibatch of inputs, then X is a matrix, and you compute X@W which is a matrix-matrix multiplication. At no point you need a batched matrix multiplication.
Batched matmul would be needed if, for example, you need to do a matrix-matrix multiplication for every training example and then you need to minibatch them.
Additionally, batched matmul is currently supported. What isn't supported is broadcasted batch matmul, that is, when you want to do W@X and then W is of shape [1, a, b] and X is of shape [c, b, d].

@rhaps0dy you are right and this explains, why my implementation is so complicated :grin:. Thanks for clarifying.

Has there been any progress with this? I too find this to be a highly desirable feature.
Couldn't it easily be implemented with tensordot and a transposition?   Like this:
def broadcasted_matmul(A, B):
    """ Matmul with fast broadcasting

    Args:
      A - [n, m]
      B - [batch_size, m, k]

    Returns:
      AB - [batch_size, n, k]
    """
    # [n, batch_size, k]
    AB = tf.tensordot(A, B, axes=[[1], [1]])
    # [batch_size, n, k]
    return tf.tranpose(AB, [1, 0, 2])

You could also do this using a conv1d layer with a kernel size of 1. For instance in @TheButlah examples above one could use (dims etc from above):
outputs = tf.stack(outputs, axis=1, name='Outputs')
scores = tf.layer.conv1d(inputs=outputs, kernel_size=1, filters=2569,  kernel_initializer=layers.xavier_initializer())
softmax = tf.nn.softmax(scores, name='Softmax')

This is an equivalent operation and produces the desired output of [?,50,2569]. This is obviously only practical if one of the matrices is a parameter of the model and not calculated from the data.

Dreams coming true:
https://github.com/tensorflow/tensorflow/commit/47ab68d265a96b6e7be06afd1b4b47e0114c0ee9

Going to close this issue since matmul now broadcasts, and the forward compatibility window has passed. This means if you are on tf-nightly, tf.linalg.matmul will broadcast (and users of LinearOperator will also feel the performance improvements of this).


Fix 58693

When pasting content into an element, text will no longer be formatted. Bug is added into the tester.
In reference to https://github.com/Microsoft/vscode/issues/58693

Cool, let's try that! Thanks @AHKol !